Building a LED driver circuit and battery charger.

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
There are quite a few good and name brand 18650 cells on my shelf, they need to be put to good use.
Blinkenthings are a passion of mine so I decided that I want to build a few LED lights and will start with a flashlight.


Main goals:
300 Lumen
High CRI
No PWM
2-3 Hours run time
Rechargeable through micro USB


Technical requirements:
Build in battery protection, my cells are all unprotected.
Build in charger.
At least 2 buttons and the option to use a rotary encoder.
Temperature sensing of the LED.
Low cost power LED
Very rough battery level indicator LED
Charging status LED
Use parts already available or familiar with.


Here is what I have cobbled together, it could all fit on a small 75x19mm board, one side all the logic and passives and on the other the switches, the USB port and LEDs:


http://i.imgur.com/MYPhcUD.png


LEDs:
Nichia NF2L385 since they are relatively cheap, available in warm and cold white and have a 80 CRI.


LED driver:
Texas instruments TPS61165, it uses analog dimming, has a digital interface and I already have a few of them. It has a 1A switch and should do 2.5W to 3W output power.
The LEDs have a efficiency of ~110 lumen/watt so we are roughly in the ballpark of 300 lumen output power.


Charging IC:
Microchip MCP73833, I have worked with it before, I already have a few, it has a temp sensor that monitors the cell while charging and has a 3 pin status output.


Status LEDs:
Two WS2812b since I have a ton of them.


Cell protection:
Texas instruments BQ29700, I like TI parts and it fits the bill, the cut of at 2.8V is high enough for the cells I have to stay on the safe side and it has over current protection.
This part will hopefully never actually do something, it is just a insurance in case the controller does not do its job and prevent a over discharge.
It is just two more bucks worth of parts for some peace of mind, lithium cells do tend to catch fire.


Microcontroller:

Atmel ATMega328p, already got a few, I should have the board space and I need a few pins.




I could use a AtTiny and the first draft used one, but the AtMega costs only 2 bucks more.
Same goes for the status LEDs, I could just put a single one on the controller and an extra one hardwired to the charger but if I have a big µC I might as well use it.
The WS2812b have a high standby current so they need an extra FET to switch them of.
Again, all this could be done with less parts, smaller controllers and hardwired, I like this approach more.
My plans are to get a few metal core PCBs from china to solder the LEDs to and to put a thermistor on the board along with the LEDs to get a rough over temperature protection.
The battery voltage is measured internally in the controller, the AtMega328P and measure the internal band gap reference against VCC as AREFF.


That is the rough idea of the whole thing, any thoughts?
 

DIWdiver

Flashlight Enthusiast
Joined
Jan 27, 2010
Messages
2,725
Location
Connecticut, USA
Sounds like a fun little project. Also sounds like you have a pretty good handle on it.

What are you planning for the body? Have you thought about optics?

At 3W, I'd say you probably need more heatsinking than just the star, unless you get a big one and have some convection airflow on both sides.

The bandgap references on the Microchip processors I use suuuUuuuUuuck! Like +/- 6%, or even 8%. Almost anything, even a zener diode is a better voltage reference. Almost all voltage regulators, even the LM7805 designed back in the '70s, are better. Modern ones are often 2% or even 1%. The forward voltage on your LEDs might even be better, especially if you correct for temperature. I don't know why they even waste the silicon on it.

Are Atmel's better?

Oh, I'll just look it up. Let's see... AtMega328P... Oh my! It's worse! +/- 9% (they specify 1.1V +/- 0.1). That's not a reference, that's a guess.
 

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
Sounds like a fun little project. Also sounds like you have a pretty good handle on it.

Thanks!

What are you planning for the body? Have you thought about optics?

No optics, more or less, i want it to be as wide of a beam as i can get.

The casing i want to try to 3D print:
http://www.candlepowerforums.com/vb...-3D-printed-18650-light-playing-with-the-idea

I am close to the first run of test parts, i think i will have something printed within the next two weeks, still got problems how i will mount the USB connector.

At 3W, I'd say you probably need more heatsinking than just the star, unless you get a big one and have some convection airflow on both sides.

Yea, that will be a challenge indeed.

Oh, I'll just look it up. Let's see... AtMega328P... Oh my! It's worse! +/- 9% (they specify 1.1V +/- 0.1). That's not a reference, that's a guess.

You are right that they are not the best but i have used them often and they work reasonably well for what they are supposed to do.
I had good luck calibrating them in the past, the internal reference can be measured on the AREFF pin and the value stored in the EEPROM.

It is a neat trick to measure the battery that way without any external parts.
I would not use a AtMega but it is what i know and have, there are so many better chips out there.
 

DIWdiver

Flashlight Enthusiast
Joined
Jan 27, 2010
Messages
2,725
Location
Connecticut, USA
I would not use a AtMega but it is what i know and have, there are so many better chips out there.

Better is in the eye of the beholder. I'm not so sure that there are 'better' chips out there, though most certainly there are. There are different ones, with different strengths and weaknesses, but whether they are better depends on your application, experience, expertise, quantities, etc. Oh, and possibly your tool set. Oh, and how much free (or cheap) stuff you can get.
 

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
It should be obvious that "better chips" in this context means, better suited to this task.

A low power device that does not need a external clock source, is tailoered to low operating voltages and has a integrated USB interface is what better means in this context.
 

Latest posts

Top