So the cheapest esp8266 chips I can find are $3.60 a piece (ex shipping), or we can get the ESP07 for $2.70USD (3.62AUD).
This leaves us with $1.40 for power. If we reuse the 12v cells from the existing door sensors and a $1 switching power reg that might work.
But we’re going to have to do some voodoo to keep the 8266 in sleep mode, triggering a status update only when the reed switch status changes, possibly using the power-down pin on the 8266.
Not entirely sure. The esp8266 runs on 3.3v, so you might need the ones with the two AA cells in it.
According to some quick research, the XPD_DCDC pin appears to be connected to GPIO16 in the ESP-07 board. So we can do deep sleep. I’m guessing we just break the connection between the two temporarily to wake it up?
no need to do electrical wakeup by disconnecting the pins or anything. the watchdog timer ( which is the only thing left running when in deep sleep ) twiddles the gpio after it timesout, and “wakes” the esp8266 after a suitable elapsed time by resetting it.
To catch an offending window which is opened and closed quickly, for lets say ‘non member entry’, more frequent sensing would be necessary.
Perhaps waking every 2 seconds and only reporting every 5-10 min if not opened? Open state would be reported immediately upon open but then every 5-10 min if not changed? The micro is only awake for a few cycles to check pin state and time before back to have a snooze so it wont be significantly more power hungry than checking and reporting every 5 - 10 min.
the timer, at a guess, should probably be the time it takes to walk from the closest window to the door, to the door. ie enough time to sense it unlocked and bring a nice red light up for them to see.
if we want to detect entry, we can use the existing sensors for their stated purpose with the alarm system, haha
If we have 0.5$ more budget, we can put ESP8266 into deep sleep mode infinitely and wake it up by a vibration sensor wired from GND to RST. hence we don’t need to worry about the sleeping time and battery issue any more.
Well, I can donate the vibration sensors if we have less than 5 windows.
Planing some chips from China. And have put the vibration sensors in my cart. Please let me know if there are any cargoes on your wish list and need a lift (ESP8266?). Hope to get the pack within 2 weeks.
BTW. Is there any existing method to detect the open/close/lock state of the windows?