Serial Digital to Analog - Voltage Out
Thane
Posts: 4
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
·
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
·
Comments
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.
·
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