Lighting the Room
- Buy a Lego Technics Flatbed Truck 8109 (completed)
- Construct Lego Technics Flatbed Truck according to documentation (completed)
- Research Electrotechnics (completed)
- Construct a plan to illuminate the model (completed)
- Create a proof of concept in software (completed)
- Buy parts (completed)
- Create a proof of concept in hardware (completed)
- Implement hardware in Lego model (work in progress)
- Document the entire procedure (work in progress)
- April 12, 2013 – initial documentation
- April 18, 2013 – added technical details
- May 10, 2013 – revisions on the use of M5450
- May 13, 2013 – revisions, on brick issues and electronics
- May 13, 2013 – bis, added references appendix b
After you receive the Lego set. Build it using the accompanying guide. If you don’t like to do it, ask any 10-year-old and make his day. Just make sure to let the kids play with the truck once in a while after it’s finished! It’s still Lego!
- The front headlamps – they need 3 settings, parking light, low beam and high beam. Note that there are 4 lights on the front of the truck.
- The front indicators – 2 for left and right.
- The front light bar – 4 lights to ‘light up the room’. These need to be as bright as the high beam. Perhaps link them to high beam for easy interfacing
- The top light bar – 5 lights to simulate a emergency light bar. Yellow, flickering, attention drawing.
- The rear lights – just 2 light indicating that the lights are on. 1 setting, coupled to parking light, low or high beam.
- The brake lights – 2 fittings
- Reverse lights – 2 white lights next to the brake lights
- Rear indicators – 2 orange lights for going left and right, you know how to use them, don’t you?
- High rear brake lights on the truck bed – again 2, directly connected to the lower rear brake lights lights
- High rear indicators, as above, mirroring the indicators, 2 more.
- Interior cabin light – 1 or more soft lights, need to be warm white.
If you add these up, it’s rather a lot of LED’s. 28 to be exact. They can be split into groups that light at the same time for simplification. I need a couple of electrical bits too, to drive all these led’s because you cannot simply chain those led’s to the output port of the micro. More on that later.
To turn these lights on and off, i will be adding an Infrared sensor to the board, so that all lamps can be controlled by a simple cheap household remote control. I’ve got some remotes laying around in my cellar from the various electrical stuff i collected over the years.
This little monster will be listening to the Infrared remote, and it will decide which lights are going on and off. I could have gone even smaller with the Arduino Mini Pro, but that one needs are separate USB ttl board to be able to upload the program, which would make it a little more expensive.
- Left Indicators (3 led’s)
- Right Indicators (3)
- Headlights (4) (PWM)
- Light bar left (2)
- Light bar middle (1)
- Light bar right (2)
- Mist lamps (4)
- Reverse lamps (2)
- Rear lamps (4)
- Brake lamps (4)
- Interior lighting (1) (PWM)
So in total 11 outputs, and only 2 PWM outputs. I could redesign the light bar to use PWM as well in a later stage.
(UPDATE: I’m no longer using the darlington, keep reading)
That was so cool! In 5 minutes i had a working remote functionality!
- Dual interface via Infrared or bluetooth
- A buzzer or piezo speaker to simulate the reverse warning alarm (beep beep beep beep)
Explain the PWM plan
Explain the interior lighting
Explain the light bar
Explain the infrared remote
Explain the bluetooth remote
- Getting LED’s in the rear of the truck.
- Getting the LED’s behind the front grill
- LED’s in the light bar and the fog lights
- LED’s on top of the flatbed, behind the cabin.
All of them required some serious thinking!
I started with the rear, thinking they were the easiest.
The led’s themselves hide in the little grey studs. The colored glass pieces are sitting on a black 4×1 piece. Grind off the little edges of the LED’s to make them no bigger than 3mm. Then drill holes in the black 4×1 so the lights can pop their heads through.
Back to Electronics
After some discussions on several forums, somebody (quote) suggested that the power to the led’s should even be regulated by the Arduino, because the M5450 would take care of all the current limiting. Hey that solved several problems in one go!
Now that all the hurdles are taken, i downloaded a copy of Eagle PCB (free CAD software for designing PCB boards) and started laying out the required components. After a lot of shifting, here’s the resulting board:
Appendix A – Materials
Appendix B – References
Lego powerfunctions: http://www.philohome.com/pf/pf.htm
Arduino Micro Information: http://arduino.cc/en/Main/ArduinoBoardMicro
IR Library: http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html
IR sensor: https://www.sparkfun.com/products/8554
JY-MCU bluetooth module: