Here is a simplified description of the problem that I am trying to solve:
I need to monitor a door from my PC. The door should always remain shut. If the door was ever opened, even a little, then an alert message needs to be displayed. If the PC was not on at that time, the alert message should be displayed once the PC is turned on.
Here is how I think I can achieve this with my Arduino board:
I will use the on-chip EEPROM to store the current status of the door. As long as the door is closed, I will be getting some voltage on one input pin on the board. My program will monitor this pin. If the voltage ever goes to 0, the program will update EEPROM state.
The program also monitors input requests from the USB port. If a request comes in (from my PC-based application), the program returns the current value stored in EEPROM.
I have a number of questions on my approach. I would appreciate if you could shared with me any feedback that you may have.
Q1. Can you think of a better approach?
Q2. The door is about 20 ft away from the PC. I am thinking I will put a AA battery at the door, ground the -ve terminal and just connect the +ve terminal to the arduino pin over a long wire. This way, I can get away with just one wire instead of using two wires. Will this work?
Q3. I need to make sure that the battery to the arduino board lasts for at least 4 months. Is this possible?
Thank you in advance for your help.