Introduction: Cool Automatic Stair Light (Arduino)

Finding your light switches in a very dark place can be arduous. You might even fall from the stairs! This coolest RGB stair light that illuminates your stairs at night will solve your problem in the most fashion way. With the automatic switching feature in this stair light, you can simply activate the light just by stepping on the stairs! Moreover, it is more fashionable than normal lights. Also, after you leave, the light will automatically close it self to save power! Come and build is wonderful RGB stair light and illuminates the stairs you want. In addition, the RGB stirp is water proof from rain. Therefore, with the protection of the arduino itself, it can even work at outdoors!

Supplies

Here are the material you need to create this fabulous stair light by your self:

IR Sensor FC-51 x 2

Arduino Main Board

Hot Glue

3m Double Sided Tape

WS2801 RGB led strip ( 20 LED, each one have an individual WS2801 chip)

USB battery pack

Dupont Line

Pin header - 4 pins

Solder wire

Welding gun

Foamcore

Tape

Step 1: Step 1: Setting Up the LED Strip

The WS2801 chips are communicating with SPI, so download your strip's library, and make sure your computer is instilled with SPI.h library.

Download Link for WS2801:Link

Yellow --> GND -- > GND on the Arduino board

Green --> Data pin ( MOSI ) --> Arduino digital pin 8

Blue --> Clock pin ( SCLK ) --> Arduino digital pin 9

Test your WS2801 strip with the example code included in the WS2801 Library

Step 2: Setting Up the IR Sensor Stations - 1

- Cut a 3 cm x 6 cm foamcore board

- Cut a 1 cm x 1 cm square hole at the middle of the board.( 8mm below the top, 7mm away from either side )

- Stick a 3m double sided tap on 5mm below the hole. The tape should be 1 cm x 3 cm

-Stick a IR sensor. The IR light and receiver should go through the hole.

( Make sure your IR sensor is stick closely with the foamcore board )

-Cut a 5 cm x 6cm foamcore board

-Make two cut on the left and right side with 1 cm distance from the boarder that extend from the top to the bottom. The cut should not go all the way through. Only cut the top paper layer.

-Fold the foamcore board inwards by the cut lines formed from the last step. Not more than 90 degrees inwards.

-Tape the two foamcore board together. The folded sides and the IR sensor should be between the two foamcore board. ( As the picture shows )

Step 3: Setting Up the IR Sensor Stations - 2

-Cut a 1 cm by 4 cm foamcore board, and a 3 cm by 4 cm foamcore board

-Stick the 1 cm x 4 cm board on the second board with hot glue. It should be 90 degree angled as the picture shows.

- Stick the product from "Setting Up the IR Sensor Stations - 1" on to the 90 degree angled 1 cm x 4 cm board. The top of the 90 degree angled board should be stick on front side with cutted hole, across the pins from the IR sensor.

- Plug three Dupont Line ( Male top, female bottom ), with another three Dupont Line ( Male top, female bottom ) as the picture shows.

-Plug the three Dupont Line on to the IR sensor Pins. The three pins are VCC, GND and OUTPUT.
-The GND line should be connected to the GND on the arduino main board -The OUTPUT should be connect on to the digital pin 6.

( Both VCC line from the two station will be plug in the later steps , leave them first )

Step 4: Setting Up the IR Sensor Stations - 3

-Cut a 6 cm x 5 cm foamcore board.

-Stick the bottom of the sensor station, which is the 3.5 cm by 4 cm foamcore board, on to the middle of the board by the . It should be 90 degree angled. It is shown in the picture

-Repeat "Setting Up the IR Sensor Stations - 1", "Setting Up the IR Sensor Stations - 2" and "Setting Up the IR Sensor Stations - 3" for a second IR sensor station. This time, the OUTPUT should be connected to the arduino main board digital Pin of 7.

Step 5: 5 Volt Share System

Because there isn't enough 5 volt port on arudino that can support all the devices. A system that share one 5 volt to multiple devices is required. Take a Pin header that have four pins. It should be welded together as the diagram shows. All the four pins are connected on one side. Next, connect the another side following the diagram. Arduino 5 volt, two VCC from the IR sensor stations, and a VCC from the RGB strip should all be connect on the 4 pin header. The three VCC lines from IR sensor and RGB strip should be connect by welding them on the pin headers. The product is shown by the pictures.

5V from Arduino main Board----- Pin one

IR sensor VCC 1----- Pin two

IR sensor VCC 2----- Pin three

VCC from RGB strip----- Pin Four

Step 6: Case for Arduino Main Board

To make the case for Arduino Main Board. First cut the following four pieces of foamcore board.

- 10 cm x 7 cm Two pieces

- 3 cm x 7 cm Two pieces

- 3 cm x 10 cm Two pieces

After cutting the boards, cut one of the 3 cm x 7 cm board with a hole. The hole will be 3 cm x 2 cm, and it will be shifted one cm away from the middle of the board.

Now tape the boards with the following instructions: ( Looking at the picture will assist you )

First, tape the 3 cm x 7 cm boards on the 10 cm x 7 cm board at the two shortest side.

Second, tape the 3 cm x 10 cm boards on the 10 cm x 7 cm board at the two longest side.

Third, tape the edges from the rectangle formed.

Fourth, put a 2 cm x 2 cm 3m double sided tape on to the middle of the 10 cm x 7 cm board. ( The board with no other boards sticked on to it )

Fifth, stick the arduino main board with the double sided tape on the foamcore board.

Six, cover the arduino with the rectangle cover made from step one to three.

Last, tape the cover with the bottom 10 cm, 7 cm foamcore board together. Make sure the cable go through the hole on the cover.

Step 7: Combine Everything Through Code + Feature + Customize

Load the following script to the Arduino Script Here

Remember to check the pins in the code to see if it matches with your products. Lines to check:

Line 8: pinMode(6,INPUT); IR sensor one --> digital 6
Line 9: pinMode(7,INPUT); IR sensor two --> digital 7

Line 3: uint8_t dataPin = 8; WS2801 data pin --> digital 8
Line 4: uint8_t clockPin = 9; WS2801 clock Pin --> digital 9

If your stair is longer, you can add one more WS2801 strip to your arduino. Connect it via the daisy chain port from the bottom of your WS2801 strip. Also, change the number of pixels to double the number.

Line5: WS2801 strip = WS2801(20, dataPin, clockPin); Change 20 to the number of RGB leds on your strip

(Do not add more than 40 LED, since arduino can not hold that amount of ampere )

If your stair is harder to walk, and need more time, you can extend the seconds of the RGB lighting up.

Line21: rainbowCycle(10); It will take 12.8 seconds to run this. 256 * 5 * 10 / 1000 = Seconds

Change to 20 for 25.6 seconds, 30 for 38.4 seconds. The pattern will keep going.

Step 8: Placement of the Device

Place your device following the picture above.

The IR station with a IR sensor that is connected to digital Pin 6 should be the second IR stations, and be placed on the first step of your stair.

The IR station with a IR sensor that is connected to digital Pin 7 should be the first IR stations, and be placed on the platform of your stair.

The IR stations should be about 5 to 10 cm away from the side of your stairs.

The battery and the arduino case should also be placed on the platform.