RainbowBit Lighting Up our Staircase

Is kind of boring walking up and down the staircase L Since we moved our HQ to Penang, RnD is being placed on 1st floor, so all engineers have to exercise more 🙂 But wait, we can make the walking up and down more interesting with some lighting, and let’s make it automatic and intelligent enough to detect human presence, further activate the light! Wait, wait! We have RainbowBit which can simplify the wiring and program control because of its single wire and individual controllable features. OK! Let’s do it!

Now, brainstorming is necessary. We are going to use RainbowBit, how about the controller? How many pcs of RainbowBit? What type of sensor to detect human? How about mounting it to the staircase? Yup, you need to decide how to answer all these questions. I am sure you have your own design, so this is my idea of implementing it, take it as reference and innovate!

BTW, if you have any inquiry, please post it in our technical forum; we seldom check the comments in tutorial site.

I will use following item for the project:

  • BBFuino – As the controller, because the sample source code and library for RainbowBit is ready, and I wanted to customize the board by adding voltage regulator for extra current on 5V. BBFuino provides that, it is compatible with Arduino and offers flexibility to mount it on donut board for customization.

  • RainbowBit – Ease of interface and control because of single wire, individual controllable features, of course, Arduino provides the ready library and example code. If you are new, check the tutorial here. Decide the number of RainbowBit needed base on the staircase steps, we are using 28 pcs.

  • Magnet Ring – To offer flexibility of adjusting the RainbowBit on staircase holder and ease of mounting the RainbowBit. We will mount the RainbowBit at our staircase holder as it is made of metal, making it perfect to use magnet, of course adjusting it to any place/distance you want will be super easy too. You can always use your creativity to mount the RainbowBit, cable tie, or glue gun, or anything you can think of. Just make sure the pins of RainbowBit are not shorted to any metal 🙂

  • Servo Extension Cable – Why using this? Well, to offers easy yet flexible connection between RainbowBits, and also the controller board. A little hacking is needed to take off the male connector. Do not forget, we are dealing with 28 pcs of RainbowBit, 3 wires is simple task, but 28 x 3 wires are 84 wires, think twice before you take action.
  • USB to UART Converter – UC00A, for loading program to BBFuino.
  • Header sockets and pins – I am using both these connectors for RainbowBit, also as indicator of RainbowBit data direction.

  • Adjustable Infrared Sensor Switch – I am using two of this sensor, one mounted at the entrance of ground floor staircase to detect human going up staircase, another of course at first floor to detect human going down.
  • 12V 2A Adapter – To power up the whole project. But I notice I should be using the new Dual USB adapter 2.1A as all the components require 5V to power, you can also use any power supply you like, but do make sure it can provides at least 2A of current.
  • 5V voltage regulator – To regulate 12V from adapter to 5V for both infrared sensor and RainbowBit. I am using 2 pcs with additional heat sink for each regulator. It will get quite warm if you activate all RainbowBit, especially white color. Oh… you can have alternative for better efficiency by using the switching power module, we do carry adjustable 3A switching module. Easier 🙂
  • Long wires – To extend the power and signal of ground floor sensor to 1st floor as the controller is located on 1st floor to easy program loading :). I am using 3 ways rainbow cable.
  • Donut Board – To solder additional components and BBFuino.

Well, I guess that is all the hardware needed, there are still some small components, but I guess you will need to source it on the way you do it.

1st, prepare the RainbowBit. Solder the input of each RainbowBit with 3-way right angle header pin; you will need to cut the header pin with cutter as it comes in 40 ways. Same goes to the output of each RainbowBit with 3-way female header, and bend it to right angle. Please refer to the picture.

OK, I have 28 pcs of RainbowBit, it will take some time do to it. I will do it properly to avoid any unnecessary bugs later, you will know what I mean if you did electronics project before.

As I listed in the hardware needed, I am using magnet ring to mount the RainbowBit to staircase holder. Magnet sticks to metal, but how can it stick to RainbowBit which is not metal? I am using heat shrinking tube, you may use normal plastic adhesive tape. Place the magnet at bottom of female header socket, not the header pin, cover it with sufficient length of heat shrink tube, heat up the tube with lighter or hot air gun.


You should get something like this after the tube is fully shrunk. Nice!

OK! You don’t have heat shrink tube, is fine. As I said you can use adhesive tape. But it is not nice 🙂

All 28 pcs of RainbowBit should be shrunk tube with magnet.

Make sure the data direction is correct, Input should be soldered with header pins and the output should be soldered with female header. Test all the RainbowBits by connect them in chain as shown, all 28 pcs. Again, make sure the direction is correct. Look at the arrow on RainbowBit.

Connect the input of 1st RainbowBit to BBFuino/Arduino UNO and test it. Please refer to the Getting Started Guide. We want to make sure all RainbowBit is working before we proceed. Remember to change the “Bit_Number” to number of RainbowBit you connect, in the Arduino sketch. We are using 28 pcs.

OK, assuming each and every RainbowBit working fine, let’s continue with the cable to connect RainbowBit. Since I am planning to place one RainbowBit for each step of staircase, the RainbowBit must be spaced. I am going to use the Servo Extension cable. It comes with a 3-way female socket and male header, perfect for RainbowBit J But the male header comes with a cover, we need to remove it in order to connect to female socket of RainbowBit.

Original Servo extension cable (30cm)


Get a flat screw driver; insert the tip into the socket as shown in the picture. You need to do it for both sides (top and bottom) of the socket. Insert until it going to break off.

Finally, you should be able to remove the socket from the cable, as shown in the picture. We need to see the male header pins.

Yes, do this for 27 pcs of servo extension cable J. After you are done with the cables, chain up the RainbowBits with the 3-way cables. Hopefully you can get it clear in the picture. The female terminal of cable should be connected to the Input of RainbowBit (where we solder right angle header pins), while the male terminal of cable should be connected to output of RainbowBit (where we solder the female socket)

Again, test all the RainbowBit and connections, same as we did earlier, connect to the BBFuino and power it up.

Good! Is time to mount the RainbowBit to the staircase holder. It is always your choice on how to mount it, distance between each RainbowBit, LED emitting direction, etc. That is the reason I did not use the RainbowStrip. You can always use RainbowStrip if you want the work to be fast J. The choice is always yours.

Here, I have “stick” 28 pcs of RainbowBit at the lower rail of staircase holder, because of the magnet, adjusting the distance and direction is super flexible. You might need to tie up the excess length of servo extension cable, again is on your creativity to do it, I am using cable tie to tie it. I have also measured the total length of whole RainbowBit chain, it is 5.5 meters. Through our test, the voltage did not drop much even in this length of wire. What worried me is the 5V supply; longer length of wires will cause voltage to drop further introducing unstable condition. If you have this condition, you will have to feed another 5V supply from the middle or bottom of RainbowBit chain.

Do check the polarity of connection between servo extension cable and RainbowBit, black color always connected to “-“, negative or GND mark on RainbowBit. I have made a few mistakes when I mount the RainbowBit onto the staircase holder. If everything is working fine, test the chain again with BBFuino or your controller. Please make sure each and every RainbowBit is working.

Yes! We are getting near. Now is the obstacle sensor. I am using low cost adjustable Infrared sensor, it is a digital sensor. BBFuino will require two digital input pins for two sensors. 1st and ground floor will require one sensor, to detect human walking down or walking up staircase and the controller will decide correct lighting pattern.

Connect the output pin of ground floor sensor to pin D10 of BBfuino, and the output pin of 1st floor sensor to pin D3 of BBfuino. You might need to extend the wires for ground floor sensor. Use any 3 ways cable that you like. I add a buzzer for sound indication.

Actual hardware as in the picture

Now, the hardware is done, we will proceed to program development. Opss…. I didn’t show you how to mount the sensor J OK, I am using this bracket to mount the sensor. This is 1st floor sensor, ground floor sensor is mounted in the same method.

Final project look like this.


Good! This stage, we should move to program development. The sample source code can be downloaded here. Is quite long, and you need to make sure your hardware setup is the same as ours, else the staircase light will not work! Do check out how to load program to BBFuino, you will need UC00A to load program, do check the User’s Manual of BBFuino to do that. The example code can be downloaded here: Cytron RnD Staircase RainbowBit. Not to forget, you must have the library under Arduino -> libraries, download the library folder here.

I am doing two simple patterns with 6 random colours only, there are plenty of lighting pattern that you could do, as I say, this is for you to kick start. Feel free to innovate and modify the code, do send share with what you did, photos, videos would be awesome! Send it to support@cytron.com.my.

If you have any technical inquiry, please do posts in our technical forum as we seldom check the comments section in tutorial site.

Arduino Example Sketch:


, , ,

Related Post


Using AVR-USBasp to Program Arduino

CT-UNO - BBFuino_bb

Using ISP to Burn Bootloader into Arduino

BBFuino BlueBee

Uploading Arduino Sketch to BBFuino via BlueBee


RainbowBit – Smart RGB LED

One thought on “RainbowBit Lighting Up our Staircase

  1. projek ini kalau pkai arduino uno bole tak? klo bole pakai saya nk buat projek ni la .. pstu sy nk beli bahan2 semua dlm projek ni mcm mana .. nk buat mcm mana

Leave a Reply

Your email address will not be published. Required fields are marked *