Digital potentiometer with op amp

That's what I figured it activates a function being high or low but wasnt sure.

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?

Sorry if I'm being stupid but this is the first time I've dealt with pwm and not put it directly to and led or servo.

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...?

borillion:
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.

majenko:
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. :wink:

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. :wink:

Lefty

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. :wink:

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

borillion:
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.

Lefty

I'm using the below circuit to regulate a 220V dimmer (Eltaco SUD12). It's working fine. However, the output is not 0-10V but 0-9.4V. Does anybody have an idea how to change the circuit to deliver exactly 10V as maximum output?

It's working fine. However, the output is not 0-10V but 0-9.4V. Does anybody have an idea how to change the circuit to deliver exactly 10V as maximum output?

What is the op amp supply voltage?

You can increase this or get a better Op amp, one with rail to rail outputs.

The LM324 output can go no higher than 1.5V below the supply voltage.

Also, your two 22k resistors may be outside their range in just the right direction to get you a gain of less than 2.

Another also, the 5V in your Arduino might be a little low.

Yet another also, the output of an Arduino may not go quite to 5V with any load on it.

Simplest way to fix it? Put a 1k trimmer potentiometer between the two 22k resistors, and connect the wiper arm to the inverting input of the Op Amp.

BTW, an LM324 has four sections. You -must- connect the unused sections or they may, can, and will cause problems. Best way to connect unused sections is to connect them as noninverting buffers, ie, inverting input connected to the output, then tie the noninverting inputs to ground through a 1k resistor.

In general if you are not using a digital pot to handle an analog signal originating off-board,
you don't need the digital pot, a DAC is the simplest approach. DACs are much more
numerous and easy to source too.

I know this topic was published a while ago, but I have a question. I am fairly new to digital electronics applications and I ran into some problems for power supplies in Op-Amps. For this very operational amplifier LM 324N I am supplying 15 Volts 300 mA to pins 4 and 11 respectively. when I do that the IC is getting heated up ALOT! I have tried to create a simple voltage divider to supply 12 volts or so, but in that case the IC is not even on. How can I overcome this issue? And also polymorph mentioned that all not connected pins have to be connected, I am curious why this is.

Thank you.

Since the LM324 is rated for up to 32 V supply, the only way you can overheat it is to connect the supply backwards, or connect it to the wrong pins. Pin 4 is positive, pin 11 ground.

ArtemKuskov:
And also polymorph mentioned that all not connected pins have to be connected, I am curious why this is.

Thank you.

Because with any Op Amp sections not connected, you now have a very high gain amplifier with inputs and outputs floating around, randomly coupled to other parts of the circuit by parasitic capacitance.

They can burst into oscillation, causing... wait for it... high power consumption and heat!

Do NOT just ground them. More like this:

More information in the link:

Because the chip is madly trying to reconcile the electric field noise picked up at the two input pins with infinite gain... it's going hog wild trying to do it's job and only succeeding in getting very hot. At the very least... hook it up like a voltage follower... a no parts, but no real benefit solution.

Voltage Follower

Pin 11 needs to go to ground, not 15 V. You probably killed the chip.

If an opamp gets hot (and you're not running it at 36V), its probably damaged. They normally take
a few milliamps from the supply. They normally can only drive a few milliamps of output too, note.

Maciej:
I'm using the below circuit to regulate a 220V dimmer (Eltaco SUD12). It's working fine. However, the output is not 0-10V but 0-9.4V. Does anybody have an idea how to change the circuit to deliver exactly 10V as maximum output?

Sorry to bring up an old thread but im using the exact same circuit as you have in your picture but i'm only getting 1.5V on the output when i should be seeing 10V (5v has been applied to the input).

Has this happened to you before?

For this very operational amplifier LM 324N I am supplying 15 Volts 300 mA to pins 4 and 11 respectively. when I do that the IC is getting heated up ALOT!

That makes no sense. Did you mean GND-> pin 11, 15V -> pin 4?? Did you measure the actual current? It
should be a mA or two.

The fact it got hot means something is very wrong. Perhaps you connected it wrongly and fried it - at 15V
you don't get a second chance, transistor circuitry will usually blow instantly if misconnected.