Power for the arduino


hello everybody,
my graduation project controlling irrigation systems automatically using soil moisture sensors 9v source adapter .. issue how can farmer (when not in farm) know if electricity went off ?

so idea plan b connect arduino source arduino charged battery arduino not use unless the electricity went off (the 9v source), use battery give time arduino send sms farmer notify him electricity went off.
i knew possible connect arduino 2 power source , use higher one.
but question is, how can write in code? meaning, change in arduino can make know source has changed ? (i mean condition in code make send sms farmer).

i hope explained enough, can understand idea , question .. please if it's still not clear tell me .. cuz need answer asap

thanks lot

just connect wall source input well. use resistor divider make 5v instead of 9v (use 2 10k resistors).

now can check if pin high or not , act upon it.


Arduino Forum > Using Arduino > Programming Questions > Power for the arduino


arduino

Comments