Been kicking around some ideas for a security device at home (shed, garage, etc)
I'd like to have a Normally Open sensor trigger a ESP8266 or ESP 12 to power up and transmit a message saying the sensor has closed.
It would be powered by a 18650 battery (or similar if someone has a better idea)
I'd like to keep this as power friendly as a I can and therefore prefer not to use deep sleep.
So i'm wondering if the NO sensor can detect when the door is opened, close the circuit to supply power to the ESP. Then the ESPP can trigger a 3.3V relay or P-Channel FET to close a secondary connection. This is to make sure the door isn't opened and closed faster than I can transmit a message.
Is the 3.3V or FET the better option?
Any concerns that you see?
For security, you should have a normally closed switch that opens when the door opens (this way your sensor is also triggered when the wire is cut or so, and it's mechanically more reliable). Real security systems would constantly run a current through the wire, so they can detect tampering easily.
In deep sleep mode an ESP8266 uses 20 µA. That'd make a 2200 mAh LiPo last for over 12 years - if the battery can hold its charge that long, that is. A single WiFi connection and transmission lasting one minute, at typical power draw 100-200 mA for such a session, would use as much power as a week in deep sleep...
Have a look at this Youtube video. Seems like it matches your requirements perfectly apart from the battery type. If you insist on a bigger battery then I would suggest you either use a LiFePo (14500) battery as it can be connected directly to the ESP when fully charged but a 18650 voltage is to high (4.2V) when fully charged, or use a LDO power regulator that has an enable pin that could be connected to the reed switch.
Thank you guys. A few questions before I purchase the items for this project.
Riva,
Are the 14500 less dangerous than 18650? Honestly, I'm a bit nervous as i've seen some videos online showing explosions of 18650's.
Do the voltage regulator, did you mean something like a LM317T. or an LDO like AMS1117. (4.5V to 3.3V)
Wvmarle,
My issue would be how to keep the board alive (even in deep sleep) with a single battery for a few months? If I used a NO reed, when the circuit is closed, that could trigger the wake up, right?
That's why I was thinking a NO reed so that the circuit isn't closed (board not powered) until the reed was closed (door open)
Get a proper brand name for your LiPo batteries - the ones you see exploding are usually brandless made-in-China batteries.
You will pay 5-10 times the price of those made-in-China ones, but not only do they have much less risk of exploding (Samsung got that part wrong) they tend to have better capacity/maintain capacity/general better quality.
eeze:
Are the 14500 less dangerous than 18650? Honestly, I'm a bit nervous as i've seen some videos online showing explosions of 18650's.
I suggested the 14500 because it's fully charged voltage is 3.7V so can be connected directly to power an ESP8266 but to use an 18650 means you will also need a LDO voltage regulator (or something) to drop the voltage from a possible 4.2V down to 3.3V. The 14500 is also the same size as a normal AA battery so is a bit smaller. As this is going to be a window/door sensor you problem might be heat from the Sun cooking batteries.
Do the voltage regulator, did you mean something like a LM317T. or an LDO like AMS1117. (4.5V to 3.3V)
A low drop out regulator would be best and if it has an enable pin (something like the AP2112) then this could be where the read switch connects to. I think you could also connect a spare IO pin to this enable pin so once the ESP8266 is powered it can pull the enable pin high until it is ready to power down. Or you could just do it like in the video I linked and use the reed switch for power.
Nominal voltage of the 18650 is also 3.7V, just like the 14500. With the same battery chemistry I would expect the 14500 to also produce well over 4V when fully charged.
The LM1117 is not a good regulator for this work. Too high of a minimum drop-out: 1.1-1.2V minimum, so even a 4.3V battery is not enough for a 3.3V output, let alone if the voltage drops below 3.7V...
14500 and 18650 are battery sizes not chemistries. The voltages are determined by the chemistry, not the size. Riva was suggesting a LiFePo battery over a Li-ion because it's maximum voltage when fully charged is 3.7V. it's nominal voltage is 3.2V. Li-ion batteries have a maximum voltage of 4.2V which would require a regulator, in theory, because that's over the max rated voltage for esp8266. The nominal voltage of Li-ion is 3.7V.
The disadvantage of 14500 size is lower capacity. They seem to be around 500mAH. Seen some at 800mAH but would be doubtful about those sorts of claims. 18650 tend to be 2000-3000mAH.
I would also echo the advice already given about Li-ion and LiFePo batteries: buy only known brands like LG, Sony, Panasonic etc. Anything with "Trust" or "Fire" or "Ultra" in the name is certainly to be avoided.
I also meant to say, if buying 18650 batteries for low power projects (they are a good choice for that because of high capacity and low self-discharge) get one with the protection circuit built-in. That prevents over charging and over-discharging, which is what can lead to risk of explosion or fire. Alternatively, include a charging/discharge protection module in your design, they are cheaply available on eBay etc.