Sunday, October 20, 2013

How to make the LED guided piano teaching device

Hi there, here goes the manual. (Here is more important manual for your life)


First, I made an android app for the LED guided piano. I am sharing the code at a Github. This android app  parses *any* piano MIDI songs and convert the data into data format for driving the IOIO OTG board. https://github.com/kisurb/led_guided_piano


Materials needed:

IOIO OTG
2 Meters of LED Strip (WS 2801 based) 
Your android phone.
Micro USB Type A to Type B cable (For connecting your phone to IOIO OTG)
Soldering Supplies.
Breakable pin header.  (This goes to IOIO OTG and LED Strip. This is actually important)
Lots of short jumper wires (female to female)
5 volt 1A power supply and corresponding power jack
(So power supply powers the IOIO OTG, and IOIO OTG directly powers LED strip)
3M Double Sided Tape  (For attaching your LED strip to Piano)

Three critical notes.
The 2 Meters led strip is cut into three parts. One part for powering 20 black keys, one part for powering 21 white keys, and one part for powering 5 black keys and 15 white keys. This is because IOIO OTG can send only 64 bytes of data which correspond to controlling 21 led lights. So this is the setup. Three strips are controlled simultaneously. 

Second.
The way you attach the LED strip to the white key. Do not set tapes on every single white keys
Third.
For black keys you have to cut the LED strips into pieces of three LED lights and two LED lights to accomodate for distances between the black keys. Also use pin header to connect the LED strip to jumper wires. You do not want to solder the jumper wire directly onto the LED strip because the LED strip can tear easily.


How to connect from IOIO OTG to LED strip:
Solder the pin headers onto the pins of IOIO OTG and LED stip. Connect the headers using female-to-female jumper wires. Here is the setup.

This is the Java code within the android app that tells the IOIO OTG to use pin 1,2 for strip 1,  and pin 4,6 for strip 2, and pin 10,11 for strip 3.

    white= ioio_.openSpiMaster (27,4,6,15 ,Rate.RATE_50K);
    black= ioio_.openSpiMaster (28,1,2,16 ,Rate.RATE_50K);
    three= ioio_.openSpiMaster (29,10,11,17 ,Rate.RATE_50K);

This is the explanation for each input for the above java code.
 spi = ioio.openSpiMaster(misoPin, mosiPin, clkPin, ssPins, Clock rate;

ioio.openSpiMaster does not serve 'null' for the case there is no misoPin or ssPin, so we have to specify misopin or sspin even though they are not used.
pin 27,28,29,15,16,17 are not used.


4 comments:

  1. HI,could you tell me how to connect led strip to OTG?

    ReplyDelete
    Replies
    1. I added more detail about your question on the post.

      Delete
  2. After this detail report i will definitely think about starting business in led lighting strips

    ReplyDelete