LED Map Lamp with Dimmer, version 2
This is an update to the old LED map lamp using a wider range from dim to bright and updated LEDs with a more even and brighter light. There are two circuits, one for 4.5-5v (USB) and another for 9v-14v car battery connection. The LEDs are now flat top with a 1200MCD rating. I retrofitted one of the old lights to use the 5v board powering it off of a USB plug and swapping out the single LED for four brighter LEDs. The PWM controllers below do not have a diode to protest them from motor kickback so only use them to power LEDs.
This project uses a PIC microcontroller and you will need to be able to download the hex code into the PIC 12F683 before it will operate.
The side shield hasn't been installed on the new light yet. I'm going to try opaque heat shrink tubing around each LED before I add a full shield. Note that the resistors were moved to the head with the LEDs. This will allow different LED configurations using the same controller. It also allows the resistors to be appropriate for the incoming voltage so the same LED board may be used for the 5v or 12v circuit.
There is also a 5 LED version that uses the same PWM controller.
|The finished 5v board before going into the light controller box. The three wires go to the 10k pot that controls the brightness. A dead USB mouse's cord was used to supply power to the left side connections. (Red wire is +5v, Black wire is ground). The right side connections are the pulse with modulated output. The circuit boards are available from OSH Park for the 5v controller, 9-12v controller and for the 4 LED head.||The same board showing the wiring. red wires are on the top and blue are on the bottom. The brains of the board is 8 bit PIC 12F683 microcontroller. The PWM code was written in CCS C and uses about 10% of the chip's 2K of RAM. The 2N7000 MOSFET can only handle 200ma so I wouldn't run more than eight 20ma LEDs off of this board. The 5.1v Zener diode is for over voltage protection. The PIC hex code is here|
|At the lowest setting of the
pot the LEDs are completely off and the circuit draws between 1 and 2
milliamp. The minimum pulse width the LEDs on is about 0.39% of
the total. This doesn't go lower because the bottom if the POT
values were clipped to guarantee that there is really an off even if the
pot is slightly out of spec.
When I set the pot to the middle the value was almost exactly 50% (50.31%)
At the highest setting the PWM value is between 99.9 and 100%, depending on the pot value. Good enough for a really bright light - or enough to get you kicked out of most star parties if left on.
Go Back To The Main Page