# How do I convert voltage from 0 to 5V into -10 to 10V

Discussion in 'General Electronics Chat' started by kevin.cheung19, Nov 28, 2011.

1. ### kevin.cheung19 Thread Starter New Member

Nov 22, 2011
24
0
I want to use a microcontroller to control a motor. The output voltage that I can control from microcontroller is 0-5V, but I need to be able to input -10V to 10V analog input to the motor controller to control the speed of the motor. Is there any chip that can map a 0-5V signal into a -10V to 10V signal. I can supply a +15V and a -15V supply.

Thanks

2. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
I did almost the identical circuit for someone else awhile back.

See the attached.

• ###### 0 to 5 to -10 to 10.png
File size:
131.9 KB
Views:
630
kevin.cheung19 likes this.
3. ### kevin.cheung19 Thread Starter New Member

Nov 22, 2011
24
0
This is awesome! But I was wondering is there any pre-built IC chip that I can use here? If not, then I can build the circuit myself

4. ### JMac3108 Active Member

Aug 16, 2010
349
66
SgtWookie,

Very nice circtuit, and exactly what he needed. For anyone interested, the transfer function for his circuit is: Vout = 4Vin - 10

Try plugging in 0-5V for Vin and you'll get the same numbers that his graph shows.

One small idea to simplify the circuit ... For a non-critical application like this, why not make the 5V reference voltage with a simple voltage divider? You can increase the op-amp feedback resistors to 100K and then use 1K resistors for the voltage divider with minimal error. Resistors cost less and take up less room than a 5V linear regulator.

5. ### tgil New Member

May 18, 2011
19
4
Try looking at the Si9986 from Vishay. I have used this before for motor control using a microcontroller. You will need to use a pulse width modulated signal to control the motor speed. The overall setup is very simple. You just need the MCU, the IC, and two power supplies. A 5V supply for the MCU and a 10V supply for the motor. The H-bridge takes care of the -10V.

Good Luck

6. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
In a prior iteration, I'd used a pair of 20k resistors with a 10v source; this worked out to have minimal errors.

I like to present circuits that have very close (if not exactly) to what the inquiring member needed, in a hopefully easy-to-understand manner.

The circuit I presented does have some minor errors due to the input offsets of the two opamp channels; the left opamp would have its' input multiplied by four, the right opamp by two - and the errors are cumulative. The total error in this circuit would be somewhere around 16mV, and that will change depending on the accuracy of the 78L05; as it's error will also be multiplied.

I suppose one might use a couple of 1k resistors - or a 2k pot to provide adjustment. I like to keep resistive dividers having somewhere between 100uA and 2mA current; I more or less automatically discard values above 2mA due to excessive current. 6mA certainly would not be excessive in this case, as the idle current of a 78L05 is about that anyway.