Go Down

### Topic: Voltage amplifier (Read 4589 times)previous topic - next topic

##### Aug 29, 2011, 05:35 pm
Hi Folks,
I need a little help here on a problem that drives me crazy. It seems like it is the easiest step of my project but I don't find a solution for it. Here is the deal:

I have a +24Vdc voltage as an input and I want to control an output voltage from 0 to 10 Vdc.
From the 24V input, I regulate 5V off of it and feed a PIC16F628A. From the PIC I have a controllable voltage of 0 to 5Vdc using the PWM. Now the only thing remaining is to amplify this voltage with an operationnal amplifier with a gain of 2.
Here is my problem: I do not want to use any additional power supply to feed the op amp., I would like to use the +24Vdc I have to supply it.

Case 1: using a traditionnal amp op, I have to use a virtual ground. The problem is that the output voltage amplified will be from 0 to 10 volts in reference to the virtual ground and I need it to be in reference of the circuit ground.

Case 2: I was thinking about using a single supply op amp. Is this going to solve my problem, am I going to have a 0 to 10 volts output in reference of the circuit ground ?

Thanks a lot for your help !

#### pgmartin

#1
##### Aug 29, 2011, 06:34 pm
Do you want a variable DC voltage output? If you amplify the PWM output, you'll just have higher voltage PWM, not a variable "non pulsating" voltage.
You'll need some other electronics to get a stable voltage output. You can use a dedicated DAC IC, or R2R ladder.
If you are limited to the PWM you might start with a low pass filter to get first a stable voltage.

If you are OK with PWM, the you just need the amplification. Select and OpAmp and build a non inverting amplifier, with gain 2. There is enough info in the datasheets (in the one from National LM358 there is a nice example).
The virtual ground is not a problem. You'll get 0V out if you input 0V in.
There are many Operational amplifiers that can be powered with a 24V single supply, i.e. the LM358
The only problem is how close you want to get to 0V. You might be selecting the OpAmp based on this.
Hope this helps.

#2
##### Aug 29, 2011, 06:46 pm
You're right, I am looking for a stable variable DC voltage output. If PWM does not work, I will use the micro + a digipot, I guess that should work as well.

As far as the virtual ground, if I feed the OpAmp (Which needs -5V / +5V for instance) with 0 and 10Vdc, it means my virtual ground will be at +5Vdc in reference of the circuit ground. So if I have 0V input, I will have 0V output in reference of the virtual ground, meaning +5Vdc in reference of the circuit ground ?? Or am I missing something ?

I do not need to get to close to 0 (A variable output of 0.5V to 10V is fine as well)

#### pgmartin

#3
##### Aug 29, 2011, 07:49 pmLast Edit: Aug 29, 2011, 08:06 pm by pgmartin Reason: 1
Quote
If PWM does not work

PWM will need to be filtered. And that is not an easy thing if you want a clean result (at least with my little experience  )

Quote
I will use the micro + a digipot, I guess that should work as well.

It will work. Also a dedicated DAC will.This is a matter of resolution. For instance, if you use a 256 step digipot as a voltage divider between 10V and 0V, each step will represent 10V / 256 = 39mV

Quote
I do not need to get to close to 0 (A variable output of 0.5V to 10V is fine as well)

Then use a single supply OpAmp, like the cheap and popular LM358. You will source it with 24V and ground (No need of + and - Vin) and build a non invertig amplifier with a gain of 2, problem solved.

#### MarkT

#4
##### Aug 29, 2011, 07:54 pm
You can convert a PWM signal to analog by low-pass filtering - the simplest being a single RC stage.  You will have a slower response to change though, should that matter.  Knowing what the ultimate load for the 0..10V signal was would help decide a good way to drive it.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#5
##### Aug 29, 2011, 08:17 pm
Guys,
Thanks for your precious help, I think will go with the PIC + Digipot + LM358 and see how it works !

#### pgmartin

#6
##### Aug 29, 2011, 08:21 pm
The 358 might not even be necessary, depending on the digipot you use, and how you use it. As MarkT said, we need to know a little bit more about the use of this output to be able to help more.

#7
##### Aug 29, 2011, 10:06 pm
The digipot I was willing to use is an AD5220. The 0 to 10 volts actually controls a motor. A low response time should not be a problem. The ultimate goal of this is to control a motor from a computer. This is done using a serial communication between the PC and the microcontroller (for instance, I will press '+', and the motor will run a bit faster or '-' to decrease the speed).

That is pretty much all the information I have.

#### pgmartin

#8
##### Aug 29, 2011, 10:24 pm
There is a big chance that a motor can work with PWM. And I don't think that resolution is a problem in that kind of application, does it?

Be carefull with the digipots, as far as I now, they cannot drive as much current as regular mechanical potentiometers. You'll need some further electronics there.

#### MarkT

#9
##### Aug 30, 2011, 05:48 pm
Quote
The 0 to 10 volts actually controls a motor

Control could mean its a low-level signal to a motor controller unit, or it might mean the voltage direct into the motor terminals - we need to know this kind of details to be able to say anything useful.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### lemming

#10
##### Aug 31, 2011, 02:06 pm
You would be better off using a logic level FET with the gate directly connected to your PWM pin.
There's a range of MOSFETS that cost a couple of dollars that would easily handle the voltages and currents that the motor would draw. The circuit will be a lot simpler too.