Phase 2 - Prototype (hardware)

A project log for LighTouch - Control music with the wave of a hand

A touch-less, streaming radio/alarm clock

Thomas Clauser 08/09/2014 at 01:410 Comments

After I got my concept code down on the arduino platform, I let the project sit for a while.  As it was the only music you could play was if it was already stored on the sdcard in the mp3 shield.  What is this?  The Dark Ages?  All music should be streamed over a WiFi connection in infinite quantity and diversity!  However making all that happen in an arduino platform is a little bit more work that I was willing to do.

Enter the raspberry pi.  This $35 board solves all of those problems in one nice, neat little package.  One raspbian install, a couple python package installs, and an ultrasonic on the GPIO later and everything appeared to be working.  

I had read other posts about using an ultrasonic sensor with a raspberry pi and how the accuracy is somewhat lacking because of the fact that the GPIO has to go through the processor of the raspberry pi which can be affected by load.  So you don't get a standard, consistent measurement.  That was absolutely confirmed by my tests.

So my idea was to offload those cycles into a 'middle-ware' arduino.  That way the only communication to the raspberry pi would only for actionable events and not 50 pings a second going through the GPIO.

I chose a pi alamode to keep the footprint small.  Initially I was just going to use it as a stacked shield, but poor planning on the case I purchased didn't allow for that space wise, so I compromised on just extending the leads.  

At that point I wanted to add some kind of display to this (other than the LED).  I chose to keep the load on the arduino as much as possible and bought a blue 16x2 LCD shield to sit on top of the pi alamode.  Now the arduino is both reading and writing via the raspberry pi's GPIO.

So just to recap, the ultrasonic sensor, the ultrabright blue LED, and the 16x2 LCD shield are all connected to the pi alamode.  The pi alamode interprets all the ultrasonic signals and writes that information (when appropriate) over the raspberry pi's GPIO.  The raspberry pi then sends data (like Artist/Song info) over GPIO to the pi alamode to display information on the LCD.