Shop OBEX P1 Docs P2 Docs Learn Events
0-10 V Analog — Parallax Forums

0-10 V Analog

BAustinBAustin Posts: 1
edited 2012-10-08 00:00 in Propeller 1
Hi,

I'm a seasoned programmer with just enough knowledge of electronics to hurt myself - maybe slightly less. I'm tasked with developing a simple control device that puts out a variable 0-10 volts according to various times and conditions (think light dimmer). I've had no problems with putting together it together - the LCD output, button input for end-user programming, motion sensors, etc. ... everything but the analog output. I had early success with the AD5220 digital potentiometer, but it is limited to 5V. Is there any reason I couldn't use an LM358 op-amp with the AD5220 to get 0-10V in 0.078V increments?

Can anyone clue me into a resource that shows what this might look like and how one would control it with Spin?

Or, is there a much simpler way to accomplish this?

-Brent

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-10-05 17:12
    Brent,

    Welcome to the Parallax forum! You can ditch the digital pot, if you like. I posted a circuit for a BASIC Stamp here that was for the same kind of app as yours:

    For the Propeller, the difference would be that the input to the lowpass filter is a DUTY-mode counter output from the Prop. 2.2K and 0.1uF should work fine for the filter, instead of the higher values given for the Stamp. And the 10K:10K resistance in the output divider ratio needs to be changed to produce 10V from a constant 3.3V input instead of 5V.

    -Phil
  • ManAtWorkManAtWork Posts: 2,176
    edited 2012-10-06 08:07
    Hello Brent,

    I use this circuit:
    Prop_10Vout.png

    Then program the propeller pin as counter output in DUTY mode. The output voltage is directly proportional to the FRQx value.
    732 x 471 - 11K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-10-07 02:53
    Is there any reason I couldn't use an LM358 op-amp with the AD5220 to get 0-10V in 0.078V increments?

    A LM358 is ok except that the outputs can't swing rail to rail so the outputs will be 1.25V to about 8.75V if you run it from 10V.

    A CA3140 will swing rail to rail.

    So you can use a non inverting amplifier which is two resistors, see http://en.wikibooks.org/wiki/Electronics/Electronics_Formulas/Op_Amp_Configurations and scroll down a little for the non inverting amp. Gnd is zero volts. R2 is 3.33333 times R1 so an input of 0-3.3 V is multiplied to give 10V.

    Need a RC network on the + input of the op amp to filter the pwm. Then you can drive it directly from a propeller pin.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-10-07 10:37
    The other thing I've noticed about the LM358 is that there's a little "bump" at the crossover point when the output approaches the negative supply voltage. Also, most so-called "rail-to-rail" op amps are load-sensitive near the rails, unless they include internal voltage boost circuitry. They will operate rail to rail without a load but their output range will narrow as the load becomes stiffer.

    I like ManAtWork's circuit, BTW. Nice job! :)

    -Phil
  • ManAtWorkManAtWork Posts: 2,176
    edited 2012-10-08 00:00
    Thanks, Phil. I did a lot of trial-and-error to find the right opamp. With a 12V supply you don't actuially need rail-to-rail, only the negative rail should be included. A TLC271 can drive from 0 to 10.5V and is much cheaper than the TLC2371 which is true rail-to-rail. But we found out that the TLC271 suffers some strange latch-up behaviour if connected to a noisy load like a VFD drive. Even with protection resistors and RC filtering the output sometimes locks up to 0 or 10V until power is cycled.
Sign In or Register to comment.