9/1/2023 0 Comments Esp01 deep sleepWe’ll later use this stuff for powersaving. If it’s more than 4 degrees – most likely there’s some water, right?. Water presence can be determined using water/air temperature difference. Though, I didn’t find a way to actually use it. Humidity is another metric we get for free from DHT11. I really wanted my feelings against hard sensor data. The temperature difference should theoretically match how cold ‘it feels’. We’ll need to take care of two parameters: water (ds18b20) and air (dht11) temperatures. A quick test revealed that they still had a whooping of 400mAh of capacity. Most of them were already disposed, but I had two still around. They were no way near 4000mAh as described. About seven years ago a shady Chinese vendor sold me some utter crap. Too big, judging by the looks, but who cares? The enclosure was also from the stuff I had around. I also added a 18650 cell holder and plugged a 18650 LiIon Battery there. I partially populated a board from a different project, keeping only the bare minimum: esp8266 module, 3.3 Volts DC-DC, DHT11 desoldered from a different board, but still functional and most importantly – a ds18b20 sensor on a long wire. The hardware for this project was pretty dumb. But why order when you have all the parts in stock and can just build one? And with cool features! Hard as a rock, dumb as a brick (c) The hardware The first idea was to just order a dumb water thermometer. And since the weather isn’t helping me any more, I’d have to take care and gradually decrease the temperature myself. And that meant the only thing: I had to start over again. However in November I had to pause that for a few weeks. The weather gradually lowered the water temperature for me from ‘ah, cool and nice’ to ‘Awh shit this is cold!11’. I started back in summer when it was hot as hell and went all the way through to November. I decided to try ‘cold water immersion’ practice and make it a habbit.Yep, not the cold showers, but true hardcore ‘CWI’. Time to fix that and add yet another battery optimization manual for ESP8266 to the internets.Īnd what’s the big reason? The story is simple. Yet I didn’t have a reason to get it done. Once this is all done, the program will then read the analog temperature sensor connected to A0,and post the data using data(), and goes back to sleep for another 2 minutes.It’s been a long while I wanted to check for how long can an esp8266 with esphome last on a battery supply. Then the connectToWifi() function will be called, this is the procedure that actually trying to connect to the wifi, and when success it will connect to the MQTT broker. When the ESP8266 wake up, it will need to first initialising the WiFi, initialising the connection to the MQTT host, in this case the “”. In this example we are only using the default try account, so the definition is done as below: // MQTT infoĬonst char* thehostname = "" The MQTT broker we use for this example is shiftr.io, you can get a free account with them if things are starting to get serious. In this post we will utilise the same mechanism, the ESP8266 will perform the deep sleep and only wake up every 2 minute to read the temperature and post the result to MQTT broker. In that post we discussed about how to utilise the deep sleep mode to save the power and wake up only to read temperature and post the result. This is the continuation of the previous post regarding ESP8266 Deep sleep.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |