Shop OBEX P1 Docs P2 Docs Learn Events
Voltage to resistance plan. — Parallax Forums

Voltage to resistance plan.

Keith HiltonKeith Hilton Posts: 150
edited 2005-02-16 21:50 in BASIC Stamp
Jon, I think you are giving me some good advise on my quest to convert a varialble voltage to a tracking variable resistance. Jon your post basically told me to go back and work my way up through the basics.· That is exactly what I plan to do. I plan to-- not over-look the smallest detail in all the Parallax instruction books.· I am presently reading the analog---digital Parallax book now.· I have my Parallax test stuff, but I am ordering a new Board of Education today.· In the mean time Jon, see if you can figure out how·we can·get the up/down pin in a digital pot to track·analog voltage input into the Basic Stamp.· You wouldn't want me to figure it out first now would you Jon?· If I figure it out, I plan on converting it to SX where I think I can sell a lot of product for Parallax.· I sell my products all over the world.· Jon, please visit my web site at www.hiltonelectronics.com·· Jon, please e-mail me and let me know what you thought of my web site?· e-mail me at: klhilton@aol.com·· Thanks Jon.· Your friend Keith Hilton

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-02-16 20:45
    Ok second time trying to post.

    This message seems to be meant as a personal message to Jon rather than the open forum since you only seem to address Jon, but I'll answer anyways. This is already being discussed in a current thread of this forum: http://forums.parallax.com/showthread.php?p=526329

    And yes the SX would be a more straightforward method of doing this because the SX has a built-in analog comparator.

    Additionally there are two simple methods for performing DAC (which mimics the behavior of a digital pot) on an SX (or any microcontroller).

    First, you take a capacitor and ground one terminal, tie the other terminal to a resistor and the other resistor to an SX pin. Connect the node between the resistor and capacitor to the reference input of the comparator and drive the SX pin with PWM. The capacitor converts the PWM into an analog voltage which is correlated with the duty cycle of the PWM. If you need an equivalent resistance you can use the equation which governs the charging of a capacitor to calculate the charge on the capacitor and what the current flowing through·the equivalent resistor is. Then using Ohm's law, you calculate what the equivalent resistance is.

    Second method is using a R/2R ladder network which is the traditional method of performing DAC. This method requires more pins and external components, but calculation of the equivalent resistance is straightforward and simple and by using .5% or 1% tolerance resistors, a higher precision value can be obtained than the first method.

    Paul
  • achilles03achilles03 Posts: 247
    edited 2005-02-16 21:50
    Keith Hilton said...
    In the mean time Jon, see if you can figure out how·we can·get the up/down pin in a digital pot to track·analog voltage input into the Basic Stamp.· You wouldn't want me to figure it out first now would you Jon?
    Half the enjoyment of a project is understanding and solving the problem yourself.· Besides, if Jon built half of everyone's project for them, he'd need a 48 hour work day.· If you print out the datasheet, sit down, and take 30 minutes to read over the important aspects, you should understand it well.· I've skipped some parts of a datasheet before, and it's come back to bite me with needless troubleshooting (until I re-read the datasheet).

    On a side note, the real question is how fast do you need to track voltage?· (updates/sec?)· That will determine a lot about what you can and can't do.

    Dave
Sign In or Register to comment.