Go Down

Topic: Digital potentiometer with op amp (Read 1 time) previous topic - next topic


As for the rc filter would it look something like this? Course I would be replacing Vs here with the pwm signal source and connect the end grounds to the -5V line on the wall wart Ill be using for power? Can I leave out the resistor and cap I don't understand why would need a filter?

Yes, it would look like that. You need an op amp whose input common mode voltage goes down to ground, and whose output goes close enough to ground as well. Best is a rail-to-rail op amp, but 1/2 a LM358 or 1/4 a LM324 will do if you use a 12v supply. Making Ra and Rb quite low (say 1K each) will help ensure that the output goess close enough to zero.

The RC network is needed because the dimmer expects a voltage between 0V and 10V, not a 10V PWM digital signal. Values of e.g. 10K and 22uF should be OK using the Arduino default PWM frequency.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.


Jan 18, 2013, 01:48 am Last Edit: Jan 18, 2013, 01:54 am by retrolefty Reason: 1

Just a note on your terminology...

A 5V wall wart doesn't have a -5V line.

You have a +(whatever)V connection, and a GND connection.  The same goes for the Arduino, the op-amp power supply, etc.  You have + and GND, not + and -.

For a 5V supply you have +5V and GND.  For a 10V supply, it is +10V and GND.

If you had +5V and -5V, then the difference between them would be 10V!  (ouch).

Also, I assume you have a 10V power supply to run the op-amp from?  You do realise that you can't power the op-amp from 5V and expect a gain of 2 to give you 10V out of it...?

I don't know if there is any really accurate terminology one can use with DC wall warts that doesn't either make assumptions or needs context to be understood correctly.

 Certainly a 'wall wart' type DC voltage source has both a positive and negative terminal (just like a battery) usually terminated into a coaxial DC connector, but no standard as to if center pin is positive or outer shell is positive, they come in both flavours. And one is free to connect either the negative terminal to one's circuit common and that results is a positive 5vdc available to power the circuitry, but of course there is nothing wrong with connecting the positive terminal to one's circuit common when they do require a -5vdc voltage source as for perhaps a op-amp's negative rail. But it's certainly true that a 5 volt wall wart doesn't have both a +5vdc terminal and a -5vdc terminal, at least not at the same time.  ;)

And the term 'ground' is such an overloaded term that can have several meanings and is a major pain in the butt to determine what one really means without the specific context being explained. I prefer the term circuit common or just common, over the term ground. And calling it GND is no help as that is almost impossible to pronounce. But then again I'm a crusty old hardware type that has his idiosyncrasies.  ;)



Sure a wall-wart can have both positive and negative pins!  XD  I have one originally terminated on mini-DIN with +12, -12, +5, and gro--- uh, common.  ;-)

Granted, that's not what one typically imagines when thinking "wall wart", although I think discarding preconceptions when dealing with 'warts is probably not a bad thing.  After all, is it center-positive?  Center-negative?  Regulated?  50% voltage rise under no load?  AC??

Plugging in some random black box and expecting 5.0vDC on the center pin of a barrel connector is a good way to produce magic smoke.


Thanks Guys, I got this down and understand it now!

Ill use the circuit here


Thanks Guys, I got this down and understand it now!

Ill use the circuit here

Nice drawing. You missing a series resistor wired between the PWM input and the cap and + op-amp input to form a proper low pass filter. 10K ohms should work.


Go Up