Introduction: Arduino IR Musical Stairs
This is a small scaled musical stairs! It was a project that had a deadline; had only two days to build it. So, it is a very small scaled project, but still serves its purpose! IR Sensor (receiver) that I used is TSOP38238 from Adafruit, and the IR LEDs are also from Adafruit. The little black boxes have the IR LEDs in them (made the boxes to help people avoid stepping on the LED), the sensors are all attached on different breadboards at the left end of the stairs. This has 4 active steps, one playing a single note on the piano. For this project, the notes are C,D,E,F, respectively from first step to the top step, and if you press the right arrow key on the computer (on processing), the notes all change to G,A,B,C, respectively from the top step to the lowest. Then, if you press the left arrow key again, the notes go back to C,D,E,F. So, even with these small piano stairs, you can play the whole scale from C to C (one octave)!
If you want to see more tutorials on more sensors, shields, etc., please visit:
ardututes.weebly.com
Step 1: Parts
Parts list:
1 x Arduino (Uno is what I used) [http://www.adafruit.com/products/50]
4 x Breadboards [http://www.adafruit.com/products/64]
1 x Set of Male/Male Jumper Wires [http://www.adafruit.com/products/758]
1 x Set of Alligator Clips [http://www.adafruit.com/products/321]
4 x IR Sensor TSOP38238 [http://www.adafruit.com/products/157]
4 x IR LEDs [http://www.adafruit.com/products/387]
Tape (any kind of tape is acceptable)
Step 2: Assemble
For the assembly:
I used 123D Circuit to show the assembly, so the sensor and the LED does not look like the ones we used.For the IR Sensor, place the IR Sensor with the bulky part in your direction. Then for the three legs, wire the farthest left one to any non PWM digital output pin, the middle one goes to ground, the far right one goes to power, preferably 5V. Then, for the LED, connect the longer leg to any PWM digital pins (3,5,6,9,10,11) and the shorter leg to ground.
For this project, I connected the iR Receiver (the sensor) on the breadboard, and connected them to the main arduino using the jumper wires and alligator clips. Then, I connected the LEDs using wires and alligator clips directly from the arduino to the LED. By doing so, you can move the LED away from the sensor to the range accepted.
During this project, I found out that if you are trying to upload and run this project only through the USB port of your computer, the range of the IR LEDs are very small, which is the reason why the stairs are so small for my project. However, my guess is that the range will be longer, hopefully cover the whole stair when there is an external power supply. Actually, when I connected only one sensor and one LED, I was able to get the full range of the staircase.
Sorry for the shaky photos; also these photos were taken when we were not fully organized, but I hope you can get a sense of what the assembly should look like! :)
Step 3: Code: Arduino and Processing
I have posted the code for both Arduino and Processing on my blog.
The URL is:
http://ardututes.weebly.com
After you download the code, follow these steps to make them work for your project!
1. Download the IRremote library from: https://github.com/shirriff/Arduino-IRremote and move the library to your Arduino libraries folder. It is a library made by Ken Shirriff; it is an excellent library for IR sensors.
2. Open the IRremoteInt.h file in the library.
3. If you scroll down a little, you fill find a section like this: (if you are using the Arduino Uno, and the following Arduinos)
// Arduino Duemilanove, Diecimila, LilyPad, Mini, Fio, etc
#define IR_USE_TIMER1
// #define IR_USE_TIMER2
// #define IR_USE_TIMER3
Then, uncomment the lower two #define lines, so that now you have:
#define IR_USE_TIMER1
#define IR_USE_TIMER2
#define IR_USE_TIMER3
4. Save the file, and now, you can use all the PWM pins to activate your LEDs. (Those include 3, 5, 6, 9, 10, 11 digital pins).
5. When giving a file for the processing file, you have to remember to add the data folder with your processing file. The data file consists of the soundbank-deluxe.gm file. The file: soundbank-deluxe.gm can be found: http://www.oracle.com/technetwork/java/soundbanks-135798.html
Step 4: Play!
Finalize your project, by organizing some things, like placing black boxes on the LEDs that you have taped on the staircase, just in case the people would not step on them while going up the stairs. I personally placed a sheet of paper on each box indicating the notes what each staircase will make! As I said in the introduction, if you press the right, left buttons, it should changes the notes from C,D,E,F to G,A,B,C.
I hope you find this instructable useful and fun! If you have any questions, please feel free to leave a comment.
Thank you :)
-HB

Third Prize in the
Supercharged Contest

Participated in the
123D Circuits Contest
15 Comments
6 years ago
I couldn't manage this. Seems much has changed in the past few years since this was published.
7 years ago
Hi I keep having this error from the processing program : javax.sound.midi.InvalidMidiDataException: cannot get soundbank from stream
Are you able to help me out ?
Reply 7 years ago
Hi Stunkite! Could you found any solve?
8 years ago on Introduction
Hello. I really enjoyed your project. I wanted to play him here in Brazil. I'm having doubts in steps 2 and 3. You could explain the more they?
8 years ago
thats cool. .. go on with this. .. i just wonder if that work with 16 or more stairs?
9 years ago on Introduction
For some reason I read that as 'Muscle Stairs' I was expecting some kind of escelator. Musical stairs are way cooler.
Reply 9 years ago on Introduction
hahahahaha Thank you! :)
9 years ago on Introduction
i like that, i hate stairs, now never more, enjoy music!
Reply 9 years ago on Introduction
Thank you! I definitely had much more fun going up the stairs with music :)
9 years ago on Introduction
It seems to me that you are basically using the IR LEDs and receivers as like lasers and photocells. Would it not be more cost effective to replace the IR receivers with photocells, and the IR LEDs with normal LEDs or lasers?
Reply 9 years ago on Introduction
Yes! That would have been much more cost effective, but I didn't go purchase these for this project. I happened to have these, so I used them! If I had a choice and purchased the best components, I would have considered photocells with normal LED or lasers. Thank you for your suggestion!:)
9 years ago on Introduction
thank you! :) (i have no idea why the prior comment was deleted..)
9 years ago
your project is cool , keep up the good job ;)
9 years ago on Introduction
I love it. I'll see if I can send you the videos I have of me playing with it since I think I only sent you photos.
Reply 9 years ago on Introduction
sounds good! :)