LED alarm light using Raspberry Pi Zero WH

category: make

In recent years, LED alarm lights, which can be seen in supermarkets, are convenient because you can see the operating status of the equipment even from a distance. The alarm light used in police cars is a combination of a light bulb and a motor, but LEDs are convenient for consumer use.

However, the power supply voltage for many LED alarm lights is 24 V. Therefore, using the small microcomputer Raspberry Pi Zero WH and Texas Instruments LMR562421 that can boost the 5 V power supply to 24 V, I made an LED alarm light that can be controlled by Wi-Fi with a single 5 V power supply. The alarm color can be freely selected by the program, and it can also blink at free time intervals.

LED warning light 1

This LED alarm light has a common anode and can emit red, yellow, and green lights and sound a buzzer. An n-channel enhancement type MOSFET was used as a switching device between the cathode and ground of each color. The gate of this MOSFET was connected to the GPIO port on the Raspberry Pi, pulling down with a 10 kiloohm resistor. When the current of this LED alarm light was measured in advance, it was about 10mA for each light emission and ringing, and even if all the terminals were turned on, it was 29mA. Any MOSFET with this withstand voltage can be used as this switching device, but here I used my Fairchild BS170. The LED alarm light itself was ordered from AliExpress.

LED warning light 2

I connected the MOSFET gate corresponding to red to GPIO26 of Raspberry Pi, yellow to GPIO19, green to GPIO13, and buzzer to GPIO6. And I put it in the case. Since it connects to the Raspberry Pi via Wi-Fi, it is convenient to connect to this LED alarm light tower with only a 5 V barrel jack.

LED warning light 3

Log in to the Raspberry Pi remotely and enter the following command to set the above GPIO port to output.

$ sudo apt update; sudo apt install -y wiringpi
$ gpio -g mode 26 out
$ gpio -g mode 19 out
$ gpio -g mode 13 out
$ gpio -g mode  6 out

Then, for example, gpio -g write 26 1 will turn on the alarm light in red and gpio -g write 26 0 will turn it off. It is charming that the main body is slightly tilted.

LED warning light 4

On the Raspberry Pi 3, all the lighting and buzzers of each color were available. However, for some reason, the Raspberry Pi Zero suffered from the phenomenon that it takes a reboot when the buzzer sounds. After all, I couldn’t solve it. I’m sorry I was thinking of making it possible to notify the alarm status with Morse code.

I was thinking of using it to display the operating status of the RTK reference station and to display the disaster/crisis report of Michibiki, but after a while, the yellow color stopped lighting, and after that, it smelled burnt. Even if you connect a 24-volt power supply directly to the LED alarm light, only yellow does not light up. Since the LMR56421 does not have a protection circuit, I have no choice but to use it now.

LED alarm lights can be used for many purposes, so I would like to try again in the future.