I want to measure a varying voltage with an Arduino and real time data plotting has to be done.

But the supply voltage will be 10 V and the Arduino is not supposed to have more than 5 V.

Is there a way I can solve this problem? Do you have any recommendation for the circuit design?


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ use one of the ideas presented in the answers below to measure the voltage between the ground and the collector of Q1 \$\endgroup\$ – jsotola Feb 18 at 5:39
  • 5
    \$\begingroup\$ @jsotola You're explaining the whole point of Stack Exchange. "Use one of the ideas presented in the answers". Is there something I'm missing? \$\endgroup\$ – pipe Feb 18 at 9:47

Step down the voltage with a resistive divider and buffer it with an rail-to-rail input and output op-amp wired up as a voltage follower. This buffers the resistance in the resistive divider from the ADC so the divider resistance does not skew your ADC reading. This, in turn, lets you use high resistances in the divider so that the divider itself doesn't load down and skew your signal source. You always want a low output impedance going into a high input impedance so that the signal source is driven strongly and doesn't get loaded down which skews and distorts it.

In your case you have a signal source driving a resistive divider, then you have a resistive divider the ADC. THerefore, you want the resistive divider to be very high relative to your signal source's output impedance, but you also want it to be very low relative to your ADC's input impedance. Without the buffer, you have to compromise between the two. The buffer works by having a ridiculously high input impedance that the divider plugs into and has a very low output impedance that drives the ADC.

Higher resistances also reduces power consumption and heat. Using higher resistances without a buffer will also slow down the rate at which your ADC can sample and still have the reading make sense since it slows down the charging of the ADC sampling capacitor. You don't always need a buffer, but it's often a good idea.

If you do not use an op-amp with rail-to-rail input and output, then you will have to divide the voltage down more than is necessary and will not be able to make full use of your ADC's input range.

The op-amp can be a 5V one since the resistive divider, if sized properly to step down 10V, will never allow anything above 5V to enter the op-amp unless the 10V source itself becomes higher than 10V.

enter image description here

(Image source: Figure 2, Analog Mathematics - May 2009, Nuts and Volts Magazine)


You can make a voltage divider (see e.g. Wikipedia: Voltage Divider

Make sure R1 and R2 are equal, so instead of 10 V max, you get half (5V max).

Connect Vout to an analog pin from the Arduino and use analogRead to read the voltage (0-5V).

You have to make sure the resistors can handle the current.

  • 1
    \$\begingroup\$ A good resistance value to start with would be 10kΩ. This gives you 0.5mA of current across the divider. Depending on other requirements/circumstances (e.g. interference, measurement accuracy, battery run time, input/output resistance) a lower or higher value should be picked. \$\endgroup\$ – Michael Feb 18 at 10:48
  • \$\begingroup\$ @Michael Good point, thanks, this also means that the resistors will get a max of 0.5 mA * 10 V (max) = 5 mW, which is less than most resistor default of 1/4 or 1/8 W. \$\endgroup\$ – Michel Keijzers Feb 18 at 12:04

You haven't mentioned if the voltage has a common ground or 0V rail. If it has, then a divider will work fine. Else you could magnetically couple the sample using an inverter. If it's AC, then you'll need to transform it if you need isolation, or AC couple it then turn it to DC. The question is not as simple as it sounds.


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