Hi Nordic,
I am exploring on how to use an ADC module for measuring the battery percentage for my nrf52840. I am working on the nrf connect SDK. Can anyone suggest me a sample for reading the battery percentage in the zephyr SDK?
Thanks,
Pranathi
Hi Nordic,
I am exploring on how to use an ADC module for measuring the battery percentage for my nrf52840. I am working on the nrf connect SDK. Can anyone suggest me a sample for reading the battery percentage in the zephyr SDK?
Thanks,
Pranathi
Hi Sigurd,
I can see the board compatibilities for the battery sample is only for partical_xenon and thingy52_nrf52832 but I only have nrf 52833 dk with me right now, So I tried to build with that configurations and faced errors..
Can you suggest me any sample that could be built for ntf52833 dk?
Thanks,
Pranathi
Which changes did you make to the sample?
I changed the build configuration for nrf52833 as the compatible build for it is partical_xenon and thingy52_nrf52832, I did not get any errors while building the battery sample for these two but I faced issues when I build the project with nrf52833dk_nrf52833 build configuration.
Have you added a vbatt node with voltage-divider as described in the sample documentation, and have you specified the A0 pin there? See Battery Voltage Measurement sample documentation for details.
Yeah I have added the vabtt node in by dts file and still getting errors and how & where do I specify the A0 pin I could not find about it in the link?
From the docs, I added this to the sample as an overlay:
/ { vbatt { compatible = "voltage-divider"; io-channels = <&adc 4>; output-ohms = <180000>; full-ohms = <(1500000 + 180000)>; power-gpios = <&gpio0 4 0>; }; zephyr,user { io-channels = <&adc 4>; }; };
Our nRF52840DK does not have a voltage divider to measure the power, so you will have to add this yourself and configure the overlay accordingly
From the docs, I added this to the sample as an overlay:
/ { vbatt { compatible = "voltage-divider"; io-channels = <&adc 4>; output-ohms = <180000>; full-ohms = <(1500000 + 180000)>; power-gpios = <&gpio0 4 0>; }; zephyr,user { io-channels = <&adc 4>; }; };
Our nRF52840DK does not have a voltage divider to measure the power, so you will have to add this yourself and configure the overlay accordingly