SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By kirash4
#172176
I'm working on a design that for the most part is working ... with a few issues. I'm hoping there are some experts here that may be able to suggest some changes to address them. Let's start with the attached schematic.

On the left hand side is the charging circuit which uses a MAX8903 to charge a single attached Li-Ion Power Cell using either USB or DC-in to do that. It also provides power-out through the SYS pins and I have a main power cut-off on there. This allows me to cut off power to the rest of the unit, while leaving the battery attached to the MAX8903 so that I can charge it regardless of the unit being turned off or on. This is a must.

Moving on, you'll notice the battery is also feeding two LED strips through some Sziklai pairs. The reason for that is so that the LED strips can take full advantage of the current capacity of the power cell as they will pull upwards of 10A (and yes, the battery can supply that with no problem.) And they also don't need any more than the 3.7V (nominal) that the battery will provide.

Next, after the main on/off switch is the boost circuit to drive the actual controller (which is an Atmel 32U4.) The circuit, based on a LM2621, will supply 5V/1A to the controller. The controller will trigger the Sziklai pairs when the strips need to be turned on or off.

As I said before, this all works for the most part ... but here are the issues:

a) Because the main on/off switch is after the charging circuit, that leaves battery voltage on some parts of the circuit. What I'd like to figure out is whether there is a way to cut power off from the circuit, as in completely isolate the battery power, cut it off completely. Then, when I plug in either USB or DC in power, or flip the main power switch on, it then reconnect the battery to the MAX8903 to actually be charged or used (notice that it needs to be connected to the MAX8903 to provide power through SYS out pins.) While I could easily use a DTDP switch to cut of the battery, that would require turning the unit back ON when I want to recharge the battery, and frankly I like the idea that I don't need to do that right now. So I'd like to keep the battery from being connected to a permanent toggle switch like that.

b) I'm getting what I can only refer to as a flyback whenever I turn the unit on or off, and it's enough to cause some of the LEDs to flash on each time. Obviously that's bad and I need to figure out how to stop that. I'm assuming it's because of the way they are wired to VCC, straight from the battery. I don't know if solving item (a) above will fix this, but I need to address it. I just don't have a clue how.

c) While the Sziklai pairs work as far as shutting off VCC to the strips, they don't work well when the software calls for turning them on or off. What I mean with that is, the LED strips are addressable, specifically LPD8806 based strips. When I turn on/off the Sziklai pairs, it scrambles the strips. For example, if the last command sent was to turn off all the LEDs and then the Sziklai pairs are turned off, the next time I turn those Sziklai pairs back on, the strip will come on with random LEDs lit up, random colors, just completely random. The reason I want to constantly be turning the strips on or off is to save on battery. The LPD8806s have what we tend to call 'ghost power consumption', where even when all the LEDs are turned off, the IC is still eating up current. So by cutting that off, I will save on battery consumption. The actual unit has 48 of those ICs in it and over time, that ghost consumption starts to add up. There are times where the LEDs are all turned off, but the controller itself is on, waiting for an interrupt to fire to turn the LEDs back on. So when they're off, I want to cut off VCC to the strips and save on battery. Right now I'm turning on the Sziklai pairs and leaving them on till I shut the unit off. While that works, I'm draining the battery faster that way.

So there you have it, the issues I would like to tackle and fix, if at all possible. I have one other item that I would like to address, but that's a wishlist item and I feel the above need to be addressed before moving on. So let the ideas/suggestions/questions begin ...
You do not have the required permissions to view the files attached to this post.
By Mee_n_Mac
#172228
kirash4 wrote: c) While the Sziklai pairs work as far as shutting off VCC to the strips, they don't work well when the software calls for turning them on or off. What I mean with that is, the LED strips are addressable, specifically LPD8806 based strips. When I turn on/off the Sziklai pairs, it scrambles the strips. For example, if the last command sent was to turn off all the LEDs and then the Sziklai pairs are turned off, the next time I turn those Sziklai pairs back on, the strip will come on with random LEDs lit up, random colors, just completely random.
Let me start w/the above because I've not digested the power management/battery charger scheme. IIRC there was some talk about using the "power" from the clock and data lines to program the LPD8806's w/the LEDs off. That is ... just before turning on Vcc via the Sziklai pairs, you program the LPD8806's via the above path so, hopefully, the LEDs will continue to stay off during power application. Did you give this a try ?
By kirash4
#172229
Good memory. I actually have not tried that yet because I see the same thing happening when I physically turn the unit off then back on. So I figured it's all tied the same thing, whatever it might be. I'm likely wrong here, but at the moment I can't do any testing either because of item (a) above and a poorly placed metal tweezers while attempting to adjust the position of the unit inside of its enclosure ... hello magic blue smoke. I have parts on order to build another unit while I'm also making small changes to the circuit layout (just moving parts around) so hopefully I don't short things out again. I need a set of thin, strong, and non-conducting set of tweezers ...
By Mee_n_Mac
#172264
Well it's (the above "phantom power programming, PPP") an easy experiment and a low cost fix ... if it works (unlikely as it now seems), so give it a try. I'll also speculate that perhaps a switched voltage; a "high" working voltage and a "low" programming voltage to the strips, is worth a thought. I assume you have LED strips and so there's no practical way to separate the LED supply voltage from the LPD8806 IC supply voltage. But perhaps at a low enough Vcc the LEDs won't come on (or be noticeable if they do), allowing the ICs to be programmed to off before the "high" voltage is applied. An experiment using a tapped battery stack could be done to investigate the concept.
By Mee_n_Mac
#172265
b) I'm getting what I can only refer to as a flyback whenever I turn the unit on or off, and it's enough to cause some of the LEDs to flash on each time. Obviously that's bad and I need to figure out how to stop that. I'm assuming it's because of the way they are wired to VCC, straight from the battery. I don't know if solving item (a) above will fix this, but I need to address it. I just don't have a clue how.
Now onto the above. Can I assume that just prior to commanding the Sziklai pairs to remove power, that the code sends an "all off" message to the LED strip(s) ? Then what happens ? Is it when the LED strip power is removed (via Sziklai pair) that you see some LEDs light up or is it when the main power switch is moved to off the you see the LEDs flash ? I note that with 10 uF per LPD8806 IC and some-number-I-don't-know of them in a strip, the ICs and LEDs may have some decreasing power available to them for some time after the Sziklai pair removes the active voltage. FWIW I note that a separate Vled and Vic would probably solve this issue ... if I've understood what's being seen.

The only potential solution that occurs to me ATM is a hard short for Vcc to ground after power is commanded off so as to drain those caps quick and thus minimize any "flash" seen due to the ICs becoming brain dead.
By kirash4
#172266
Mee_n_Mac wrote:I'll also speculate that perhaps a switched voltage; a "high" working voltage and a "low" programming voltage to the strips, is worth a thought. I assume you have LED strips and so there's no practical way to separate the LED supply voltage from the LPD8806 IC supply voltage. But perhaps at a low enough Vcc the LEDs won't come on (or be noticeable if they do), allowing the ICs to be programmed to off before the "high" voltage is applied. An experiment using a tapped battery stack could be done to investigate the concept.
The "strips" are custom made by me, so changes can be made. The ICs need at least 2.7V to be programmed and that's about the lower voltage for the LEDs (2.8 to 3.4V depending on channel.) Right now, they are tied to the same power plane as the LEDs, and both are fed directly from the battery through the Sziklai pairs. There is no voltage difference between the LEDs and ICs. And splitting the two would mean more circuitry on an already very crowded tiny PCB. Though now that I think about it ... I could add another pair on the strip itself, specifically for the ICs ... hrm. Essentially turning on the ICs first, program them, then turn on the main pairs that will apply voltage to the LEDs. I'll have to do a bit of research on this. Only issue I see right now is the additional control wire. The strips are already very thin and already need 4 wires each ... this would add a fifth (VCC/GND, DATA/CLK, signal for the Sziklai pair.)
Mee_n_Mac wrote:Can I assume that just prior to commanding the Sziklai pairs to remove power, that the code sends an "all off" message to the LED strip(s) ?
That would be correct.
Mee_n_Mac wrote:Then what happens ? Is it when the LED strip power is removed (via Sziklai pair) that you see some LEDs light up or is it when the main power switch is moved to off the you see the LEDs flash ?
More often when the unit gets turned on. When the LEDs are programmed off, the controller brings the Sziklai pairs down as well (effectively shutting them off.) I can shut the unit off with the power switch and all is well 9 out of 10 times. Only occasionally I will see some LEDs get turned back on briefly. But when I flip the unit back on, that's when I see the majority of the brief (and very bright) flashes. I say brief because I'm making the assumption that the controller takes over within a second of getting powered up and sends a 'turn off command' and shuts of the Sziklai pairs again. If the controller doesn't have anything running (as in, I upload a blank sketch to it), the flashes turn into constant on. It's a random thing, random number of LEDs, different brightness, even color (they are RGB LEDs.) So it's my assumption that it's the ICs that are getting a voltage spike and sinking some of its ports (which in turn light up the LEDs.)

What I'm not understanding is, why would there even be power on that plane when the Sziklai pairs are being pulled down with a 10k? Unless for some reason there's a disconnect on the board and it's not working as it should ... which is possible. This is part of why I'm making some changes to the board, making it easier for me to trace test everything and making sure all components are working as expected. Right now it's just impossible to test ... not to mention that I short circuited the power board while fiddling with it. It is flat out dead right now (fried power IC) ... need to build a new one.