At the beginning


There is a staircase in the house. It is very interesting to see many staircase renovation projects in the community. Not very busy recently, so I decided to use some open source hardware modules to transform the stairs at home and add some interactive functions. This project will not be particularly difficult, it takes me about an afternoon. If you also have a staircase in your house that needs to be renovated, I hope this sharing will help you.

STEP 1 - Preparing work


First, you need to prepare some materials, which include the following:

Electronic module

Consumables

  • Wire
  • DuPont Wire
  • Header

Tool

  • Soldering iron
  • Wire stripper
  • scissor
  • Glue gun

STEP 2 - Connect the LED bar to the MOS switch and stick it under the stairs


The function of the MOS switch is to amplify the current. As the Led bar need abouts 500mA, the IO port of the Arduino has no way to directly drive the LED light bar, and the IO drive capability of the Arduino can be utilized through the MOS switch.

The MOS switch has 3 interfaces, V + and V- are connected to the positive and negative poles of the LED bar, VIN and GND are connected to the positive and negative poles of the power supply. There is also a 3PIN control pins. SIG is connected to IO of Arduino, VCC is connected to 5V, and GND is connected to the negative pole of the power supply. Since the Arduino and the LED use the same 5V power supply, we connect the VIN of the MOS switch module to VCC through a wire, so that there is no need to connect the power supply twice.

Connect the positive and negative poles of the LED bar to V + and V-

There is 3M tape on the back of the LED bar, which can be directly stuck under the stairs. The MOS switch can also be fixed under the stairs by glue gun.

STEP 3 -  Connect the power of all MOS switches together and fix to the stairs


In this step, you need to connect the power supplies of all MOS switches in parallel, and here you need some wires. The schematic diagram of the connection is as follows:

This is mainly a tedious job, after completion, as shown below:

STEP 4 - Fixed the ultrasonic sensor and Arduino


In this step, you need to fix the ultrasonic sensor to the entrance of the stairs so that when you walk up the stairs, the ulstrsonic can sense it.

The ultrasonic sensor can be fixed by glue gun, as shown in the following figure:

At the meantime, fix Arduino to backside of the stairs.

Ultrasound has 4 pins that need to be connected to Arduino.

  1. VCC connect to 5V
  2. GND to GND
  3. Trig, this is the sending pin of ultrasonic sensor, connected to D2 of Arduino
  4. Echo, this is the receiving pin of ultrasonic sensor, connected to D3 of Arduino

STEP 5 - Connect the signal of the MOS switch to the Arduino IO


A total of 9 MOS switches are used in this project. We connected the SIG of 9 switches to D4 ~ D12 of Ardino. The schematic diagram is as follows:

This is also a tedious job, which requires soldering and fixing a lot of wires and requires a little patience. The completion is as follows:

STEP 6 - Power-up test


Connect the two power cables connected to the MOS switch in STEP3 to 5V and GND of the Arduino.So far the most difficult work has been completed. We need to check whether there is a problem with the wiring. Open the Arduino IDE and write the D4-D12 pins to a HIGH level to see if all the LEDs work well. If some of them don't work, we need to check the wiring.If the wiring is well, we can start the interesting software work now.

STEP 7 - Programming with Arduino IDE


Here we use the famous Arduino IDE for programming.The ultrasonic sensor needs a library to drive, click to download.In this project, I simply wrote an example. When a person is detected, the light will slowly light up.Of course, you can add some interesting interactions according to your preferences.