Pages: [1]   Go Down
Author Topic: Light LED when supply voltage is 5V  (Read 1755 times)
0 Members and 1 Guest are viewing this topic.
Sistema solare - Terra
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Chrono251 - Stefano

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2566
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You want the same led lights up or different one?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* Voltage_detect.jpg (49.81 KB, 960x720 - viewed 53 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Sistema solare - Terra
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Chrono251 - Stefano

Sistema solare - Terra
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
« Last Edit: March 09, 2012, 01:38:16 pm by Chrono251 » Logged

Chrono251 - Stefano

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1121
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I love it when a question I have is already answered.  This forum is truly a goldmine.
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
« Last Edit: April 01, 2013, 08:27:46 am by strykeroz » Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.02 KB - downloaded 6 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1121
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1121
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* 5VswitchedPS.png (27.39 KB, 1545x1065 - viewed 21 times.)
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Pages: [1]   Go Up
Jump to: