Shop OBEX P1 Docs P2 Docs Learn Events
Serial Digital to Analog - Voltage Out — Parallax Forums

Serial Digital to Analog - Voltage Out

ThaneThane Posts: 4
edited 2008-09-11 20:28 in BASIC Stamp
Hello everybody. I'm looking for an easy to use device that will allow me to send digital data from a Stamp and have it converted into a voltage value between 0 and 10 volts dc.

I know someone has done this before. So instead of reinventing the wheel I was hoping someone could share their experience and knowledge on this subject.

A quad DAC with serial input and voltage output is what I'm really looking for.

Thanks again.

- Thane smilewinkgrin.gif
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-11 17:07
    There's already a wealth of information on this sort of thing.

    1) Download the "Basic Analog and Digital" tutorial from Parallax. Go to their main web page, use the Resources tab, choose Downloads, then choose Stamps in Class Downloads.

    2) Look through the Nuts and Volts Columns for the several columns on digital to analog conversion. The Nuts and Volts index is off the Resources tab.
  • ThaneThane Posts: 4
    edited 2008-09-11 18:23
    Thanks Mike for the infomration. I'll check it out.
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-11 19:08
    Most digital to analog converters operate at 3.3V or 5V. With a Stamp, you'd use a 5V device which typically produce a 0-5V output. You'd need an op-amp on the output to amplify that to a 0-10V range and the op-amp would need to operate from a 10V or 12V or higher supply voltage. The manufacturer's datasheets for many digital to analog converters often have examples of this shown.
  • LilDiLilDi Posts: 229
    edited 2008-09-11 20:28
    I have never used this before, but the PWM command is designed to output analog voltage from an I/O pin.

    Explanation
    Pulse-width modulation (PWM) allows the BASIC Stamp (a purely digital device) to generate an analog voltage. The basic idea is this: If you make a pin output high, the voltage at that pin will be close to 5V. Output low is close to 0V. What if you switched the pin rapidly between high and low so that it was high half the time and low half the time? The average voltage over time would be halfway between 0 and 5V (2.5V). PWM emits a burst of 1s and 0s whose ratio is proportional to the duty value you specify.

    The proportion of 1s to 0s in PWM is called the duty cycle. The duty cycle controls the analog voltage in a very direct way; the higher the duty cycle the higher the voltage. In the case of the BASIC Stamp, the duty cycle can range from 0 to 255. Duty is literally the proportion of 1s to 0s output by the PWM command. To determine the proportional PWM output voltage, use this formula: (Duty
Sign In or Register to comment.