# How do I measure a voltage greater than 5 V with Arduino? [duplicate]

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

## marked as duplicate by Rev1.0, W5VO♦Feb 18 at 14:25

• use one of the ideas presented in the answers below to measure the voltage between the ground and the collector of Q1 – jsotola Feb 18 at 5:39
• @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? – 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.

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.

• 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. – Michael Feb 18 at 10:48
• @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. – 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.