Light LED when supply voltage is 5V

Hi!
I'm building a stabilized power supply for a small device I'm making with an LM2576. The power supply part is already done but I would like to indicate if an undervoltage/overvoltage condition exists.

I found online some circuits using a transistor and some more components to light an LED when voltage falls below a threshold, and that works too (this one: http://i49.tinypic.com/2q2pspk.jpg - posted here http://forums.modretro.com/viewtopic.php?f=7&t=3640).

The problem I'm trying to solve is that I would like to light an LED only if the voltage is more or less 5V (eg +-0.5V). It is ok to do the opposite: I know how to light an LED when voltage is below 4.5V, but I don't know how to do the same when voltage is greater than 5.5V.

Thanks for the help!

You want the same led lights up or different one?

You could do something like this assuming you have a higher voltage that you are regulating down.

Ehi thanks for the schematic!
I'll try it later on today, I think that's exactly what I was looking for.

The circuit works perfectly! Thank you very much.

It will be powered by a 12V deep cycle battery.
I added an undervoltage lockout protection circuit (taken from the LM2576 datasheet) to power the step-down circuit only when supply voltage is greater than 7V (min input voltage for the LM2576).

I used a 680 ohm resistor in series with D1, so that the LED draws 10mA. Instead of resistor+diode for D2 and D3 I used two 2K2 ohm resistors, in order to light the "good voltage" LED only when voltage is within parameters.

EDIT:
Instead of the 2 pots, I used 2 voltage divider circuits. I had to round the values to acceptable levels, in particular because the input is not stabilized (it goes from 12.7 when battery is fully charged to about 11.7V when under heavy load).

Cool.
You can just leave off the extra LEDs & resistors altogether if you are not using them.
Glad you were able to find resistor values that have created voltages in the range you needed.

I love it when a question I have is already answered. This forum is truly a goldmine.

CrossRoads:
You can just leave off the extra LEDs & resistors altogether if you are not using them.

Bob thanks for posting the schematic. I'd like to use all 3 LEDs in your original design with a 12V input and 5V Vsource as per the OP. I'm also thinking an audible alert with a piezo on overvoltage will also be sensible, though I'm not sure an ATmega etc will hold on for too long in that condition (but at least I'll have a buzzer telling me why it died).

Not wanting to mess this up, what voltages should I expect as "High" at pins 1 & 7? Is it 12V in both cases? Sorry for the newbie question and please feel free to aim me at something that explains the LM358 in simple terms if you know such a resource.

Thanks
Geoff

Wow, post from the past!
If the opamp is powered from 12V, then the outputs will swing pretty close to Gnd & ~10.5V (Vcc - 1.5V) since there's no negative feedback.
Re: LM358: if + input is > - input, the output goes high. If- input is > + input, the output goes low. Pretty simple.
Size your load resistors for <=10mA of current.

LM358A.pdf (156 KB)

Thanks Bob - glad I asked. I'd never have found that detail (and still haven't!) in the datasheet you attached.

Very much appreciate your words of wisdom, cheers ! Geoff

Hi guys

One more question - I'm very close to exporting the gerber file and getting a board made when I realise I've (on autopilot almost) dropped a decoupling 0.1uF cap between pin 8 VCC on the LM358 and GND.

It's C2 on the attached.

Is there any downside with doing that?

Thanks
Geoff