ESP8266 Driven Door/Window sensors

Continuing the discussion from Secure the Space when you leave!:

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.

u just solder two external pins together ( XPD_DCDC (8) pin and the ‘reset’ pin ) , and run this lua code:
node.dsleep(microSecs);

http://tim.jagenberg.info/2015/01/18/low-power-esp8266/

Would solar lights guts be suited for power? Long life (With solar charging) and the lights are cheap. (not sure if cheap enough)

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.

Hrm, so we just run our code on startup, report the state and then deep sleep it for a reasonable amount of time (10-15 minutes?) Easy.

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 :stuck_out_tongue:

1 Like

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.

1 Like

At a guess I think we need to detect somewhere in the order of … 20 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?

Would it be possible to gut a solar light from Bunnings or the like for
power?