To document the situation for future users, here is what I believe to be true about the ability on ESPHome to monitor battery voltage / fuel gauge on the FireBeetle 2 ESP32-C6, and to use the onboard charger to charge a 3.7 volt Li-ion battery connected to the battery connector.
-
The ADC_BAT signal, which is the battery input voltage on the battery connector, is available on AD0, which is mapped in ESPHome to GPIO0 - and passes through the onboard voltage divider before being presented on that pin. NB: there is an article in the ESPHome documentation that suggests that you should use GPIO34 for this purpose. That is not correct.
-
The ADC_BAT voltage goes through an on-board 2:1 voltage divider, so the measured voltage at pin AD0 / GPIO0 is half the battery voltage. So use something like this:
sensor:
- platform: adc
pin: GPIO0
name: "Battery Voltage"
attenuation: 12db
update_interval: 10s
accuracy_decimals: 2
samples: 30
filters:
- multiply: 2.0 # The voltage divider requires us to multiply by 2
-
The onboard voltage divider uses 1M ohm resisters. That means that the measured voltage will not be extremely accurate, but it also means that the power loss during operation is very low. When using samples = 30 and attenuation = 12db, I get a pretty stable reading using ESPHome’s built in ADC platform - but that reading is not accurate, it is low by about half a volt (maybe I am doing something wrong, but that is what I am seeing). When charging with 5 volts from USB for example, I read 4.88 volts on the battery, but the ADC reports 4.21 volts.
-
Beware that the battery connector on the board has reverse polarity from many common battery cables, such as those commonly available on Amazon. Take care to verify that you have your battery polarity correct before plugging in your battery.
-
The onboard battery charger will operate from any source of power connected to the VIN and GND pins on the board - OR from the USB port. The only requirement is that the provided voltage be at least 60 mv over the battery voltage and less than the charger’s max input voltage of 6 volts. Use a 5 volt solar panel delivering up to 1A of current.
-
While Platform.io does not include a board config for this board, PIOArduino does, and since 2024.12.0 ESPHome has been using PIOArduino under the covers. The following configuration works correctly, even though it does not appear on the official ESPHome board list (which should be updated, but has not been as of 3/9/2026).
esp32:
board: dfrobot_firebeetle2_esp32c6
variant: ESP32C6
framework:
type: esp-idf