Saturday, 23 April 2016

Building a mobile magnet lamp / flashlight from repurposed parts

I needed a mobile "flashlight" in my car you could simple attach somewhere to the chassis where you'd need it. The are plenty of offers on the interwebs, so could have simply bought one, but I (as usual) had some parts lying around...
I had:
  • A spare 12Wh Li-Ion battery left over from my Kodi car entertainment project.
  • Two broken 1W 12V LED "bulbs", meant as Halogen bulb replacements.
  • Some magnets from old computer harddisks.
I knew I could build lamp with that. For the final design I also used:
First thing were the LED lamps. The glass and plug were shattered, but electrically they were ok. I tested them and one of them turned on at ~4V. I desoldered the regulator PCB disc from the other one and connected the + and - regulator output terminals from the one that still had the regulator PCB to the other one. While I was at it I removed the rectifier diodes. The are not needed when you use DC and connect the leads correctly. It worked, but the LEDs weren't bright enough. The regulator is a constant current supply and thus it still delivered the same amount of current to two parallel LED arrays now. The chip used is a XL6003 LED constant current driver. The typical application circuit in Figure 5 from the data sheet seemed to match my PCB. The resistor RS used to adjust the current had a value of 5.6 Ohm. The calculations in the datasheet of RS = 0.22 / ILED worked just as an estimate for me, so after some testing I settled on a 10 and 4.7 Ohm resistor in parallel = 3.2 Ohm, which almost doubled the current.

UPDATE: You can simply connect the battery to the lamp input! No step-up regulator needed! This makes the runtime even longer! The lamp will grow dimmer when the Li-Ion voltage drops and I've not seen it go below ~3.2V.
I've added a 100 Ohm potentiometer in series to the combined 3.2 Ohm resistor so you can adjust the brightness really easy.

Then I built a shutdown circuit for the 5V step-up regulator U1V11F5 to turn off power to the LEDs when the Li-Ion voltage drops below ~3.2V to save the battery from dying. The regulator has a SHDN pin to turn it on/off. For > 1.5V input voltage you have to apply < 0.4V to the SHDN pin to turn the regulator off and > 1.2V to turn it on. The pin is already internally connected to VIN through a 100 kOhm resitor and thus floats at input voltage and turns on the regulator by default. The shutdown circuit:

You can find the simulation project here, but note that the simulation is not 100% correct, because the transistor model does not use the proper BC557C values. The rightmost resistor is the regulators internal 100 kOhm resistor. The pin connected to the volt meter (transistor collector) should be connected to the U1V11F5 SHDN pin.
Edit: When testing the lamps maximum running time I found it would not reliably shutdown with a 22 kOhm resistor. You may need a lower value to make the lamp shut down earlier. Also the XL6003s is rated down to 3.6V input voltage, so I will try connecting the battery directly and see if it shuts down by itself anyway...

The rest is just connecting the charger to the Li-Ion battery, connecting a switch to turn on/off power to the circuit above and the regulator, and then connecting the regulator VOUT pin to the LED PCB input pin.

Voila, a mobile Li-Ion lamp. I think I'll build a nice wooden enclosure for it...

No comments:

Post a Comment