Author Topic: How do I measure positive and negative voltage with a microcontroller?  (Read 763 times)

0 Members and 1 Guest are viewing this topic.

Offline DegeszTopic starter

  • Newbie
  • Posts: 1
  • Country: cz
Hi, I'd like to build a DIY multimeter and I'm stuck at measuring negative voltage without blowing up my ADC.

I know I could add a DC offset so 0v would be 1/2 Vcc but that would cut my accuracy in half. Is there any other trick to do this? What method do commercial multimeters use?
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: How do I measure positive and negative voltage with a microcontroller?
« Reply #1 on: September 16, 2020, 09:59:18 pm »
Depends on the ADC. The ADC needs to have a floating or relative mode, so that the ADC ground is biased to be in the middle of the measurement range. Obviously you are going to loose resolution this way.

Commercial dmm use 'multi slope conversion' technique. The measurement is done by using an integrator which generates a linear voltage ramp - this is the 'slope' part. A counter is started at the ramp start and the ramp voltage is compared to the voltage being measured. When the voltages match, the count value is latched (this is the measured voltage value). The voltage ramp is then ramped down and the count is then checked again, this is the 'multi' bit.
 
The following users thanked this post: ledtester

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
Re: How do I measure positive and negative voltage with a microcontroller?
« Reply #2 on: September 16, 2020, 10:26:02 pm »
Maybe try a precision rectifier and a comparator to flag which way (+ or -).

EDIT: see schematic below.
« Last Edit: September 16, 2020, 11:10:16 pm by pqass »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf