summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2025-01-27 15:54:23 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2025-01-27 15:54:23 +0100
commit2d02b9ef88e4cf1374102146829ec2e816e28f02 (patch)
tree5fed066dd66c67ad27396bf005a3254d975ab813 /source
parent963ea9a575cdf12b7caf088ebe049023fa21640d (diff)
Battery measurement on the ESP32-C3-DevKit-LipoHEADmaster
Diffstat (limited to 'source')
-rw-r--r--source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst b/source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst
index caec10e..2a6b14c 100644
--- a/source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst
+++ b/source/microcontrollers/olimex-esp32-c3-devkit-lipo/index.rst
@@ -38,11 +38,21 @@ These are the settings used:
It may be necessary to bring GPIO9 to GND to force the board into
bootloader mode before loading sketches.
+Battery Measurement
+===================
+
+The battery voltage can be read on GPIO3 after closing the jumpers
+BAT_PWR_E1 and BAT_SENS_E1 with the following arduino code::
+
+ float battValue = analogReadMilliVolts(3) / 500.0 ;
+
See also
========
* `The post on my blog with the original version of these instructions
<https://blog.trueelena.org/blog/2023/04/30-programming_the_ESP32-C3-DevKit-Lipo_with_arduino/index.html>`_
+* `Explanation on battery measurements in a GitHub issue
+ <https://github.com/OLIMEX/ESP32-C3-DevKit-Lipo/issues/1#issuecomment-1486468781>`_
..
vim: set filetype=rst: