LEGO Compatible Street Light and LED-Brick
Introduction: LEGO Compatible Street Light and LED-Brick
This instructable shows how to build a LEGO compatible Street Light and an LED brick using snippets of a WS2812B LED strip, and it shows how to drive these LEDs with a small microcontroller. As an advantage over other street lights, it can be used to set different colors and intensities – and it does some “rainbow-lighting”.
Supplies
For building the lanterns you will need:
- 3x microswitch
- 1x perfboard 2 cm x 8 cm (6 x 28 holes)
- 1x DIP-8 socket
- 1x Attiny85-20PU microcontroller
- 1x WS2812B LED strip (with 144 LEDs/m)
- 1x 0.14….0.25 mm2 wire ( » 1 m)
- 1x 3D printer with some filament (or print service)
- 1x 40 pin female <PERSON> header (optional)
- 2x 1 pin male <PERSON> header (optional)
- 2x 3 pin male <PERSON> header (optional)
- Some jumper wires and an Arduino Uno (or an ISP) for programming the Attiny
Step 1: Print the Lantern and the Bricks
Attached, you find 5 STL files:
* Lantern: This is the street light.
* Perfboard Brick: Thiswill be the holder of the perfboard with circuit we are going to make. For sure, you can place the perfboard outside your LEGO scene or you may “hide” it in a different case made of LEGO bricks. This is just a simple LEGO compatible brick for keeping the microcontroller within the scene as you probably want to use the pushbuttons to change the light intensity or color.
* Lantern Cable Brick: With this optional 4x2 brick, you can fix the cables coming from the lantern to the ground plate if you want to hide the cables.
* Cable Guide Brick: Another optional 4x2 brick for “guiding” the cables over longer distances.
* LED Brick: This is an alternative brick that can carry two LEDs. It might be useful if you want to build the “stem” of the lantern from standard LEGO 2x1 bricks, or if you want to integrate LED lights in other structures like a wall of a LEGO house.
In the pictures you will see more details on the intended use of these bricks.
After some approaches, I found that printing all parts upside down (with the knobs to the build plate) yields the optimal results in terms of tolerances which is important to make the bricks snap to original LEGO elements. Print all parts with a layer height of 0.2 mm, 2mm wall thickness, 25% infill, support, and a brim. The brim is important for the street lights, in particular.
Please note: If the bricks are too tight to snap on other LEGO bricks or plates, use a sharp knife and scratch a bit of material from the connectors like shown above.
Step 2: Electrical Circuit - the Board
Cut a segment with 13 holes from the perfboard and solder the connections, the headers and the DIP-8 socket as shown in the diagrams and pictures.
In the middle of the board, you see the Attiny and the three pushbuttons. The pushbuttons are connected to the digital inputs D0, D2, and D4. 769
The circuit will be able to drive two LED strips independently using the digital outputs D1 and D3.
While the first diagram (named “Overview”) shows all connections on the front side (including the power and ground lines as well as the connections to the LEDs), the wiring is really done on the backside of the board. Hence, please place the headers, the socket, and the microswitches on one side as shown in the diagram marked with the label “Front” and solder all connections as shown on the diagram with label “Back”. The “Back” diagram shows the board as you will see it during soldering (i.e. mirrored to the front side).
Start with the solder tracks. Use some copper or sliver wire to do the longer ones. Short connections can be done directly using solder tin. After the tracks are established, you must bridge power and GND to both sides using short shielded cables as you will cross other connections or MCU pins (see red and black cables in the pictures).
Please note: The diagrams include the Attiny85 for a better understanding of the wiring. In the real world, please solder the DIP-8 socket here as shown in the photos. You will need it for inserting and removing the Attiny after/before (re-)programming. 635