3/09/2013

LighTouch

LighTouch was an idea I had as I was just diving into Arduino.  Like anyone getting started, I bought an Uno and three random shields just to play with (music shield, bluetooth, and ultrasonic range finder).  To that end, I got each of them up and running in record time and got bored.  So what was the next logical step?  Right... figure out how many of these shields can I use at the same time.  In this case, a music shield and ultrasonic range finder made the cut.

The idea is pretty simple; an mp3 player that you never have to touch.  Simply hold your hand over the device to adjust volume, pause, and move to the next track.  All the commands basically key on the distance of your hand from the sensor.

A little modification of the demo code for both, some enclosure work, and before i knew it I had a pretty functional little prototype.

Update:
Here's the current control scheme:

0-7cm = Pause (LED OFF)
7-30cm = Lowest Volume->Highest Volume (LED DIM)
30-50cm = Highest Volume (LED ON)
50-55cm = Next Track (LED OFF then ON)

So basically the setup works based on your hand's distance from the sensor with feedback given by the LED so you know where you are in the control scheme.  There's 'dead zones' setup to avoid accidentally moving from volume mode to next track.  For instance, once you're at the max volume (30cm) , there's a +20cm dead zone until you hit the next track and the LED turns bright so that you know you're at the max volume.

Whenever you move your hand away, and the distance becomes 'infinite' (ie, the ceiling) it locks in the last distance it recorded for your hand.  So basically you move your hand to the volume you want, then slide your hand off to the side to lock it in.

To pause, move your hand close to the sensor until the LED turns off, then slide your hand away.
To change volume you raise your hand up or down while the LED is dimly lit, until it's brightest (then you're at max volume)
Once you're at max volume, you can pop your hand up, watch for the LED to turn off, then back down to move to the next track (then you're back in volume mode, or just move your hand off to the side).



I plan on expanding on this idea.  Ultrasonic proves to be a very simplistic, but very precise user interface for just about everything I've tried it on.

What's next?  An alarm clock that I can just wave my hand over to shut it off.

assembly pictures after the break:



I'll do a detailed tutorial when I get to the next phase (better package, more functionality, lcd display(?), etc)

Assembled:




Parts Used
The music shield only leaves two analog pins available (A4 & A5).
I used one for the LED and one for the ultrasonic
Also had to hijack some pins on the ICSP for USB header
(for 5v and ground)
A resistor and an LED indicate when the music is paused (OFF), at
maximum volume (ON), or in vol+/- (DIM)

Interior










5 comments:

  1. Great way of interacting with a machine! Are you going to publish the code? I would like to build such a cool star wars ("use the force,luke" ) - device too :)

    ReplyDelete
    Replies
    1. Absolutely. Lately I've had very limited time to properly document, but since this post is gaining some popularity, I'll make the time and do it right!

      Delete
  2. This is incredible, please post a more detailed look inside! I'd love to make one but I'm a novice with arduinos.

    ReplyDelete
  3. Hello! Really interesting thing) Can you send the code example??

    ReplyDelete
  4. Anyone still following along, I just wanted to let know that I will be releasing an updated post in the next week or so with some more detail, modifications, and (if I clean it up enough) the source code.

    ReplyDelete