0-10vdc signal into 3.3v MCU ADC - Page 1
Forum section: electronics / beginners

author: StuntMonkeh
author_rank: Newbie
timestamp: January 01, 2014, 02:58:07 pm
content: 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/

author: gregallenwarner
author_rank: Regular Contributor
timestamp: January 01, 2014, 03:05:29 pm
content: You need torescalethe 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.

author: StuntMonkeh
author_rank: Newbie
timestamp: January 01, 2014, 03:12:17 pm
content: I have figured that part out but how do I then protect the MCU if the voltage goes above 10v?

author: Caca
author_rank: Contributor
timestamp: January 01, 2014, 03:29:43 pm
content: For that you can use diode clamp to 3V3

author: DrLuke
author_rank: Contributor
timestamp: January 01, 2014, 03:38:14 pm
content: 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.

author: StuntMonkeh
author_rank: Newbie
timestamp: January 01, 2014, 03:53:41 pm
content: The diode clamp is this isn't it?I did find this PDFhttp://www.microrobotics.co.uk/doc/pdf/Sch-simple-analogue.pdfalthough I was rather confused what the two op-amps were doing exactlyOh 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.

author: mariush
author_rank: Super Contributor
timestamp: January 01, 2014, 04:52:38 pm
content: 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.

author: StuntMonkeh
author_rank: Newbie
timestamp: January 01, 2014, 05:37:52 pm
content: 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.