Home-made indicator lamps from glass blocks and a diode strip (and, of course, raspberry pi)

    During the last repair over the bathroom, a space was found between the ceilings about 20 cm high, including the kitchen. It was decided not to completely close it back, but to insert several colored glass blocks with bulbs behind. Time passed, the glass blocks stood still for six months, and finally my hands reached the bulbs. Of course, just turning them on together with the upper light was uninteresting, and I wanted to make them show something.



    Then the raspberry pi computer arrived, and the project began to take shape. I will not tell you that I soldered everything in one evening, it was rather months.

    As sources of light, I took trimmed diode strips from the upper light in the kitchen. The tape is the simplest, 6W / m, powered by 12V (the old universal notebook power supply). Around this moment, the overhead light also wanted to be made controllable, so that there were not six, but seven controlled lines.


    The yellow glass shines brighter than others, we will make it weaker with the help of blue electrical tape.



    To turn on / off the light, you need to open one of the contacts to the LED strip (0 or + 12V). Zero turned out to be simpler, this allowed us to combine the zeros of a 12-volt PSU with lighting and a 5-volt PSU pi. In the bins there were transistors IRLML6344TRPBF(although almost any would do). They can switch up to 5A and up to 30V, and switch in 30ns (pull any fast PWM). We put one on each line. The result was such a scheme:


    Left control lines. The LEDs are indicated schematically, each symbol is a piece of diode tape

    so that the control leg of the transistors does not dangle in the air, hooks it through 15k ohms (again no matter how much, it is better more) to zero for all transistors. For the first line (the upper light), I built a divider R1: R11 (15kOhm: 45kOhm) so that it was turned on by default.

    I did not want to tighten pi to this circuit tightly, and it will be located in an inaccessible place, so I need to connect it with an eight-core cable (seven control lines and ground) ... stop, I know the right cable!

    Here is the same diagram from a piece of a breadboard, SMD transistors and old resistances:




    At this end, twisted pair is soldered, and at the other end wires are sticking out


    One connector - for the power supply, the second - for the wire to the upper light

    Connect - the light is on. We shorten the wiring with the fact that it is turned on by default - the lights blink. The order of the legs can not be remembered, the main thing is to distinguish the earth (brown). We squeeze the other end and do everything beautifully:


    pi has a lot of free legs.

    Try!



    Everything, now nothing prevents to turn on the light from anywhere:



    The webiopi library is used to control the GPIO (it provides an HTTP REST interface to the legs).

    It turned out that turning on the light from the phone was inconvenient (who would doubt it!), So the lamps were programmed to work independently. Now they show in color the level of Yandex traffic jams. Tell about it in the next series?

    Also popular now: