Programming LoRa-E5 with Arduino, LoRa-E5 mini Battery Voltage Read

The LoRa-E5 mini is designed to be battery powered, but unfortunately does not include the circuit to read the battery voltage. I implemented a battery reading circuit using the circuit in XIAO nRF52849 as a reference.
To compensate for variations in resistance or chip characteristics, I use the map() function. Since the application is monitoring battery voltage, I use a multimeter and ADC conversion values to correct for two points around 4.2V for full charge and 3.4V for the lowest voltage in use. The accuracy of the voltage is about 10mV.

Attached is a sketch I used for the correction. (12.3 KB)

When compiled with ArduinoIDE2, the hex file is created in the folder below. Select and write the file with STA32CubeProgrammer.
In case of Windows
C:\Users\username\AppData\Local\Temp\arduino\sketches\32 digit HEX string\sketchname.ino.hex
In case of Linux
/tmp/arduino/sketches/32 digit HEX string/sketchname.ino.hex

1 Like

Another Steller job :+1: , msfujino… What is with these designers making battery powered devices supposed to be suited well to wearables and you can’t read the battery level. I’m embarrassed. :face_with_peeking_eye:
Even the third Grader’s ask " what kinda battery "
such a BASIC function.?
GL :slight_smile: PJ

I like that I don’t neeed :face_with_hand_over_mouth: another processor just spitting AT’ commands.