Sunday, November 25, 2012

Great Day at Milton Keynes Raspberry Jam (25th Nov)

Today was the 4th Raspberry Jam at Milton Keynes today and it was another great event.  I brought along my simple Raspberry Pi controlling an Arduino over the network (more later)

Best of all I got to see some brilliant projects.

There was Daniel Bull's BerryIO a fantastic web interface for controlling the GPIO pins on the Raspberry Pi.  Not only is BerryIO functional but the interface is gorgeous. Ideal for an event at the National Museum of Computing with it's switches and lights..  Daniel had a problem with the wifi at the Museum,but luckily after the last visit I had brought along an old wifi router to act as a wifi/Ethernet switch. So, Daniel got to use the network to get the BerryIO working.  It was really interesting to see how it worked and has inspired me to see if I can improve the quality of my own web interface.

There is a great video on raspi.tv showing off BerryIO - go check it out


Next to BerryIO was a project by raspi.tv (I think it was Alex) where he was using a Raspberry Pi to control 2 relays to turn on/off a light and fan.  Light if it got dark and fan if it got hot being expertly  demonstrated by (I assume) his son.
Again, there is a great write up on raspi.tv with a video


There was also a Raspberry running RISC OS. I was amazed how fast it is and how responsive it is.  Hopefully, somebody way more capable than me will have some fun with it. I'm really looking forward to seeing what's possible.

The final project I took peek at appeared to be a project after my own heart as it was Arduino MIDI interface.  I didn't get a chance to talk the person who brought it along but it looked really cool and maybe if I see it again I'll find out what the knobs and buttons on the little red board do.




In amongst these great projects I set up my Raspberry Pi and Arduino with the Linksys router in a corner.  This time I brought an extension lead which was lucky as I only had 1 socket for 3 plug.
This is a revised version of the Arduino + ENC28J60 project I posted about before but using an ebay purhcaed W5100 based shield so I could use the official library from the Arduino people.  Others may disagree but to me the W5100 board may cost a little more but the time saved unless you know the ENC28J60 board inside out is well worth it. Especially as the generic versions of the W5100 board are not available.
I got mine on ebay.co.uk from EachDesk, so you can search their store for the board.  It was delivered in a few weeks from Hong Kong.  The current list for the W5100 shield costs less than £7.00.
The ENC28J60 boards are on ebay.co.uk for as little as £3.19 so yes, less than half price, but really it's only £4 more expensive for a whole lot of reduced grief.

My project allows you to control as many Arduino as you want over Ethernet/Internet from a web server running on a Raspberry Pi.
On the Raspberry Pi is a LAMP server with an entry in the mySQL database for each Arduino and then for each pin on the Arduinos that you wish to control or read.
The Raspberry Pi presents a simple web interface with switches to switch on and off the pins on the Arduino.  When you click [ON] a GET statement is called from the Raspberry Pi to the Arduino using fopen in PHP.  The Arduino has a web server running on and when it receives the request it interprets the GET command to find out which pin is being actioned and what to do with it.
Then the Pin is either set HIGH or LOW depending on the request.

For today I also set it up to read 2 of the Analogue pins. 1 with a rotary pot on it
and the other with an Light Dependent Resistor (LDR).

Giving the ability to turn on/off 3 LEDs and read the values for the pot and the LDR through the web interface.

After the command is actioned the Arduino then sends back a web page with the status of the Digital Pins and the Analogue Pins.

The Raspberry Pi then interprets this page and compares it to the pins being controlled based on the database entries.  It updates the interface so that only the Pins listed in the database  that are High (On) have the option to be set Low (Off). With the unused pins not presented.  What this means is that the Sketch on the Arduino is generic and the specific pins  controlled is defined by the database and not the Sketch.

My next steps are to add a little bit of security as at present if you know the IP address of the Arduino you can control the pins directly when my goal is that you have to use the web interface.

I also need to update the database scheme and the PHP page to better manage the analogue inputs and also use the PWM lines.  This will mean the Arduino code would have to be modified so the digital pins being used for PWM can be defined but I think this is a small price to pay for the ability to take full advantage of the Arduino's capability.

After the Jam some of us got a private guide to the WITCH - the oldest working computer.  BBC piece and videowikipedia article. It's a 10 bit computer using dekatron based memory, rather than relays or core storage.  This was the first time I'd heard of dekatrons, so that alone was interesting.




This was another wonderful Jam and I'm looking forward to attending more. if you're interested in the Raspberry Pi or just seeing fun projects then definitely find a Jam to go along to or if there isn't one in your area see if you can arrange one.