currently m working with a uno board & i need to know how can i add the battery for secondary power source(battery) when primary power source(AC power) is unavailable? And the power source must toogle automatically...
currently ac is connected using 12V AC-DC adapter. need solution regarding battery connection.. what should i do to to power it up automatically with battery when ac supply is not available..
The easiest root is to use a mains power supply to charge a battery and then power your circuit from the battery . You need to get the voltages correct for the battery - some types are not suitable for float charging .
If it’s not a rechargeable battery, or you can’t get that worked out , feed the battery and the charger into a pair of diodes , then power the Arduino from them ( google “diode OR gate”) , the mains derived supply needs to be at a slightly higher voltage than the battery for that to work and not discharge the battery whilst the main power is on .
Another option is to google “ups”
When using the diodes the battery supply must have lower voltage than the AC supply. I am afraid there is no simple circuit for backup voltage higher or equal to the voltage of the main power supply.