EEVblog® Electronics Community Forum
Electronics => Microcontrollers => Topic started by: bogdan2013 on March 30, 2013, 09:17:59 am
-
Hello all !
How I can read a external Voltage with my microcontroller (with internal ADC - Mega32) ? I need only basic circuit .
-
Well, that's dead easy. Connect your voltage to the ADC pin, read it in software, display on your 7-segment or LCD module.
However, your range will only be 0 - 5V (or 3.3V). If you go outside it, you will blow up your uC. To avoid this, you'll need to either divide it down (a 1:10 divider will allow you to measure up to 50V, but with decreased precision obviously) or design a proper automatic switching attenuator (which is not easy),
-
Yep , really easy . I can read the voltage from a pot. (from 0 -> 5000 mV - 10 bit ADC) , but the problem for me is how to read 12V .
-
And did you read the previous post completely?
Divide the voltage with a V O L T A G E D I V I D E R
http://lmgtfy.com/?q=voltage+divider (http://lmgtfy.com/?q=voltage+divider)
-
Now I understand ! I know about voltage divider . Thanks ! It work fine in ISIS Proteus 7 . I will put in practice .
-
You'll also want a low pass filter (just add a good amount of capacitance, I've had good luck with 47uF for slow DC measurement channels) and average multiple samples in software for higher effective resolution.
-
As other friends said about divider, just put one multi-turn potentiometer on input. You can adjust it easily to earn your linearity parameter, let we name it K.