Posts

Showing posts from 2015

The Greenhouse project - Websockets, Pi, Wireless, Arduino

Image
I went along to the Raspberry Pint meetup last night. It's a lively and friendly group, and I'll be going again next month. I'd been asked to do a lightning talk, and gave an update about my Greenhouse monitor project. The background My wife and I have an allotment that's just over half a kilometre from our flat. On it there's a greenouse. At this time of year the greenhouse is full of tender seedlings and my wife likes to protect them from fluctuations in temperature. I've been working on a remote battery-powered monitor which will live in the  greenhouse and transmit temperature data over wireless (not WiFi) to a Raspberry Pi at home. The Pi will log the data and display historic values on a website which we can view from a browser or smartphone. Testing the range I'm currently using a +Wireless Things  XinoRF talking to a Slice of Radio board attached to the Pi. I need to verify that the transmitter is powerful enough to send a signal that t

Covent Garden Jam rocks!

Image
Yesterday's Raspberry Jam at Covent Garden was amazing. The Dragon Hall was packed with Raspberry Pi enthusiasts of all ages and the whole event pulsed with energy. I ran the Shrimping It! workshop  with some very welcome help from Jim Darby (@HackerJimbo). I'd never had a group that large, and I'd managed to bring the wrong glasses, so Jim saved the day. By the end of the day we had lots and lots of LEDs blinking under program control, and lots of experimenters who'd discovered how breadboards work and what a capacitor looks like. The organisers did a fantastic job, and made everyone very welcome. I'll certainly be going again. The next Covent Garden Jam will be on 20th June, and I've got the date in my diary.

Shrimping It at Covent Garden tomorrow

Image
I'm really looking forward to tomorrow's session at the Covent Garden Raspberry Jam. There's lots to see and do. The Minecraft session is bound to be popular, and I'll be running another Shrimping It! workshop. Making the Shrimp The Shrimp (created by Cefn Hoile and friends) is a simple, low-cost Arduino clone on a breadboard. Workshop participants pay £10, for which they get a kit of parts, a breadboard, and a USB programmer, and a copy of Making the Shrimp. That's a low-cost e-book which contains a step-by-step illustrated guide to building the Shrimp. ( Disclosure - I wrote it). We've limited numbers to 20, as that's the largest group size I can comfortably manage. The tickets sold out a couple of weeks ago, so we're expecting a full house! Shrimping on your own If you haven't booked for tomorrow's workshop, you can buy the parts from the Shrimping It! website and build it on your own. The parts cost just over £10 including po

Raspberry Pi and Pints at Potton

I'm off to Potton tomorrow for a Pint or two at the Rising Sun with fellow Raspberry Pint enthusiasts. These informal sessions are run by Mike Horn and Tim Richardson, who also organise the excellent CamJams. If Pi and Pints appeal, there are still a few tickets available on Eventbrite . The event is free, and the tickets are there to make sure the room at the pub doesn’t get overcrowded. A gardening project I'll be taking along a project for my wife's greenhouse. It involves linking a Pi at home to a XinoRF in the greenhouse at her allotment using wireless radio. The Pi uses wireless things ' Slice of Radio. The XinoRF (also from wireless things ) is a wireless-enabled Arduino clone. The basic set-up now works well, but getting it going has been trickier than I expected. I'll be describing the mistake I made and its simple solution in next week's edition of my free newsletter, along with additional details of the software at each end. You can subsc

More fun with the Pimoroni Explorer HAT

Image
I've been playing a bit more with the new Pimoroni Explorer HAT . One of the most exciting features of the Pro version is the analogue interface. Once you've installed the ExplorerHAT package using pip, you can try typing in the examples in the README on github. If you want some more examples, you can clone the github repository into a directory of your choice. Then you'll be able to run the code from the examples directory. Type git clone https://github.com/pimoroni/explorer-hat.git cd explorer-hat sudo python examples/analog-event.py You'll see a series of rapidly varying numbers displayed in the console. These show the current voltage as seen on analogue input 1. Since you (presumably) haven't connected that to anything, the output will be fluctuating random values. To see something more sensible, use a jump wire to connect analogue input 1 to the Hat's 3.3 volt output, and you should see the display stabilize showing a value of about 3.3

Pimoroni Explorer Pro Hat - first impressions

Image
This morning my new Explorer Hat from Pimoroni arrived, and the tempation to play has proved to much to resist. There are two versions of the Explorer Hat, standard and Pro. I greedily ordered one of each; the standard version is great for experimenting, but the Pro version offers several extra useful features. I started with the Pro. I love it. Here's what the Explorer hats provide: Four buffered 5V tolerant inputs Four powered 5V outputs (up to 500mA!) Four capacitive touch pads Four capacitive crocodile clip pads Four coloured LEDs PRO ONLY  Four analog inputs PRO ONLY  Two H-bridge motor drivers PRO ONLY  A heap of useful (unprotected) 3v3 goodies from the GPIO A mini breadboard on top! It took me a couple of minutes to get the environment set up The Readme on the github site tells you how prepare your Pi, and then walks you though some fun experiments. One thing to watch: the setup instructions suggest that you install pip by typing sudo apt-get

Using the Raspberry Pi SPI as an AVR ISP (In-system programmer)

Image
A few days ago I blogged about using the Arduino IDE on the Raspberry Pi . It works fine, but of course the Arduino or clone needs to have a boot-loader installed in order for the IDE to work its magic. I wondered if you could also use a Pi to install the boot-loader in the first place. There are lots of ways to install a boot-loader, but most of them require that you start out with at least one working Arduino or clone. What if you don't have one? Could you use a Pi as a programmer? (c) Jason Mann I'd recently seen a rather cool project which uses a custom board with an ATTiny AVR chip and an LED display to show the Pi's IP address. Jason Mann, the author, explained how he used the Pi to program the ATTiny. It looked to me as if his technique should work just as well on an ATMega 328p. (That's the chip that forms the heart of the Arduino Uno and the Shrimp). It does. I hit some minor complications while getting things to work and thought I should shar

Arduino e-Book - reviewers wanted. Might you be one?

Image
. I’m about to publish an e-Book for Arduino Experimenters It’s called Life after Blink! I’m looking for a small team of reviewers who can check it over for bugs and suggest improvements. Might you be interested? The book describes 5 experiments: Fortune Cookie server Morse flasher Counter/LED ripple display Button and Buzzer LDR (photocell)  and bar level indicator The experiments use readily available components, but there is a kit of parts available for those who prefer. If you are selected as a reviewer you will get a free copy of the kit , and you will get a free copy of the e-book with updates throughout its lifetime. If you think you might enjoy reviewing Life after Blink, click here to register your interest . I’ll send you a link to a short online survey. There’s no obligation, I won’t spam you, and you’ll get 75% off the price of the book even if you don’t review it. Register your interest now !

neo4j and Social Media Scraping for twitter, Stack Exchange and Github

I've been experimenting for the last couple of days with tools to help me identify experts and their comments in particular technical areas. I'm hoping to combine data from twitter, stack exchange and git-hub in a way that allows me to look for people who have tweeted about a topic posted answers on StackExchange or published relevant code on GitHub I'm also interested in how they interact. There's a relevant demonstration using clojure and Ruby described on the neo4j blog , and I am using that as a basis for my Python development. If you're not familiar with neo4j, it's a graph datase. Visit their site to find out what that term means if it's new to you. What matters is that it's a great way to store and quesry social replationships and social meida activity. I'll report on progress, but one of my jobs for tomorrow will be to see how usable my code is on the Raspberry Pi 2.

What would you like to know about Pi + Arduino?

Image
C3Pi Regular readers will know how much I like the combination of the Raspberry Pi and Arduino. C3Pi is a prime example of that approach. There's lots to say about using the two platforms together. I just started a poll on G+ asking which aspects people are most curious about. Have your say here !

Scheduling on the Arduino

I'm currently working on a project that requires an Arduino to monitor the positionof two rotary encoders monitor the state of set five push buttons and send the state of everything over a Serial link whenever something changes This is not as simple as it seems. All of the components are mechanical and are subject to contact bounce , and many of the Arduino libraries are blocking. I need the code to be performant and responsive. A promising Task framework Fortunately I found a promising blog post from Alan Burlison; the task framework that he describes looks as if it will help me to solve the problem. One minor problem: the sourceforge project appears to contain no code, and the archive file referred to in the blog was written prior to the release of Arduino version 1.0. As a result the code in the archive needs minor tweaks to work. I like the look of the Task framework. It's lightweight and tries to do much less than FreeRTOS, but it seems powerful enough to d

Covent Garden Workshop

Image
The date for the next Covent Garden Jam has been confirmed - it's on  25 April 2015 from 14:00 to 17:00 (BST) and tickets will be released soon. You can see more details here , though you can't book tickets yet. There will be lots of fun things to do. I'll be running two workshops - Making the Shrimp and tworse . Making the Shrimp Build your own Arduino Clone! You'll need to pay for your kit (£10) and then follow the step-by-step instructions in the workshop guide. It's fun, it's easy (no soldering) and it's fast. The workshop takes 90 minutes or less. You'll need a laptop with a spare USB port and version 1.0.x of the Arduino IDE installed - or you can use a Raspberry Pi! You can read about past workshops here and here . Tworse Link up a Raspberry Pi to An Arduino (or Shrimp), and program them to flash out Tweets in Morse Code! It's a chance to polish your Python and sketch-writing skills! You can read a bit about the tworse

Making Shrimp (Arduino) projects permanent with Stripboard

Image
Making the Shrimp is a great way to get started with Arduino technology. The Shrimp is a low-cost Arduino clone on a breadboard. Once you've prototyped a Shrimp-based project you'll probably want to make a more permanent version, and stripboard is a great way to do that. The Shrimping It! website offers a low-cost stripboard kit and has a few pictures to get you started, but I suspect some beginners would like some more detail. I'm about to make a simple prototype for a new project I'm working on and I thought it would be worth while documenting the process. This is not a soldering guide: if you need one, the Shrimping site recommends this . Kit contents The stripboard kit contains three items: a generously sized stripboard, a strip of headers, and a DIL socket. You'll need the contents of a standard Shrimp kit as well. You'll also need some tools. I used a soldering iron a small fume filter a pair of wire cutters a polisher to clean the

Arduino IDE on the Rapsberry Pi

Image
As part of my experiments with tworse (the Twitter to Morse project) I needed to install the Arduino IDE on a Raspberry Pi and use it to upload a sketch to a Shrimp. The Shrimp is a low-cost Arduino clone which uses a CP2102 as its programmer. To my surprise and delight everything just worked out of the box. A couple of people have asked me what I did. Here's what: Installing the IDE sudo apt-get update sudo apt-get upgrade sudo apt-get install arduino Since I normally work at the command line, I needed to fire up X-windows startx The menu included a category electronics, and the Arduino IDE was located there. Uploading a sketch Shrimp and Pi I started up the IDE with the Shrimp plugged into a USB port. I configured the IDE to use the appropriate board type (normally Arduino UNO for a Shrimp) and selected /dev/ttyUSB0 as the port. I opened and uploaded the examples/blink sketch. The IDE compiled it (which took about a minute) and uploaded it successfully

Shrimp and Raspberry Pi run the Morse Twitter Display

Image
Yesterday I outlined my plans for a Morse Twitter display . Tworse (the Twitter Morse Code display) is now running on the Shrimp + Pi as well as on an Arduino + Pi. The Raspberry Pi monitors a twitter stream - in this case, it's looking for  tweets with the hashtag #morsetweeter. It converts each tweet to upper case, removes any non-ascii characters, and sends it over a serial link to the Arduino or Shrimp. The Shrimp reads lines using the Serial interface and flashes them in Morse Code. It then sends a text version of the Morse-coded line back to the Pi which displays it on the console. Running the app on the Pi The sketch for the Shrimp and the Python Script for the Pi are now on github . The sketch is  a bit long for a blog post, but here is the Python code on the Pi. import time from twython import Twython import serial def parse(filename, comment_char= '#' , separator= '=' ): options = {} with open (filename) as f: for

Tweeting Morse Code with Raspberry Pi and Arduino

Image
I'm stuck at home and have seized the opportunity to prepare for a workshop that will link the Shrimp and the Raspberry Pi. I love reusing previous projects. This one combines two bits of software that I prepared earlier :) Twitter client meets Morse Code flasher The core idea is simple. The project listens to what's happening on Twitter, and displays selected tweets by flashing the contents in Morse Code. You could do this using the Pi on its own, or the Arduino on its own, but the project is easier and more reliable if you combine the strengths of both platforms. Why the Pi? It's possible to run a Twitter client on the Arduino but you're pushing the hardware to its limits. I've found some Arduino Internet libraries to be unstable, and your application is likely to be using most or all of the Arduino's limited program and data memory. The Pi's memory is roughly a million times larger than the Arduino's RAM, and Internet applications are

More Arduino workshops coming soon

Image
Shrimp and Pi I'm excited that I've been asked to run a workshop in April at #CG3 - the next Covent Garden Jam. Contents and date to be decided, but I've had at least one request for a Shrimp and Pi session, which would be a lot of fun. There are a couple of ways that you can connect the Shrimp to a Raspberry Pi. You can use the CP2102 USB-to-serial converter normally used to program the Shrimp, or connect the Pi's serial port on the expansion header to the header on the Shrimp. Either way you can then program the Shrimp via the Pi using the Arduino IDE, and use Serial communications to send data between the Pi and the Shrimp. I have a fun application in mind, and it should be easy to set up as it combines one of my first bits of software on the Pi with a sketch from my Life after Blink workshop (see below). I'll tell you more when I've got it running :) Shrimping It solo! A couple of people have lamented that they couldn't attend last Satu

Another Splendid Shrimpy Southend Raspberry Jam

Image
Last Saturday I went to the monthly Raspberry Jam at Southend-on-Sea to run another Shrimping It! workshop. I've run several of these before but this is the first one I've run at an event that focusses on the Raspberry Pi . Arduino and Pi There's a growing interest in using Arduinos (or clones) in tandem with the Raspberry Pi.  Cefn Hoile, father of the Shrimp Arduino clone, has even co-authored a book on the subject . Alex Eames, of RasPi.TV fame, has a project called RasPiO Duino on Kickstarter . Its Arduino-compatible board sits on the Raspberry Pi header, and you can program and control the AVR chip from the Raspberry Pi. The Kickstarter is still open. If you want a RasPiO Duino, back it today ! I've been keen on the approach for a while, and I use it in C3Pi. It's not surprising that many Raspberry Jams now encourage talks and workshops on the Arduino, and that's why I was at the Southend Jam. Making the Shrimp and other attractions I

Shrimping It at Cambridge

Image
Make your own Arduino clone I've just come back from a Shrimping workshop at the /dev/winter conference in Cambridge. I've run quite a few of these workshops now, and they have all been fun. Participants build the Shrimp , a low-cost Arduino clone on a breadboard, and start learning to program it using the Arduino IDE. The Shrimp was developed by the Makers of Morecambe. The Morecambe Maker I've met is Cefn Hoile; he maintains the website and provides kits at an unbeatable price. ...and what to do next Several of the workshop participants asked for advice about what to do next. There's a huge amount of information about Arduino techniques, libraries, shields and projects, but that's a problem in itself. Where do you start? One option is to take the free Life After Blink e-course I put together for people who'd attended my Shrimping It! workshops. It's a series of online lessons, along with a google groups support group. At some stage I wil