Help figuring out how this Circuit functions

Thread Starter

mattaus

Joined Jan 18, 2013
16
Hi all,

I'm a new member here so please go easy on me.

Anyway, I'm busy trying to build a super simple and very small footprint controllable high brightness LED driver. Long story short I've spent the last 2 days trying to find appropriate integrated solutions and was at my wits end when I stumbled across this driver:



It's perfect - a simple linear LED driver. It uses only 3 components, has multiple output levels (low/medium and a user configurable high) and functions off a single battery (Lithium Ion Rechargeable).

What I would like to do is firstly modify the circuit to use a higher power LDO (between 800mA and 1000mA) and hopefully use a ATtiny controller.

Now I can't really do this because of two reasons.

1) I don't know how it's all connected. The VCC and GND pins on the uC and the LDO are obvious, as is the OUT pin on the LDO connecting to the positive LED terminal. I can't work out what other pins on the uC are connected.

2) I want to know how this circuit actually works. It's no good blindly copying something because I've learnt nothing.

Now in relation to part 2, I'm stumped as to how the LDO is working here. LDO's are constant voltage regulators, which as far as I am aware is bad for LEDs as they prefer constant current sources. So is the LDO providing constant voltage, or has it been set up in a manner I am unaware of that enables constant current? Furthermore the LDO only has an enable pin which I do no believe to be compatible with PWM, but I'm pretty sure it is using PWM to control the brightness.

Any ideas? Your help would be greatly appreciated! This is doing my nut in lol.

Thanks,

- Matt
 

wayneh

Joined Sep 9, 2010
17,498
Reverse engineering is tougher than forward engineering. Instead of trying to adapt and modify an existing circuit, time might be better spent creating your own solution. I'm not suggesting reinventing the wheel. LED dimmers are a pretty well covered topic around here.
 

THE_RB

Joined Feb 11, 2008
5,438
It's likely also illegal and against forum rules to break copyright on a commercial product.

If you had to repair on or just make one for yourself for hobby use that's a different thing, but your wording makes it sound like you want to design a product and want us to conspire to help you rip off someone else's product...
 

ErnieM

Joined Apr 24, 2011
8,377
In the picture it looks like a PIC12F629 to me. If I hit "next" on ImageShack I get a schematic which is a pretty good representation of what you want to do... maybe. I have a personal adversion to giving a LED a voltage (without a limiting resistor) and not a current, but it is done. Perhaps the max current of the LDO is selected to keep the LED safe, that works.

And yes, you can PWM the voltage like this to change the brightness. That's all the micro needs do, that and accept whatever changes the brightness level.

I've done this before (using a current drive) and could set the brightness from nothing to full on.
 

mcgyvr

Joined Oct 15, 2009
5,394
There are SOOOOOOO many LED driver specific IC's out there..

That looks like its using a TI LDO (TPS736 series) with a max of 400mA..
 

Thread Starter

mattaus

Joined Jan 18, 2013
16
Thanks for the replies guys :)

1) I'm not trying to rip someone off - the driver I have pictured above went out of production nearly 4 years ago and besides, I have since learnt the circuit is so common it'd hardly be seen as cheating to create a similar one.

2) The circuit you hit by clicking next is one I drew up while trying to work it out. A friend actually ended up figuring it out :) I have since swapped out the uC for an ATtiny13, and the regulator for a TPS73512...so my max drive current is around 1000mA where I wanted it. I've also included thermal protection and battery voltage monitoring plus reverse polarity protection. The circuit is pretty different to what I originally was looking at:



Please ignore my scribbled PCB on the left. I started experimenting with layout because I want to fit this all on one side of an 8mm or 10mm PCB and got lazy as midnight approached and passed me by. I'll sit down at some point and draw it up in CAD hopefully. If you notice anything wrong with the circuit itself I'd be happy to hear it. Sorry the drawing's a bit basic.

The connections to pins 1 and 4 on the uC are for a voltage divider network setup to perform thermal measurements (thermal control). Pin 1 outputs a reference voltage and pin 4 reads the resultant value (which fluctuates based on temperature due to the NTC resistor forming the second half of the divider). The connection to pin 9 is a normal voltage divider for battery voltage monitoring. The Diode is for reverse polarity protection. Pin 6's output drives the enable pin on the regulator for dimming control.

3) For the curious this is the explanation I got on the circuits function:

The TPS73601 is being used as a current regulator. Since there is nothing connected to the FB pin (or it’s tied to ground), the regulator doesn’t pay any attention or make any attempt to regulate voltage directly. It will output voltage as necessary. It has an internal 650mA current limit built in though – this means that it will output only as much voltage as is necessary to drive 650mA; No more.

So there’s the regulation concept. Quite nice actually.

I’m sure PWM is then being used from the microcontroller to the EN pin on the regulator for brightness control. Just because the Microcontroller doesn’t have a hardware PWM module doesn’t mean that the software designer couldn’t simulate it by turning a pin on and off very quickly in code..

while (medbright) { LATA |= (1<<5); Delay_us(500); LATA &= ~(1<<5); Delay_us(500);
}

That would give you a 1Khz PWM at 50% duty cycle on Pin RA5, for instance. There’s no problem with doing it that way when the microcontroller doesn’t have anything else to do anyway.. Hardware PWM is nice because your micro can continue to do other things while generating a PWM signal, but for a flashlight driver, it’s hardly necessary.
4) I know there are thousands of potential solutions. This post wasn't just about finding one, but also an attempt to learn how this particular one worked, but while I am familiar with linear LED drivers, the way this one worked was doing my nut in, and I wanted to know! I am trying to learn after all :)

Thanks,

- Matt
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
So you ask "how does this circuit work?" then provide the detailed explanation you had in your pocket all along?

What a waste of our time.
 

Thread Starter

mattaus

Joined Jan 18, 2013
16
So you ask "how does this circuit work?" then provide the detailed explanation you had in your pocket all along?

What a waste of our time.
And why on earth would I bother doing that? Honestly, please tell me because I can't figure it out.

When I asked I didn't know. That's why I ask questions - to learn. I spent the better part of 2 days trying to figure it out. It was purely coincidental that I found out how it worked so soon after posting. Did it ever occur to you that I asked in more than one place? The internet is a great resource and using one forum or website is akin to going to a library and doing all your research from only one book. Or getting all your news from one TV station.

Just. Plain. Dumb.

Honestly I could have not bothered replying to this thread after I figured it out. Instead I came back and explained it. In fact I've gone and replied to all 3 forums I posted the same question in.

I find that much more constructive than making disparaging comments.

Thanks,

- Matt
 
Top