Hi Roi, hope you are fine.
Do you know haow to get battery level measure ???
Thanks in advance… best regards. Hugo.
Hi Hugo.
We have a project with LoRa in the ESP32 course that gets battery level.
You can take a look at that project here: https://rntlab.com/module-11/esp32-lora-sender-solar-powered-part-4/
You can also see our resources about that project here: https://github.com/RuiSantosdotme/ESP32-Course/tree/master/code/LoRa_Project/LoRa_Sender
I hope this helps with your project.
Regards,
Sara 🙂
If we wanted to get the battery leval as a voltage value rather than a % what should we do?
In line 133 of the code https://github.com/RuiSantosdotme/ESP32-Course/blob/master/code/LoRa_Project/LoRa_Sender/LoRa_Sender.ino you should use something as follows:
batteryLevel = map(analogRead(batteryPin), 0.0f, 4095.0f, 0, 3.3);
Instead of mapping to a range of 0 to 100, you use a range of 0 to 3.3V
I haven’t tested this, but I think it should work. However, I don’t know if it will be very accurate.
Regards,
Sara