backup power supply

Hi everyone,

I want to add a feature to my project, I am currently using an external power supply to power my arduino Mega, but I want to add a battery pack to kick in when the power goes out in the house, i also need some way to test when the battery pack is getting used as i would like to send an sms saying that power has gone out and the arduino is running on the batteries,

Any ideas are welcome, much appreciated :smiley:

Did you have a programming question? If not, you appear to be in the wrong place.

Well my programming question is how do I test which power supply my arduino is running off

Same way you would know the powers out :astonished:

if you place a 10 ohm resistor in series with a diode and place a op-amp on each leg of the resistor to the inputs of the opamp. the output can
go to a analog input and that will tell the arduino that the battery pack is drawing current. You will have to know the current that is being used for the other two resistors to determine gain. Google non inverting op amp circuit to determine these.

Thank you notfet, I will look into that, sounds like it can work for me