-->
Page 1 of 1

Simple door sensor

PostPosted: Fri Apr 14, 2017 4:05 am
by academo
Hello everyone,

I am new at all the electronics world and I lack of many concepts, so please bare with me if some of my questions here might look too basic or vague.

After long time trying to make the programmer work and many errors I successfully built a door sensor notifier using an ESP8266-01, I programmed the chip to connect to my WIFI network and send a GET request to my local server (RPI) and then go to deep sleep, this happens every time the chip is turned on.

Then I attached a cheap door sensor like this one: Image

Which is later connected between the negative of a AMS1117 voltage regulator and the battery negative
Image

And is connected to 4AAA Batteries.

Which means:
- When the door is open: (the sensor is open) no electricity passes to the AMS117
* When the door closes:
-> AMS1117 get current
-> ESP8266 starts and send the GET request
-> enters deep sleep mode (but remain powered)

And the cycle repeats when I open and close the door because I reset the ESP8266.

I used an AMS1117 because I understand the chip is very much sensitive to electricity changes and I wanted something steady, I don't have access to a dedicated 3.3v battery.

now my problem: the battery only last 1 week, and the sensor dies, I want to improve my battery life, here what I already did:

* I unsoldered the led from the AMS1117 chip, this gave me a boost from original ~4-5 days to 7-9 days
* I exchanged the ESP chip for one that only lights the led when network is used (so, no led always on)

I very much appreciate any advice you can give me regarding to battery life (and other possible stupid mistakes I did when building this)

Here a diagram I built with some online tool which might not be totally correct but It is only to give you an idea of what I did, I put a switch as the door sensor

Re: Simple door sensor

PostPosted: Sat Apr 15, 2017 11:56 am
by gbafamily1
The AMS1117 is draining the battery because it draws between 5-10 mA even when the ESP8266 is in deep sleep. Search this site for the word "quiescent". There is a lot of discussion on selecting an LDO with very low quiescent current.