Wait a minute! Are they serious? 1AAA 3W LED Voltage-step up 10mm circuit board (19 modes 3 groups)
Can you really get 800mA from a single AAA cell?
Wait a minute! Are they serious? 1AAA 3W LED Voltage-step up 10mm circuit board (19 modes 3 groups)
Can you really get 800mA from a single AAA cell?
Sounds like it functions but still a wip so probably some unknowns for discovery in field testing and obvious questions like a bleeder resistor for LTC (maybe in 2cell lights bypassing boost IC).
Hmm. The pictures are low quality, but I see on top:
Transistors are often packaged in SOT23-3, but that seems like a lot of transistors. Sometimes “Modes chips” (simple purpose-built PWM flashlight driver controllers) are packaged in that form factor as well. MCUs, MOSFETs, boost controllers, and many other things can be packaged in SOIC8. We can assume that this on is not a MOSFET since all the pins aren’t together on the PCB traces.
This is at least vaguely interesting for now, but not enough for me to order some.
Meh. It’s different and using 100% made up [eg imaginary] specifications. Who knows what it is.
To get 800mA output the driver should need >2A input. This is quite possible with LSD NiMH AAA, but not with Lithium primary AAAs.
@wight congrats, good to hear you got it working Firmware Pin6 to Pin5: With Star Ontime it’s not that straightforward anymore ever since it uses dual-channel and fast/phase. It’s easier with DrJones Minidrv, just in case you don’t want to wait… DDRB=1; // (
2) // PB0 (pin5) instead of PB1 (pin6) as output
TCCR0A=0b10000001; // (0b00100001) // PhasePWM for PB0 (pin5)
OCR0A=modes[mode]; // (OCR0B) // use output compare register of PB0 (pin5)Mode change: Did you try 1xAA or 2xAA or both? 2xAA was the critical part, losing the PAM2803 w/o the 2 resistors.
PWM=1
I just tried 3 frequencies and it’s the same as with linear driver, the higher the frequency the lower the output on low levels.
4.7 kHz (fuse 65) : 25mA
18 kHz (fuse 75) : 15mA
37.5 kHz (fuse 7a) : 9mA
This is with fresh cells of course. No difference between 1AA and 2AA.
Is 37.5 kHz (9.6MHz cpu, FastPWM) the upper limit or can a higher PWM-frequency be reached?
Thanks a lot HQ. I remembered some of that when trying to get STAR ontime working the last time, but clearly not enough! I even tried Minidrv since I knew you’d been using it for testing and it’s so straightforward. I was missing something or making a mistake. Who knows where, I didn’t save the code. Doesn’t matter, it’s working now (STAR ontime).
I went ahead and tested about 20-30 mode switches on 2xAA. They were resting at >1.2v each. Nothing bad seemed to happen.
Maybe we should try PWM=0/255
Disclaimer: I didn’t compare “Phase Correct PWM” with “Fast PWM”. Just looking at Fast PWM, 0/255 = ~8mA input current while 1/255 = ~16mA input current. On the output side that seemed to be ~1mA vs ~2mA. All of this was measured using a free HF DMM set on the 10A scale, so very rough measurements. I’d say that it’s still probably not low enough to really be a ‘low’ moonlight… but I didn’t try it in a flashlight or in the dark.
came across this driver at KD:
I think this is the same driver HKJ has tested here
It’s only 1xAA.
800mA with 1.5V perhaps, but not with a single AA/AAA. Extrapolate the light blue line (current in) to 1.5V and you would need about 3.5A input current without voltage sag to get an output current of 800mA…
With a bench power supply it might work.
As far as I remember I checked all of HKJs driver tests when looking for a good boost driver. The drivers based on the PAM2803 (nanjg110 and our Fasttech-driver, HKJ tested both) had a better efficiency than this one and were only topped by the LD30 which is much more complex. But I did this long before this thread started when I hadn’t hoped to get a driver with good modes.
If you want to compare drivers you can find a remarkably long list of tested drivers on HKJs website
www.lygte-info.dk/info/indexLedDrivers%20UK.html
I went ahead and tested about 20-30 mode switches on 2xAA. They were resting at >1.2v each. Nothing bad seemed to happen.
Very good. As I said I was very reluctant to burn my scarce PAM2803 (a real nuisance that they can’t be sourced in small numbers), but that would give me enough hope to try a built without the resistors.
I’m yet unsure whether I will remove them from my design as long as nobody can tell us for sure what they are for in the FT-driver, but it would certainly free some space. The 15mm driver is very tighly packed, small pads, and just so to avoid clearence errors. Not really easy to build…
.
PWM freq stuff. Maybe we should try PWM=0/255.
That’s a good one, I had completely forgotten about this 255-not-truly-on / 0-not-truly-off issue. And I had only tested FastPWM modes with 3 frequencies, not PhasePWM. No reason behind it, was the quickest way to programm. Will try other values.
Just for the record: my results (25/15/9mA) are LED current, not input current. Measured with a shunt between driver and LED. Darn bright.
Calculations are fine, I had made a table for comfychair ages ago, will include it below.
37.5kHz would be possible only with FastPWM/divider1/9.6MHz and that might be the highest frequency. Soft PWM is above me.
PhaseCorrect | FastPWM | |||||||
kHz | CPU freq | divider | fuse | CPU freq | divider | fuse | ||
1.2 kHz | 4.8 MHz | :8 | 0x65 | |||||
2.4 kHz | 9.6 MHz | :8 | 0x6a | 4.8 MHz | :8 | 0x65 | ||
4.7 kHz | - | - | - | 9.6 MHz | :8 | 0x6a | ||
9.4 kHz | 4.8 MHz | :1 | 0x75 | - | - | - | ||
19 kHz | 9.6 MHz | :1 | 0x7a | 4.8 MHz | :1 | 0x75 |
CPU frequency is set by the fuse (Low Fuse bit 0 and 1) and “#define F_CPU” should be set accordingly.
PWM is set by TCCR0A (where 0x23 is FastPWM and 0x21 is PhaseCorrectPWM)
The divider is set by the fuse (Low Fuse, bit 4) and can be :1 or :8
This way you can reach 19 kHz with Phase correct PWM and Fast PWM.
In addition you have the prescaler (TCCR0B) which is not the divider. You can combine divider and prescaler and set them differently.
OK, pursuant some of those things… v22 switches to the Coilcraft XLF4020 footprint (here is the Eagle part I created for it - note that the tDocu markings are the full maximum 4.3x4.3mm the datasheet allows for). This is by no means a final layout; it is just food for thought. RSENSE has been reduced to 0603. R1 is under the MCU, R2 is to the right of the MCU. They should be spaced properly for the clip. The XLF4020 footprint should accept the inductor from the FT donor board. Looks like I forgot to hook up the OTC.
As can be seen, there is plenty of room for LED- but not enough room for LED. Looks like progress to me though. Ah! I should just move C (OUT) to the left. LED can be located between C (OUT) and the diode. Hmmm
EDIT: I forgot to mention (a) doesn’t pass DRC but it’s close (b) apparently I’ve been using a 0.75mm keepout for this project for a while.
Revisions:
I still think that we can do much better than this.
Is it possible to hand solder by heating a pad connected to one that is obscured?
Is it possible to hand solder by heating a pad connected to one that is obscured?
For most folks? Not a good idea. For a very determined individual? Maybe. My biggest concern would be delaminating the PCB. The pad on the left is easily doable - that’s basically just a normal exposed pad like any other component. If the layout doesn’t change any I think that there is space to expose copper for the right-hand pad as well.
Determined he is, clever he is not. I think Yoda needed a good flashlight. Thanks Alex, I’ll try it.
Revisions:
- Passes DRC.
- LED+ and LED- added
- OTC hooked back up
I still think that we can do much better than this.
LVP included, very well.
The OTC does not block the SOIC-clip?
I had worked with a similar inductor-part before, but even if reflowing: you can’t see whether the solder is done. The inductor is all copper and ferrite and eats a lot of heat. That’s why I used these halfmoon pads which are just so much to the edge that you can see the solder paste and the reflow result.
Just for the record the PCB Layout Guidelines from the PAM2803 datasheet:
“The input capacitor and output capacitor should be placed respectively as close as possible to the input pin and output pin of the IC; the inductor and schottky diode should be placed as close as possible to the switch pin by using wide and short traces for the main current path; the current sense resistor should be placed as close as possible between the ground pin and feedback pin.”
When I stare at my 15mm board the design is really not prone for adapting to the LVP. scratch head
Any idea at which voltage the LVP should cut off in low mode?
I’m busy til sunday, but can’t wait to crash-test some drivers.
LVP included, very well.
The OTC does not block the SOIC-clip?
I had worked with a similar inductor-part before, but even if reflowing: you can’t see whether the solder is done. The inductor is all copper and ferrite and eats a lot of heat. That’s why I used these halfmoon pads which are just so much to the edge that you can see the solder paste and the reflow result.Just for the record the PCB Layout Guidelines from the PAM2803 datasheet:
“The input capacitor and output capacitor should be placed respectively as close as possible to the input pin and output pin of the IC; the inductor and schottky diode should be placed as close as possible to the switch pin by using wide and short traces for the main current path; the current sense resistor should be placed as close as possible between the ground pin and feedback pin.”When I stare at my 15mm board the design is really not prone for adapting to the LVP. scratch head
Any idea at which voltage the LVP should cut off in low mode?
I’m busy til sunday, but can’t wait to crash-test some drivers.
I used the usual 18 kHz. What bothered me most was that at PWM-1 it still gave 16mA. That’s pretty much for a lowest mode.
While fast PWM 0/255 does generally work, it has also been rather unstable on every device I’ve tried. As one example, I was getting 3 lm on a full cell, 0.1 lm at about 3.9V, and barely enough to see the LED at 3.6V. Nothing at all below that.
Phase-correct PWM at 1/255 is much more stable at different voltages.
Then again, I haven’t tried anything remotely like this boost driver. It might behave very differently.
At a guess… If it has only a FET and no constant-current channel, moon mode probably isn’t feasible. OTOH, you might be able to add a separate moon mode with a simple resistor from a MCU pin to the LED. The MCU should be able to power the LED directly. No PWM necessary, and I think the MCU can even go to sleep with an output pin high. So, it might be pretty efficient.
Just an idea. You know, for when you find extra room on the already-cramped board.
TK, I’d say that this is pretty different from the FET/linear drivers you are accustomed to. Like 7135 driver the base circuit here (from the PAM2803 datasheet) attempts to provide constant current. Unlike the 7135 this circuit has the ability to pull more power from the battery as input voltage drops. With only 1xAA ouput current is not actually constant AFAIK, but I speculate that results will be better than DD & linear drivers. I could be 100% wrong about this next bit, but I suspect that having a low-duty-cycle PWM (like PWM=0/255 FastPWM) will probably allow the PAM2803 to perform a good bit better than the datasheet shows. (Better in this case meaning more able to drive the 0/255 at a consistent level.)
RE: driving the LED from an MCU pin w/ resistor. That’s an interesting idea for this situation. When the normal output PWM channel on the MCU is turned completely off the PAM2803 will boost to almost exactly 5v and stay there. I’m assuming that this should give much more consistent output than any DD or linear driver attempting this approach. Choosing a load resistor is a simple matter of using any online LED calculator, they all expect a constant input voltage and that’s what we’d have here (5v).
Earlier today I realized that I had an important question for you RE: this driver. What’s the state of offtime without the cap? I know it’s workable, but what are the details?
Earlier today I realized that I had an important question for you RE: this driver. What’s the state of offtime without the cap? I know it’s workable, but what are the details?
Offtime without the cap generally works fine as long as you don’t care about having more than “short” and “long” and don’t need to tweak the threshold between the two.
The attiny’s SRAM basically has either decayed, or it hasn’t. At least, when looking at a single byte. In my experiments, this happens at anywhere from 0.3s to 4.0s, depending on how long the rest of the circuit takes to settle. On a nanjg driver it’s about 0.5s. On a FET+1 it’s generally about the same. But if there is an OTC, and that OTC is charged, the SRAM decay doesn’t happen until after the OTC has discharged most of the way.
In general, most of the SRAM bits decay to a “1” state. So, set a byte to 0, read that byte on boot, and if it’s still 0 you know the light hasn’t been off for very long.
IIRC, something like two thirds or three fourths of the bits decay to a “1” state. So it’s possible that the selected byte could just happen to decay to all zeroes, but it’s very unlikely. The chance is something like 1 in 20,000.
Using this trick to store values between boots is somewhat more risky if there is no OTC or other power source to sustain the data for a few seconds. The long/short detection byte might be all zeroes, but the data byte(s) may have had a bit decay. The time window for this is pretty short though, and risk can be reduced by using more than one detection byte… Still, any genuinely important data should be stored somewhere more stable. Or use a different method to measure time, and only trust the decay-prone data when the time is safely under the limit.
That’s probably more detail than necessary, but hopefully it gives you more of an idea what to expect. The attiny can hold values in SRAM until it runs out of power from other components, and this is around half a second on most BLF drivers.
So the 2803 has both a switch pin and Vin, can pwm be applied to the switch obviating the need for the fet?
@all - measuring input current on my HF DMM it seems really nonlinear vs PWM. Could be PWM confusing the DMM though.
So the 2803 has both a switch pin and Vin, can pwm be applied to the switch obviating the need for the fet?
Heh, I’ve had the same genius idea myself several times. Eventually I have to snap myself out of it - the unfortunate and in-hindsight-obvious answer is no. The MCU won’t run if the PAM2803 shuts down, it is bootstrapped on the PAM2803’s output.
I suppose it actually isn’t obvious if you haven’t read the OP in a while or aren’t familiar with the term bootstrap or it’s use in this context… OK, so here we go. The MCU (ATtiny) won’t run on low voltages like 0.9v, but the PAM2803 will. We currently have the Enable/Shutdown pin on the PAM2803 tied to Vinput, so it turns on as soon as battery voltage is applied. The PAM2803 uses a sense resistor to do CC (constant current) output, so once it turns on it will drive the LED at the current set by the sense resistor. (On 0.9v input it won’t do a good job, but it will try). Generally speaking this means that we’ll get something like 3-4v output from the boost circuit (to match LED Vf at the set current). The MCU is attached to the same output as the LED, so the MCU doesn’t start until after the PAM2803 starts boosting. The LED is hooked up through a transistor and once the MCU is up and running it can PWM that transistor. During any time period where the LED is not hooked up the sense voltage drops to 0v. The PAM2803 will attempt to increase the sense voltage (eg the sensed output current) by increasing output voltage. We depend on the PAM2803’s overvoltage protection here: the PAM2803 has OVP set at approximately 5v. The peaks are within the MCU’s regular maximum of 5.5v. If we were turning the whole PAM2803 off here it would be like blipping the clicky switch.
Other stuff: