ATtiny85 PWM outputs causing supply voltage sag

Thread Starter

ROTiree

Joined Jan 27, 2018
11
I'm thinking about driving 1 (or 2) with PNP, so PWM is inverted, and 1 (or 2) with NPN... that way, the current draw doesn't go o>45>0>45, but will go 15>30>15>30 in the worst case (white) and, most of the time, will be sitting somewhere in the middle with only 2 channels drawing power.

Dunno why the sim said to go so high for R53, because I can't get at the SPICE statements in that particular program to see what they've done with the model for that particular LED. That said, I have learned to take sim results with a fairly large pinch of salt. Proof of concept, fine, refined design and adjustment, forget it. The I/V curve for both green and blue LEDs are pretty similar, so I'll choose one schem for both, then tweak.
 

Thread Starter

ROTiree

Joined Jan 27, 2018
11
Nothing is getting hot, that is for sure. I ran a test for about 6 hours last night - LED was no warmer than about 35C and the ATtiny was stone cold. Resistors are all cool as well.
 

Thread Starter

ROTiree

Joined Jan 27, 2018
11
UPDATE

Thanks for all your help, chaps - it was most helpful. Knowing "what it isn't" is just as, if not more, important as "what it is". The circuit is working sweet as a nut, now. I used emitter-follower drivers, powered by a separate 7805. That took the strain off the ATtiny 85, which meant in turn that there were no glitches on its Vcc rail at all... so the voltage comparator isn't getting confused any more (it has an absolutely stable internal reference voltage but because the input source at pin7 was fluctuating, that meant it kept coming up with slightly different results each time around the program loop, hence the flickers between colours). That means the transitions between colours are smooth as silk, now.

That SPICE sim is out to lunch when it comes to LEDs' behaviour - much more sensible values in there, now, and a beautiful, bright LED. Because the LED power supply is no longer having to power the ATtiny85, its own Vcc is stable as well. Brightness PWM scaling is now done in software, not hardware and that is a lot easier to do than faffing about with "bespoke" resistor values.

Ground is much less noisy as a result of splitting out the power supplies and stopping the unused pins on the ATtiny85 from floating; also, the +9V rail is clean as a whistle (which means no artifacts getting into the audio side of the circuit).

Lastly, I suspect an element of Observer Effect, ie "As soon as you try to measure something, you change it..." As soon as I stopped trying to measure 2 things at once, the circuit behaved itself as planned, with no glitches.

Thanks, once again.

Mike
 
Top