opendata-stuttgart / sensors-software

sourcecode for reading sensor data
566 stars 307 forks source link

Support for battery reporting #enhancement #995

Open andygodber opened 1 year ago

andygodber commented 1 year ago

Is it possible to include code for rechargeable battery support? There are ESP8266 devices that a built-in LiPo battery carrier. Usually A0 is used to read the voltage.

pjgueno commented 1 year ago

I think there is already a branch with this. It should not be conplicated. Examples for boards?

andygodber commented 1 year ago

Many clones available. Im using a Dollatek one for something else and thought it would be a great idea.

Edit, hmm links dont seem to be working and go back into github - cut and paste ;(

https://www.amazon.co.uk/dp/B07MPB2LRT?psc=1&ref=ppx_yo2ov_dt_b_product_details

image

https://www.google.com/search?q=ESP+WROOM+02+Motherboard+Integrated+ESP8266+with+18650+Battery+Slot&rlz=1C1ONGR_en-GBGB974GB974&sxsrf=APwXEdclWAt0bJFZlXAgVDOZLvz-2wOzXQ%3A1683745337675&ei=OepbZOX1KNTZgQal44HwCg&ved=0ahUKEwil9vmVuOv-AhXUbMAKHaVxAK4Q4dUDCA8&uact=5&oq=ESP+WROOM+02+Motherboard+Integrated+ESP8266+with+18650+Battery+Slot&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQA0oECEEYAFAAWABgAGgAcAB4AIABAIgBAJIBAJgBAKABAQ&sclient=gws-wiz-serp

pjgueno commented 1 year ago

The problem is the sensor with WiFi wll consum quite a lot anyway. Maybe LoRaWAN would be better. I have some example. We would also have to count the pins.

Maybe the occasion to use the code for ESP32. Anyway where did you send the A0 value which show the level of the battery ?

andygodber commented 1 year ago

One of the WLED Usermods for battery works on this device and gave me the idea - possible make a completely wireless AQI monitor - I will also experiment with a solar charger.

A0 is connected via a 10K resistor to the big +ve pad at the end of the battery.

20230510_203148

https://github.com/Aircoookie/WLED/tree/main/usermods/Battery

pjgueno commented 1 year ago

Solar would be a good solution. https://gvidinski.wordpress.com/2021/05/10/solar-powered-nodemcu-sds011-dust-sensor/ Come on the forum. It should be possible to contact Grigori directly. He should be by V3 now.

andygodber commented 1 year ago

I have all the Solar gear ready to go - I will probably do some trials of trying to record the battery usage manually while the software is being enhanced. Problem for me is being lazy and having to go to the sensor if I place it outside to get the best solar position ;)