# Read Positive and Negative Voltage in Arduino [closed]

It's a long story, but I took apart and RC car and wanted to have the Arduino use analogRead() to get the values of my motors and steering. I have measured with my multimeter that the voltage in my remote controlled car ranges from -6v to 6v.

However, the Arduino only supports reading from 0v to 5v maximum. Is there a way to convert the -6v and +6v to 0v and 5v? I have heard that it could be done using an Op Amp. Some people have also told me to use a voltage divider. In other words, if I was not controlling the RC car, the Arduino should see 2.5 volts.

Anyways, I am not exactly clear about how I would do this. Can someone please recommend me an appropriate Op Amp with a circuit for this specific scenario?

OR, if possible, can someone show me how to read the negative and positive voltage using two Arduino pins? For example, if there is -6v given, then Analog Pin 0 would return 1023. If there is 0v given, then both Analog Pins 0 and 1 would say 0. And if there is +6v given, then Analog Pin 1 would return 1023. How can I make a circuit that will work like this?

I appreciate it if you have a circuit diagram for this. Thanks!

• When you say the RC car's output signal ranges from +6 to -6 Volts, what is this reading in reference to? What point are you applying the ground probe of the multimeter to? – Anindo Ghosh Apr 29 '14 at 5:53
• @AnindoGhosh I just took both leads of the multimeter and touched a probe to each wire of the motor. – solutionhacker Apr 29 '14 at 10:36
• Voting to close as the very premise of this question is fundamentally mistaken. What is to be read is not analog; at best it might be pulse-width digital, but really there's little point to use an Arduino to read a crude legacy RC system when you can so easily make a modern digital one using \$1 nRF24L01 type modules. – Chris Stratton Jan 2 '17 at 3:04
• Welcome to EE.SE! This appears to be a reverse engineering, modification, or repair question. Please be aware that such questions must involve specific troubleshooting steps and demonstrate a good understanding of the underlying design of the device being discussed, so that you can ask specific, focused questions that can be answered concisely. Otherwise, the question is far too broad. More information can be found here: Is asking how to fix a faulty circuit on topic?. – Dave Tweed Feb 9 at 11:56

Three standard resistors do the job, provided that the motor sees -6V referenced to ground and not referenced to the other motor terminal.

simulate this circuit – Schematic created using CircuitLab

When varying Vm from -6 to 6V, the output will vary from 0 to 4.9V.

• Ahh, you beat me to it :-) – Anindo Ghosh Apr 29 '14 at 5:59
• @AnindoGhosh sorry. Usually I make couple math errors in my calculations, but this time I succeeded first time. I leave the math for you :o) – jippie Apr 29 '14 at 6:01
• @AnindoGhosh oh and the I would't be surprised if the motor voltage is measured across the motor rather than referenced to ground, so that leaves you room for a nice answer too. Also I didn't account for PWM ... – jippie Apr 29 '14 at 6:03
• How can I calculate the resistor values, given a known input voltage? For example, I have a similar situation, but my input signal is -2 to +2 volts. This is an interesting topology, but I'd like to understand the theory behind it so I can modify it, not just copy. – robm Aug 9 '16 at 2:08
• @robm I established the ratios for the resistors first, then used some calculations in a large spreadsheet table to select the closest matching resistors. It was the use of the formulae in the spreadsheet why I didn't elaborate on the exact method which I probably should have. I suppose it is worth a question on its own: Standard method to choose resistor values for this specific use case. – jippie Aug 9 '16 at 19:52

When the motor is driven from a full H-bridge and you want your Arduino at the same ground reference as the rest of the car, then you can use the following:

simulate this circuit – Schematic created using CircuitLab

Both outputs range 0 .. 2V4, and you should set Arduino's internal reference voltage to 2V56. By attaching both outputs to their own analog input, you can calculate the motor voltage by subtracting them. The capacitors are there to average PWM signals so it can be measured by the ADC.

Here is a solution without op-amp. You will need an extra input pin at the Arduino for this one.

If the input pin reads 0 then the voltage from ADC is positive. Else the voltage is negative.

Due to the voltage drop across the bridge rectifier you solved the problem of lowering 6V to 5V. You will now have 6 - 2 * 0.7 = 4.6 V maximum. D5 is optional, and is there only for safety reasons.

The disadvantage is that the voltage must be greater than +1.4V or lesser than -1.4V to be measured.

simulate this circuit – Schematic created using CircuitLab

• You'll also need to isolate the Arduino's ground from the RC circuit. This means that they'll need separate power supplies. – DoxyLover Apr 29 '14 at 5:49