enter image description here

I have connected ADC to the microcontroller.

The maximum ADC voltage range of microcontroller is 3.3V.

  • i want to measuring ADC input voltage in between 0V AND 3.3V

  • So when ADC voltage is greater than 3.3V should it be grounded or blocked?

  • Can anyone suggest a circuit?
  • \$\begingroup\$ A circuit is needed here to clarify the question. I read this as the ADC is connected DIGITALLY to the processor; if so, then excessive voltage into the ADC will not damage the processor, but may damage the ADC. A shunt clamp (such as a TL431) on the ADC input should fix this. The same applies if it is the processor inbuilt ADC which is the subject of the question. \$\endgroup\$ – henros Feb 11 at 11:22
  • \$\begingroup\$ Generally the datasheet specifies how much Vadc is allowed to differ from Vdd. You will get problems if the Vadc gets higher than Vdd. \$\endgroup\$ – Lundin Feb 11 at 12:30
  • \$\begingroup\$ Why not just throw a 3.4V Zener diode on the pin? You wouldn't "ground" the voltage if it passed 3.3V, just clamp it to 3.3ishV. \$\endgroup\$ – Stiddily Feb 11 at 12:40
  • \$\begingroup\$ @Stiddily Maybe because "roughly 3.4V" isn't a great voltage reference. Looking at standard zener, they don't have much in the way of voltage accuracy, and there's temperature coefficients. \$\endgroup\$ – Lundin Feb 11 at 12:58
  • 1
    \$\begingroup\$ @Stiddily Same problem if it is just an ADC input. The solution posted with 2 BAV99 + current limiting resistor is enough for the sake of protecting the port. A zener on 3.4V might go active at ~3.2V or so and then it affects valid ADC reads. \$\endgroup\$ – Lundin Feb 11 at 13:27

The STM32F0 microcontrollers have the maximum value (4096 or 1024) in the ADC when the input voltage is 3.3V, but some pins support 5V as a protection medium. The ideal is to have an input circuit that reduces the voltage, following the example of a circuit for inputs from 0V up to 5V. Note that ADC_0 is the pin of the microcontroller.

enter image description here

  • \$\begingroup\$ Is ADC_0 the ADC supply or an ADC channel? This looks like the latter, but I believe the OP is speaking of the former. \$\endgroup\$ – Lundin Feb 11 at 12:34
  • \$\begingroup\$ At any rate, you probably don't want to slaughter your ADC resolution like this, by adding that voltage divider. With standard 1% resistors, you won't get anywhere near 1024 bit resolution. \$\endgroup\$ – Lundin Feb 11 at 12:36
  • \$\begingroup\$ ADC_0 refers to analog input. I have always used this circuit because I do not need much precision in the circuit. But could you tell me a better way to do this without losing resolution? \$\endgroup\$ – Eduardo Cardoso Feb 11 at 12:41
  • \$\begingroup\$ For high resolution you would use a voltage reference IC for the ADC Vref, which is essentially a LDO with high precision. And then use high resolution resistors 0.1% or so, depending on the requirements. \$\endgroup\$ – Lundin Feb 11 at 12:49
  • \$\begingroup\$ This can be okay for monitoring a line power source, but is problematic for a battery one, which is often what people try to track with an MCU. That voltage divider with an impedance of only 14.7K will draw a fair amount of current from the battery if the device is supposed to sleep when not in active use - 224 uA is a lot compared to typical MCU deep sleep power. Just your metering thing would drain a set of AA's in about a year, even if the product itself never does any useful work. \$\endgroup\$ – Chris Stratton Feb 11 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.