Supply undervoltage interrupting pauses?

InvaderZim

Senior Member
Hi all, I'm just looking for a sanity check here. I've had an annoying bug, and I think it was due to me being silly about the supply voltage; but I thought I'd share this ghosst story on this fine Halloween 1) to make sure I understand my problem and 2) to warn others.

I used 7.5 volts as the input to a 5V linear regulator (experimenter board), thinking to avoid heat problems. In retrospect, with my cheap supply perhaps 2.5V of dropout is just not enough! My loads include a backlit 16x2 LCD and a 5V relay (switched through a BJTransistor).

I had code that looked like
Code:
{pseudocode}
set interrupt
main:
high relay
pause delay
low relay
pause delay2
{other stuff}
serout to display
goto main
I sometimes got double relay pulses, and yet the interrupt was never triggered...hmmm. It certainly seemed like the pause for delay2 was being interrupted prematurely though, and the display was always updated properly. Then I noticed the LCD would dim during solenoid pulses. It seems my voltage would sag to ~4.5V; not bad, but not ideal. I bumped the supply up to 9V, and it *seems* my problems are gone.

So my question is: can an undervoltage (possibly worse than the 4.5V I measured) actually break a pause, and yet let the program continue at the next line of code?

If so, take heed fellow programmers!
 
Last edited:

Mycroft2152

Senior Member
Some wall warts (cheap supplies) have a significant voltage drop under load. The specs are for a defined current draw.

Your relay is probably pulliing more current that the wal wart can handle. Check the voltage before the linear regulator with meter. You may be surprised.

Look for a wall wart with a regulated supply that you can then drop down to 5 volts with a linear regulator.

Myc
 

InvaderZim

Senior Member
Thanks for the responses; I think the problem is nicely fixed just by changing the adjustable supply to 9V (like I should have done to begin with). Heat is not an issue at all, as it turns out.

My real surprise was the fact that the symptom was an interrupted pause, with no other issues at all. Perhaps a brown-out condition will interrupt a pause?

As I said, no real issue, just an observation that I thought was worth sharing.
 
Top