Author Topic: Microcontroller Voltmeter  (Read 3683 times)

0 Members and 1 Guest are viewing this topic.

Offline bogdan2013Topic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ro
  • Always is someone better than you !
Microcontroller Voltmeter
« 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 .
 

Offline hammil

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Microcontroller Voltmeter
« Reply #1 on: March 30, 2013, 09:26:42 am »
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),
 

Offline bogdan2013Topic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ro
  • Always is someone better than you !
Re: Microcontroller Voltmeter
« Reply #2 on: March 30, 2013, 09:59:03 am »
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 .
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: Microcontroller Voltmeter
« Reply #3 on: March 30, 2013, 10:20:19 am »
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
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline bogdan2013Topic starter

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ro
  • Always is someone better than you !
Re: Microcontroller Voltmeter
« Reply #4 on: March 30, 2013, 11:13:42 am »
Now I understand ! I know about voltage divider . Thanks ! It work fine in ISIS Proteus 7 . I will put in practice .
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9799
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Microcontroller Voltmeter
« Reply #5 on: March 30, 2013, 05:16:58 pm »
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.
Cryptocurrency has taught me to love math and at the same time be baffled by it.
Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
BTC: 18813fu8LQEdDwH9YLM1ABed3XwCfeSeFi
 

Offline VanitarNordic

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: 00
Re: Microcontroller Voltmeter
« Reply #6 on: April 02, 2013, 10:06:40 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->