I want to make a circuit in which a bi color led changes color every time the circuit is switched on

Thread Starter

fridodido

Joined Dec 27, 2014
18
My purpose for the circuit is to detect when the electricity is coming from mains and when from power backup. The circuit will be switched on, on mains power and by default led will glow green and when electricity goes off, and then comes back on power backup, the circuit will restart but this time led will glow in red colour.Either a bi colour led could be used or one green and one red. Please help me in making a appropriate circuit

Thanks
 

blocco a spirale

Joined Jun 18, 2008
1,546
You have not provided enough information. These status signals must be derived from somewhere but without knowing anything about the back-up power source or your access to it, it is impossible for anyone to help you design anything.
 

Thread Starter

fridodido

Joined Dec 27, 2014
18
You have not provided enough information. These status signals must be derived from somewhere but without knowing anything about the back-up power source or your access to it, it is impossible for anyone to help you design anything.
Thanks blocco, but setting aside the application part, cant there be a circuit which simply glows with a different color led when switched on?
 

MikeML

Joined Oct 2, 2009
5,444
5 volts and 700mA
Is that coming from the mains, or from the backup?

Think of it like this: you want a black- box.
It has two inputs: mains and battery.
It has one output: a bicolor LED.
It has three states: mains(Green), battery(Red), or battery dead(LED OFF).

Now you must fill-in the details, like what tells us that the mains is present or not? What says that the battery has sufficient charge? What powers the black box?
 

Thread Starter

fridodido

Joined Dec 27, 2014
18
Is that coming from the mains, or from the backup?

Think of it like this: you want a black- box.
It has two inputs: mains and battery.
It has one output: a bicolor LED.
It has three states: mains(Green), battery(Red), or battery dead(LED OFF).

Now you must fill-in the details, like what tells us that the mains is present or not? What says that the battery has sufficient charge? What powers the black box?
As i live in a apartment society, the whole society shares a single power backup and thus mains and power backup come to my apartment through the same wires. So practically its not possible to independently wire the power backup to my apartment. Due to high power backup cost and no way to find out when im using power from backup I need some kind of indicator to tell me when power is coming from backup and when from mains.

Thus a two input system is not possible i thought of a device in which a led would change color(or power would be swapped between two) whenever it is powered as there is a small period of time in between mains going off and backup being started where there is a power cut(for about 30 seconds).

Please let me knowi f the above is can be made or any better system is possible.

Thanks a ton and sorry for my bad english

Edit- Also the power specification of 5 volts 700mA are from a mobile phone charger which will be connected to the power socket
 

Alec_t

Joined Sep 17, 2013
14,313
Due to high power backup cost and no way to find out when im using power from backup I need some kind of indicator to tell me when power is coming from backup and when from mains.
Do you see the illogicality there?
 

GopherT

Joined Nov 23, 2012
8,009
Y
As i live in a apartment society, the whole society shares a single power backup and thus mains and power backup come to my apartment through the same wires. So practically its not possible to independently wire the power backup to my apartment. Due to high power backup cost and no way to find out when im using power from backup I need some kind of indicator to tell me when power is coming from backup and when from mains.

Thus a two input system is not possible i thought of a device in which a led would change color(or power would be swapped between two) whenever it is powered as there is a small period of time in between mains going off and backup being started where there is a power cut(for about 30 seconds).

Please let me knowi f the above is can be made or any better system is possible.

Thanks a ton and sorry for my bad english

Edit- Also the power specification of 5 volts 700mA are from a mobile phone charger which will be connected to the power socket
You would need a Microcontroller with EEPROM. The ideas is that each time the Microcontroller turns on, it writes a flag it reads the current value of an EEPROM register and then changes that value (if it was "0" - backup, change to "1" - mains) and writes the new. Aloe to EEPROM. Then it lights the appropriate LED based on the 0 or 1.

This circuit assumes that EVERY time time the power goes out, the alternate power supply is used.

The circuit must be on all the time and you should check on a regular basis if it is in the proper state because it could happen that the same power supply comes on when power goes off.

Also, this circuit expects a zero power situation for both switch TO and FROM back-up power.
 

Thread Starter

fridodido

Joined Dec 27, 2014
18
Y

You would need a Microcontroller with EEPROM. The ideas is that each time the Microcontroller turns on, it writes a flag it reads the current value of an EEPROM register and then changes that value (if it was "0" - backup, change to "1" - mains) and writes the new. Aloe to EEPROM. Then it lights the appropriate LED based on the 0 or 1.

This circuit assumes that EVERY time time the power goes out, the alternate power supply is used.

The circuit must be on all the time and you should check on a regular basis if it is in the proper state because it could happen that the same power supply comes on when power goes off.

Also, this circuit expects a zero power situation for both switch TO and FROM back-up power.
Hey GopherT, the thing your talking about is is just what i need. Can you please tell me how to make the same

Thank You
 

GopherT

Joined Nov 23, 2012
8,009
As I said, you will need a Microcontroller - an arduino nano might be the easiest / cheapest option.

You will need to learn how to write the small scripts to read an EEPROM, write a new value and the setup the Microcontroller pin and then turn on the appropriate LED.

You will need the arduino, the USB cable, the power cord (cell phone charger), two 330 ohm resistors and two LEDS.

YOU MIGHT ALSO BE ABLE TO COAX SOMEONE INTO WRITING THE CODE FOR YOU - not me. There is enough info online to get you from zero to done in a few hours.
 

blocco a spirale

Joined Jun 18, 2008
1,546
As I said, you will need a Microcontroller - an arduino nano might be the easiest / cheapest option.

You will need to learn how to write the small scripts to read an EEPROM, write a new value and the setup the Microcontroller pin and then turn on the appropriate LED.

You will need the arduino, the USB cable, the power cord (cell phone charger), two 330 ohm resistors and two LEDS.

YOU MIGHT ALSO BE ABLE TO COAX SOMEONE INTO WRITING THE CODE FOR YOU - not me. There is enough info online to get you from zero to done in a few hours.
A microcontroller seems like overkill just to perform a simple toggling function.
 

GopherT

Joined Nov 23, 2012
8,009
A microcontroller seems like overkill just to perform a simple toggling function.
Will this be a battery operated circuit? How do you trigger it?

I used the Microcontroller so he gets the circuit board and infinite design options for about $7 on an eBay Arduino Nano clone. May seem like overkill but ultimate is cheap, fast and easy.
 

tracecom

Joined Apr 16, 2010
3,944
The issue here is that, whatever circuit you use, the LED status indicator will toggle regardless of the cause. In addition to toggling when the mains goes off and is replaced by generator power, it will also toggle for short power "flickers." Now, if there is a defined amount of time that passes between a mains failure and the generator coming on (or the reverse,) you could use a circuit that ignores any outage shorter than the changeover time. Whatever electronic solution you use will need to be battery powered unless it incorporates some non-volatile memory.
 

Thread Starter

fridodido

Joined Dec 27, 2014
18
The issue here is that, whatever circuit you use, the LED status indicator will toggle regardless of the cause. In addition to toggling when the mains goes off and is replaced by generator power, it will also toggle for short power "flickers." Now, if there is a defined amount of time that passes between a mains failure and the generator coming on (or the reverse,) you could use a circuit that ignores any outage shorter than the changeover time. Whatever electronic solution you use will need to be battery powered unless it incorporates some non-volatile memory.
Hi tracecom,can the device have a reset button incase the circuit toggles the led color on small fluctuations ?
 

Thread Starter

fridodido

Joined Dec 27, 2014
18
In which case, you will know whether you are on mains or generator power without the need of an LED. What am I missing?
You are right tracecom, but a led device will eliminate the hassle of calling the guy to ask the source of power every now and then. And also fluctuations is not a problem as i have a centralized stabilizer for my apartment.
 
Top