Pages: [1]   Go Down
Author Topic: How to find out by software that main power lost?  (Read 532 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino use 12V for main  power from power supply. To USB port just hookup +5V backup battery. So wheck when power down Arduino still working without interuption. Work fine.
But
how to find out  in my program when 12V lost (220V down)?

I know I can use any pin hookup to 12V( using resitors) and messure, but
may be more easy way to do that ?

I hope it should be like Interupt that happend when Arduino switch from one power to backup and  back
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I know I can use any pin hookup to 12V( using resitors) and messure, but
may be more easy way to do that ?

I hope it should be like Interupt that happend when Arduino switch from one power to backup and  back

Well you could wire your voltage divided 12vdc to pins 2 or 3 and write an interrupt handler?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks! I know that as I post. I'm asking may be there is a simplest way, like read some register which source is used... Or may be I'm wrong - may be proccessor don't know which source it is used.

I think this question is a common for using Arduino as a monitoring controller

Thanks!
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6106
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the simplest way to detect the power change.

The Arduino does not have built-in monitoring.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks. I'll use pin2.
Logged

Pages: [1]   Go Up
Jump to: