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

Discussion in 'The Projects Forum' started by fridodido, Dec 27, 2014.

  1. fridodido

    Thread Starter New Member

    Dec 27, 2014
    18
    0
    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
     
  2. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,440
    368
    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.
     
  3. fridodido

    Thread Starter New Member

    Dec 27, 2014
    18
    0
    Thanks blocco, but setting aside the application part, cant there be a circuit which simply glows with a different color led when switched on?
     
  4. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,440
    368
    Of course but what is the controlling input voltage?
     
  5. fridodido

    Thread Starter New Member

    Dec 27, 2014
    18
    0
    5 volts and 700mA
     
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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?
     
  7. fridodido

    Thread Starter New Member

    Dec 27, 2014
    18
    0
    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
     
  8. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,440
    368
    Unless there is some way of differentiating between mains and back-up electricity, you are asking for the impossible.
     
  9. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    Do you see the illogicality there?
     
    absf likes this.
  10. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,071
    3,842
    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.
     
  11. fridodido

    Thread Starter New Member

    Dec 27, 2014
    18
    0
    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
     
  12. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,071
    3,842
    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.
     
  13. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,440
    368
    A microcontroller seems like overkill just to perform a simple toggling function.
    [​IMG]
     
  14. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,071
    3,842
    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.
     
  15. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,871
    1,394
    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.
     
    absf likes this.
  16. fridodido

    Thread Starter New Member

    Dec 27, 2014
    18
    0
    Hi tracecom,can the device have a reset button incase the circuit toggles the led color on small fluctuations ?
     
  17. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,871
    1,394
    Sure, but how will you know which is which in order to press the button?
     
  18. fridodido

    Thread Starter New Member

    Dec 27, 2014
    18
    0
    By calling one of the technicians who monitor the generator 24/7
     
  19. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,871
    1,394
    In which case, you will know whether you are on mains or generator power without the need of an LED. What am I missing?
     
  20. fridodido

    Thread Starter New Member

    Dec 27, 2014
    18
    0
    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.
     
Loading...