Author Topic: 0-10vdc signal into 3.3v MCU ADC  (Read 5135 times)

0 Members and 2 Guests are viewing this topic.

Offline StuntMonkeh

  • Contributor
  • Posts: 7
0-10vdc signal into 3.3v MCU ADC
« on: January 01, 2014, 02:58:07 pm »
I want to measure a dc signal from a device which outputs between 0 and 10v dc.

I assume I need to somehow rescale the signal to between 0 and 3.3v dc for the MCU ADC input to read across the range.

Ideally I need to protect the MCU from over voltage on the input also.

I have read a couple of threads (see links below) but I can't seem to figure out what I need to do.  Can someone point me in the right direction.
https://www.eevblog.com/forum/projects/protecting-adc-input-with-diode-clamp/
https://www.eevblog.com/forum/microcontrollers/robust-microcontroller-input-protection/
 

Offline gregallenwarner

  • Regular Contributor
  • *
  • Posts: 144
  • Country: us
Re: 0-10vdc signal into 3.3v MCU ADC
« Reply #1 on: January 01, 2014, 03:05:29 pm »
You need to rescale the signal using a voltage divider. Connect the 0-10v signal into the top of your voltage divider, and the center of your voltage divider into your MCU input. Choose resistance values in your divider such that 10v gets scaled down to 3.3v, for example, 6.8k for the top resistor, and 3.3k for the bottom.
« Last Edit: January 01, 2014, 03:07:02 pm by gregallenwarner »
 

Offline StuntMonkeh

  • Contributor
  • Posts: 7
Re: 0-10vdc signal into 3.3v MCU ADC
« Reply #2 on: January 01, 2014, 03:12:17 pm »
I have figured that part out but how do I then protect the MCU if the voltage goes above 10v?
 

Offline Caca

  • Contributor
  • Posts: 19
  • Country: cz
Re: 0-10vdc signal into 3.3v MCU ADC
« Reply #3 on: January 01, 2014, 03:29:43 pm »
For that you can use diode clamp to 3V3
 

Offline DrLuke

  • Contributor
  • Posts: 11
  • Country: de
    • Opensat.Space
Re: 0-10vdc signal into 3.3v MCU ADC
« Reply #4 on: January 01, 2014, 03:38:14 pm »
You could use a Zener diode to clamp the original Signal to 10V. Alternatively if your mcu has input protection and the original signal won't go into crazy high voltages, a high enough resistance in the voltage divider should do the trick aswell.
 

Offline StuntMonkeh

  • Contributor
  • Posts: 7
Re: 0-10vdc signal into 3.3v MCU ADC
« Reply #5 on: January 01, 2014, 03:53:41 pm »
The diode clamp is this isn't it?


I did find this PDF http://www.microrobotics.co.uk/doc/pdf/Sch-simple-analogue.pdf although I was rather confused what the two op-amps were doing exactly

Oh and can someone explain this photo, I was trying to understand how this method worked but the schematic is difficult to decipher from the picture.
« Last Edit: January 01, 2014, 03:56:19 pm by StuntMonkeh »
 

Online mariush

  • Super Contributor
  • ***
  • Posts: 3745
  • Country: ro
  • .
Re: 0-10vdc signal into 3.3v MCU ADC
« Reply #6 on: January 01, 2014, 04:52:38 pm »
You should read the documentation of the controller. Some pins may be 5v tolerant, but may be or not be in ADC mode.

Next, you should think about how much accuracy you need. If you use a low voltage linear regulator to get 3.3v then I guess you could use the ADC with the Vin as voltage reference.  But you may want to consider using the internal voltage reference configured to 2.048v or 2.5v.  With 2.048v voltage reference, you'd basically have 50mV steps and a division by 5 using the voltage divider giving you 0-10.25v measurement ability, and you'd still have the range between 2.048 and 3.3v as over voltage protection ( 3.3v x 5 = 16.5v)

Zener diodes would probably be the simplest method to add some protection.  Something more complex I thought of would be using a schmitt trigger in combination with a p-channel mosfet. Give the schmitt trigger the voltage through a voltage divider and configure it in such a way as to go high when voltage goes over 10.5v and low when voltage goes below 10v (or something like that).  When output is high , the p-channel mosfet breaks the connection to the adc.

Something like this is used by various overvoltage/undervoltage controllers, just google for "overvoltage p-channel mosfet" and you'll see various integrated ICs using p-channel mosfets to protect stuff.
 

Offline StuntMonkeh

  • Contributor
  • Posts: 7
Re: 0-10vdc signal into 3.3v MCU ADC
« Reply #7 on: January 01, 2014, 05:37:52 pm »
Obviously a number of ways this can be done.  Each method with advantages and disadvantages I imagine.

Thanks for pointing me in the general direction.  I will have a look at that kind of method and see if I can't get some simulations to work.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf