Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to find low battery check? #113

Closed
PaekHyun opened this issue Jul 7, 2024 · 1 comment
Closed

how to find low battery check? #113

PaekHyun opened this issue Jul 7, 2024 · 1 comment

Comments

@PaekHyun
Copy link

PaekHyun commented Jul 7, 2024

It seems that the status of the battery is being checked using esp32's ADC.
However, I understand that esp32's ADC can receive input up to 3.3V.
The 18650 battery is known to have 4.2V when fully charged.
But I wonder how I can check the status of the battery.

@lmarzen
Copy link
Owner

lmarzen commented Jul 7, 2024

The firebeetle 2 esp32-e board recommended for this project uses a 1M+1M voltage divider (which divides the voltage in half) between the 4.2v lipo battery connector and the adc pin it is connected to. In the code, I adjust for this by multiplying the measured voltage by 2 to get the actual battery voltage.

https://docs.espressif.com/projects/esp-idf/en/v4.4/esp32/api-reference/peripherals/adc.html#adc-attenuation

Using an attenuation of 11db with the voltage divider on the firebeetle board gives an effective measurable voltage of 0.3v-4.9v.

@lmarzen lmarzen closed this as completed Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants