0

I want to measure the voltage battery by ADC of STM32F103C8T6 using resistor divider. When the system starts, the value from STM32 is 6.35V but when the voltage battery reaches 6.45V the value of STM32 doesn't change. I don't know about that. Please help me. Thank you so much.

enter image description here

Nayantara Jeyaraj
  • 2,624
  • 7
  • 34
  • 63
  • That LM358 opamp you're using cannot produce arbitrary voltages on its output - it can go all the way to ground, but cannot go any higher than about 1.5V below its supply voltage. Choose an opamp labelled "rail-to-rail" to avoid this limitation. Another possible problem would be configuring the ADC input to use a voltage reference other than the 3.3V power supply - that generally gives you a more accurate reading, but you can no longer read anything higher than the reference. – jasonharper Apr 03 '18 at 04:52
  • Thank you so much, May you help me to fix the problem. I will replace LM358. I chose MCP602 (rail to rail opamp) – Lành Trần Apr 03 '18 at 04:58

0 Answers0