Saturday 11 February 2017

AC Voltage Measurement using STM32F4

Vref = 2.95 for STM32F4 

This is the ADC voltage measurement range of STM32F4.

Step:-


1) Step down 220/230 AC Voltage with Potential Transformer ( 220/12).
2)  Divide down this voltage with resistors' combination (1% tolerance). The voltage should be less than 1V (rms). 
3) Then using 3V pin of micro-controller, divide this voltage into 1.5V dc. All we are doing this because we can't feed negative voltage to micro-controller. AC has both positive and negative components so we have to shift this voltage above 0 voltage level.
 like this:


Rest is on your Coding Skills...

How to develop code for Voltage Measurement:?

1) Configure any channel GPIO for ADC.
2) Feed input to gpio.
(continued...)