Closed DansDesigns closed 2 years ago
I don't have much knowledge of the micro you are using, but I believe you are on a 3.3V micro (so you have to use the 3300
setup vale) and your PA1 pin is correctly reporting 4850mV
(close enough to 5V).
Can't say much on library interferences, I can only say the library doesn't use timers nor interrupts, so my best guess on interference is there should be none, unless those pins share the same analog multiplexer.
Thank you for the response. I forgot to mention that the SensePin is directly connected to the Li-Po batterie's +ve... Am I correct in expecting the SensePin to be the same voltage as the Li-Po?
If this is the case, can you help me understand why the value would be close to 5v - when it should be 3.8-4.2V? Also I noticed that the value does not change as the battery drains - even though the code is in the loop in an otherwise empty sketch?
Please attach a schematics of your circuit.
it is exactly as pictured in the "lesser than 5v with voltage booster" https://github.com/rlogiacco/BatterySense#lesser-than-5v-with-voltage-booster
EDIT: with a BME280 over I2C and a nextion 2.4" Serial Display on Serial2.. all share the same 5V3A boosted power supply
Is your device a 5V or a 3.3V device? Is the battery a single cell LiPo or a two cells LiPo?
Unless you are on a 5V device and a single cell LiPo I don't see how you can measure the battery voltage because it would be above the sensing limits.
The MCU you are referring to (STM32F103C8) is a 3.3V device, meaning the highest voltage it can sense is 3.3V and, if powered from a 5V source, such 5V is stepped down to 3.3V by an onboard regulator.
The LiPo you are measuring, assuming it is a single cell, has a voltage ranging from 3.7 to 4.2 and to measure it you need a voltage divider.
Hi rlogiacco,
Sorry for the delay in responding, I have been working on other projects and see your reply..
Yes you are correct, it is a single cell LiPo giving 3.8V - 4.2V. This goes to a dc-dc converter that gives constant 5V3A output to power the STM32F103C8 and other devices..
I shall connect up a voltage divider and see what happens.
Thank you for your help
Discussed in https://github.com/rlogiacco/BatterySense/discussions/42