Pages: [1]   Go Down
Author Topic: Digital potentiometer with op amp  (Read 1552 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



Hi I'm to take a 5V 500mA power supply and pass it  through a digital potentiometer AD5235 and then step it up through an op-amp with a gain 2 to get up to 10V output and put that into voltage based meanwell dimmer controller.

I'm a little confused on how to handle grounding with this. They are circled blue. Can I "ground" the -5V from the pot, and the -10V from the dimmer and the opamp together without damaging the pot by connecting them on the power supply -5V terminal of the wall wart l'll be using?

Also I have a couple questions about the pin meanings:
WP - Optional Write Protect. When active low, WP prevents any changes to the present contents
PR - Optional Hardware Override Preset. Refreshes the scratchpad register with current contents of the EEMEM register.  PR is activated at the logic high transition.
RDY - Ready. Active high open-drain output

what is active low vs just low, why the verb active?
what do Logic high transitions and active high open-drain output mean exactly?  smiley-red

Thanks you for your help!
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are driving that from an Arduino, then there is a much simpler solution. Take a PWM output pin, pass the output through an R-C filter, then use exactly the same op amp configuration to double the output from 0->5V to 0->10V.

To answer some of your questions: "active high" means the signal does what it is supposed to so when it is HIGH (i.e. voltage neat +5V or whatever Vcc is), and doesn't when it it LOW (near 0V). Active low is the reverse. So "RDY - Ready. Active high open-drain output" means that the output is HIGH when the device is ready.

"Open drain" means that the output pulls the output low, but not high. So you need a pullup resistor to Vcc to actually get a high on the pin.

"Refreshes the scratchpad register with current contents of the EEMEM register.  PR is activated at the logic high transition." means that when this input changes from LOW to HIGH, it refreshes the scratchpad register.
« Last Edit: January 17, 2013, 07:45:18 am by dc42 » Logged

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.

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
WP - Optional Write Protect. When active low, WP prevents any changes to the present contents

That is simply bad wording in my opinion.  As already stated, the phrase "active low" means that the pin does whatever (i.e., it's active) when the input is low.  So there's no state called "active low."  There are only high and low states, and the pin's function is either activated by being high or low.  To put it one more way:  It can't be active low, it can only be activated when low.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Lefty
« Last Edit: January 17, 2013, 07:54:25 pm by retrolefty » Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure a wall-wart can have both positive and negative pins!  smiley-lol  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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Ill use the circuit here

Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: