Measuring voltages becomes necessary if you are working with batteries or you want to make your own adjustable power supply.
How to measure battery voltage using microcontroller.
A 12v battery is not exactly 12v when fully charged.
The value of 10 5v is chosen for zero percent.
Can i use the formula for voltage divider in such a case i e.
The ac voltage measurement using pic microcontroller can be done using a difference amplifier or potential transformer.
In figure 1 the relationship between charge percentage and output voltage is shown.
The technique is to measure the voltage across high potential battery first than against the lower ones and negating the subsequent batteries voltage from the one at higher potential.
Microcontrollers usually don t have specific ports for measuring currents but they do have adc channels through which you can measure analog voltages of a certain range.
Well the question may sound unreasonable as long as you are not on a battery operated system.
Measuring voltage is quite easy using any microcontroller as compared to the measurement of current.
Depending on the output voltage of the battery the approximate charge of the battery can be estimated.
Hence it is required to step down the high ac voltage around 230v to 5v for measuring voltage using microcontrollers.
In this video i ll show you how you can measure current and voltage with your m.
The difference amplifier or potential transformer is used to step down the voltage and then by using analog to digital converter or rectifier the voltage.
Will the input impedance of the adc pin of my microcontroller not.
On a battery operated system the battery voltage may vary with the state of charge of the battery.
Negating 48v 36v 12v gives us battery 1 voltage.
At full charge it is closer to 12 7v.
This makes it hard to detect if there is variation in the input voltage.
Measure current and voltage using a microcontroller voltage divider acs712 ina219.
Now why would we need to measure the input voltage for a microcontroller.
For example for the above circuit the measured voltage across battery 1 is 48v and battery 2 is 36v.
This means a dc current can be indirectly measured by a microcontroller s adc channel by first converting the current into voltage.
I want to know if i can use a simple voltage divider and feed it as input to the adc pins of my microcontroller stm32l476rg in order to measure battery voltage level.
Though this method applies to any uc but in this tutorial we will learn how to measure voltage using arduino.