Piano Stairs Project Update
Moderators: adafruit_support_bill, adafruit

Piano Stairs Project Update

by bme14 on Mon Nov 11, 2013 1:20 pm

Hi all,

So, I pulled off my Piano Stairs hack this past weekend using parts from Adafruit! Specifically, a Raspberry Pi, an Arduino Uno, and a bunch of photoresistors. I used flashlights on each stair, across from the photoresistors, in order to up the contrast and make it way more robust. (Without flashlights, you get effects like people casting shadows on stairs they're not actually standing on, etc.)

Youtube:
www.youtube.com/watch?v=2mHj853z_PU

Blog post + more videos:
bonnie-eisenman.tumblr.com/post/66630942173/hackprinceton-fall-2013-piano-stairs

Now, that was for a hackathon, but I think I have an opportunity to install this semi-permanently (well, maybe a few days or a few weeks) elsewhere on campus. However, the problem with flashlights is that the batteries only last a few hours, and I'd like to just be able to plug something in.

So, my question: does anyone have suggestions for a light-strip to put on the opposite stairs? Problem is, it's pretty wasteful (and less effective) to have lights that aren't directly across from the photoresistors. So I don't really want to go with the LED reels, even though they're very cool. I was thinking perhaps wiring up a bunch of super-bright bare LEDs, or even ordinary light bulbs, but I don't know how to wire up actual light bulbs.

I'm sure I'll try something regardless, but I wondered if anyone had any feedback. :)
bme14
 
Posts: 18
Joined: Thu Oct 31, 2013 7:34 pm

Re: Piano Stairs Project Update

by franklin97355 on Mon Nov 11, 2013 1:27 pm

Beauty!
As to your question on lights, you may have to work a bit on getting a focused LED beam to get enough lumens to overcome the ambient lighting but it should work. LEDs and light bulbs just need to be wired in parallel across power to work and you can add wire between each to save on buying more than you need. You could use inexpensive (che!ap) speaker wire to do this.
User avatar
franklin97355
 
Posts: 5634
Joined: Mon Apr 21, 2008 2:33 pm

Re: Piano Stairs Project Update

by adafruit_support_bill on Mon Nov 11, 2013 2:04 pm

Well done! Congratulations :D

Clear leds will have more of a directed beam than the diffuse LEDs or the planar leds used in the neopixels: http://www.adafruit.com/products/754
You can find information about how to power them here: http://learn.adafruit.com/all-about-leds
User avatar
adafruit_support_bill
 
Posts: 31071
Joined: Sat Feb 07, 2009 10:11 am

Re: Piano Stairs Project Update

by bme14 on Mon Nov 11, 2013 2:37 pm

Thanks! :)

@bill: That's exactly the product listing I was considering. I am lucky enough to have access to the school's supply of wire, solder, etc, so I think it should be pretty simple. :) Installation will hopefully happen ~2 weeks from now, if I get approval.
bme14
 
Posts: 18
Joined: Thu Oct 31, 2013 7:34 pm

Re: Piano Stairs Project Update

by jwadhams on Tue Nov 12, 2013 12:13 pm

Have you considered measuring something instead of visible light? E.g., could you use Passive Infrared (PIR) sensors with some kind of cowl to force them to look straight ahead? Or even wire up a piezo "knock sensor" on each step?

(I haven't priced these, they might dramatically change the cost of your installation.)

Very exciting project, considering building one for my wife (she's a music therapist, and her client space is downstairs).
jwadhams
 
Posts: 1
Joined: Tue Nov 12, 2013 12:07 pm

Re: Piano Stairs Project Update

by bme14 on Tue Nov 12, 2013 4:28 pm

jwadhams wrote:Have you considered measuring something instead of visible light? E.g., could you use Passive Infrared (PIR) sensors with some kind of cowl to force them to look straight ahead? Or even wire up a piezo "knock sensor" on each step?

(I haven't priced these, they might dramatically change the cost of your installation.)

Very exciting project, considering building one for my wife (she's a music therapist, and her client space is downstairs).


Thanks! :) That sounds like a great place to install one.

Yes, the problem is cost. The photoresistors are $1 each. Bare IR LEDs + receivers might be feasible, but the combo units are pricey if you want one per step. I didn't want to use Piezos as I was afraid of interference -- for example, while we were demoing people were moving tables upstairs, and I could feel it!

I could get rid of the Arduino and buy an ADC (http://www.adafruit.com/products/856) to bring down the cost -- I just happened to have an Arduino on hand and no ADC. If I did that, and used normal LEDs instead of flashlights, the overall price other than the Raspberry Pi and a standard speaker set would be $3 per step, I think. Pretty affordable!
bme14
 
Posts: 18
Joined: Thu Oct 31, 2013 7:34 pm

Re: Piano Stairs Project Update

by adafruit_support_mike on Tue Nov 12, 2013 5:59 pm

You don't need a full-scale IR detector for basic object sensing. Simple phototransistors will work, and you can get a hundred for $10: http://www.mouser.com/ProductDetail/Lit ... bC3jyaw%3d

Those have an envelope that's transparent to IR but opaque to visible light.

To use them in tread sensors, put them at one end of a 4-6" piece of tubing.. the heavy black plastic line used for buried sprinklers would be good, but anything that blocks light except for a small opening at the other end of the tube will work. Do the same for the IR LEDs and you'll have a reasonably well collimated emitter/sensor pair.

To save power, pulse the IR LEDs about once every tenth of a second. A 1-millisecond pulse will do, and will only consume 1% as much power as keeping the LEDs on all the time. If you want to use even less power, you can drop the blink rate to 2-4 per second and only blink the first couple of sensors at the top or bottom of the stairs while the system waits for the next player. Once you've detected a person near the stairs, you can turn everything on and take the pulse rate up to 20-50 flashes per second.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10263
Joined: Thu Feb 11, 2010 2:51 pm

Re: Piano Stairs Project Update

by bme14 on Tue Dec 03, 2013 5:16 pm

Mike, thanks for the suggestion. I might move to using IR because the ambient light during the daytime in my new stairwell is interfering with the visible-light setup I currently have. I'm still a bit of a hardware n00b, so do you have any good tutorials on how to use the IR transistors? (I'm assuming they're different than photo-resistors.) Thanks!
bme14
 
Posts: 18
Joined: Thu Oct 31, 2013 7:34 pm

Re: Piano Stairs Project Update

by adafruit_support_mike on Wed Dec 04, 2013 12:04 am

We don't have a tutorial, but I'll be happy to help you out.

A transistor is like an electronically-controlled resistor, but we talk about it in terms of its 'conductance' rather than its resistance.. how much current can flow through it, rather than the amount of current that corresponds to a specific voltage.

A transistor has three terminals called the 'collector', 'emitter', and 'base'. There are two current paths through it: one between the base and emitter (the 'BE' path), and one between the collector and emitter (the 'CE' path). Since the emitter connects to both other terminals, we usually just talk about 'base current' (I.b) and 'collector current' (I.c).

A transistor's collector current is proportional to the base current.. for today's transistors, I.c is usually about 100 times as large as I.b. If you send 1mA through the base, up to 100mA can flow through the collector.

Transistors are made from silicon though, and silicon is a photovoltaic material.. if you shine light on it, you get current. Early on, researchers discovered that shining light on a transistor would generate a small amount of base current, thus allowing a much larger collector current to flow. For normal transistors that's a problem, so the silicon has to be encapsulated in an opaque container. Sometimes that's useful though, so we have chips specifically designed to do that well, called phototransistors.


In practical terms, almost no current flows through a phototransistor in the dark.. the effective resistance is around 10 megohms. When light shines on it, up to about 20mA can flow through. Assuming a 5v supply, the effective resistance would be about 250 ohms. It would be about 500 ohms for a 10v supply, and only 50 ohms for a 1v supply, so a transistor's conductance doesn't obey the same V=IR rules as a regular resistor.

To use a phototransistor, put it in a voltage divider like this:

photo.jpg
photo.jpg (14.36 KiB) Viewed 536 times

When no light falls on the phototransistor, the output will be HIGH. When light shines on it, the output will go LOW. To use it with a microcontroller, treat it like a pushbutton switch with a pull-up resistor.

You can adjust the sensitivity of the sensor by changing the value of the upper resistor. The 100k value shown above falls in the midrange. If you use a higher value, it will take less light to swing the output from HIGH to LOW. If you use a lower value, it will take more light.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10263
Joined: Thu Feb 11, 2010 2:51 pm

Re: Piano Stairs Project Update

by bme14 on Sun Dec 08, 2013 5:48 pm

That's awesome, and very helpful. Thanks!

I'll post an update if/when I get the new setup working...waiting on parts, now. :)
bme14
 
Posts: 18
Joined: Thu Oct 31, 2013 7:34 pm