Arduino IR Musical Stairs




About: A high school girl. "Don't look, observe. Don't hear, listen"

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:

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts

Parts list:
1 x Arduino (Uno is what I used) []
4 x Breadboards []
1 x Set of Male/Male Jumper Wires []
1 x Set of Alligator Clips []
4 x IR Sensor TSOP38238 []
4 x IR LEDs []
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:

After you download the code, follow these steps to make them work for your project!
1. Download the IRremote library from: 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 file. The file: can be found:

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 :)


Supercharged Contest

Third Prize in the
Supercharged Contest

123D Circuits Contest

Participated in the
123D Circuits Contest

Be the First to Share


    • Instrument Contest

      Instrument Contest
    • Make it Glow Contest

      Make it Glow Contest
    • STEM Contest

      STEM Contest

    15 Discussions


    2 years ago

    I couldn't manage this. Seems much has changed in the past few years since this was published.


    3 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 ?

    1 reply

    4 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?


    4 years ago

    thats cool. .. go on with this. .. i just wonder if that work with 16 or more stairs?


    5 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.

    1 reply

    5 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?

    1 reply

    Reply 5 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!:)


    5 years ago on Introduction

    thank you! :) (i have no idea why the prior comment was deleted..)


    5 years ago

    your project is cool , keep up the good job ;)