Measure voltage of motorcycle battery which varying voltage

Electrical Engineering Asked by Cremus on December 17, 2020

I want to measure the voltage of my motorcycle battery using an microcontroller (ST32F401CE). The voltage from the battery is not a static value, since when riding, it’ll be (according to the service manual) between 13.5 and max 15.5.

The microcontroller I use has an embedded 12-bit ADC converter and the ref+ is 3.3 volt. I know I have to use a voltage divider circuit. And I calculated R1 and R2 with the formula: V1 = Vm * (R2/(R1+R2)), where V1 = 3.3, vm = 15.5, R1 = 56K and R2 = 15.148k. Of course 15.148 isn’t a valid resistor value, so I’ll use 15k which’ll give me a v1 of 3.275, which is a bit under the 3.3 ref+ voltage.

My question: Will this voltage divider circuit still work when the battery voltage changes to 13.5 volt or lower? Is the voltage divider circuit never going above the v1 value?

Programming it is no problem, since I got enough experience in that. But this is my first time making the circuit from scratch. My knowledge on voltage divider circuits is also very little. Any explanation is highly appreciated.

2 Answers

Yes this voltage divider will still work when the input voltage changes to 13.5v. You will then get 2.85V on the input to the microcontroller. I would also suggest using a voltage follower going into the microcontroller. The output of the voltage divider is going to be a fairly high impedance. You want to have a fairly low impedance in order to quickly charge the ADC sampling capacitor inside the microcontroller. D1 and D2 are optional. These are to protect the microcontroller from over voltage on the ADC pin.


simulate this circuit – Schematic created using CircuitLab

Answered by bunker89320 on December 17, 2020

It will still be valid for lower voltages. However, even if the dimensioning of the divider considers the supposed highest voltage, the charge alternator when the engine is running produces voltage spikes and it is better to add surge protection like a transient voltage suppressor or TVS.

Answered by Paul Ghobril on December 17, 2020

Add your own answers!

Related Questions

Help me interpret this audio jack schematic

2  Asked on October 29, 2021 by castle-bravo


Inductor desoldering issue

2  Asked on October 29, 2021


PT100 sensor for measuring liquid resin, fully submerged

1  Asked on October 29, 2021 by sanchit-agarwal


Summing Integrator cut off

3  Asked on October 29, 2021 by sundark12


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir