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:
Which is later connected between the negative of a AMS1117 voltage regulator and the battery negative
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