Page 1 of 3
Practical Sensor Application?
Posted:
Fri Dec 10, 2021 7:39 pm
by xytsrm
Currently experimenting with ESP-01S modules. Have had no difficulty connecting to WiFi, however there are several issues that appear to rule out it's use as a practical sensor solution. First, in active-mode connected to WiFi the unit draws 75ma, making it a battery killer; the only solution is deep-sleep. In deep-sleep the WiFi is shutdown and needs to reconnect on sensor activation; re-connection time can vary from 1.5 secs to 8 secs. When used in combination with additional similar sensor units, the variation in connection time can change the order in which the sensors are reported that is significant in determining the status of events. While it's possible to normalize unit report times to the maximum connection time that slows the overall sensor system response.
Are there any other approaches that can maintain a practical battery-life of as least 1 year, and yet maintain a WiFi connection to avoid the re-connection time overhead?
Re: Practical Sensor Application?
Posted:
Sun Dec 12, 2021 7:13 am
by rpiloverbd
You've raised a good point. Let's see if there is any feasible solution by the manufacturers.
Re: Practical Sensor Application?
Posted:
Sun Dec 12, 2021 5:46 pm
by davydnorris
There are several things that can be done:
- turn the wifi off when not using it
- use deep sleep as you said
- wake, measure, store, sleep and aggregate your measurements to send in bulk
In addition, if you're connecting to the same Wifi point each time, you can store the channel and MAC info, which greatly speeds up connection. I posted some example code in the Advanced topic that shows how to do this.
The ESP NonOS SDK does do this but it's not that efficient, so I hand rolled my own. My sensors now wake up, measure, send and sleep in 0.5 - 1.0 sec depending on the measurement.
Re: Practical Sensor Application?
Posted:
Sun Dec 12, 2021 8:25 pm
by xytsrm
The only practical solution to conserve battery is deep-sleep; even light-sleep uses too much power. In deep-sleep the WiFi is off, and the re-connection issue remains. I haven't as yet seen any solution.
davydnorris you say you can connect in 0.5 to 1.0; under what conditions, over what distance?
I need to connect to a router in the middle of my house from an outside sensor that's a least 125ft from the router; this is not line-of-sight. This is what is causing the 8 sec re-connection delay. I'm going to try a WiFi extender, or a MESH network router, which will hopefully improve things.