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.
First, you need to prepare some materials, which include the following:
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.
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:
At the meantime, fix Arduino to backside of the stairs.
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:
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.
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.