You are on page 1of 3

Food Living Outside Play Technology Workshop

Analog Output - Convert PWM to Voltage


by ProvideYourOwn on August 16, 2012

Table of Contents

Analog Output - Convert PWM to Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Analog Output - Convert PWM to Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

http://www.instructables.com/id/Analog-Output-Convert-PWM-to-Voltage/
Author:ProvideYourOwn ProvideYourOwn.com
ProvideYourOwn.com is a website devoted to people who want to make their own things and provide for their own needs. We provide information,
encouragement and resources to empower people to become free from their limitations and bondage to industrialized society and its multi-national
corporations.

Intro: Analog Output - Convert PWM to Voltage


Arduino's and other microcontrollers provide analog to digital (ADC) conversion to convert an input voltage to a digital value. You might think that they also provide the
converse which is digital to analog (DAC) conversion. This is not the case. Instead they provide pulse-width modulated (PWM) outputs (see second photo). The Arduino
library provides this functionality with a function called analogWrite(). The name seems to imply DAC functionality, but it just controls the PWM output. For many
applications, such as the case of motor control, PWM is sufficient. For other applications, such as creating a linear voltage or current driver, a real DAC is needed.

Creating a real DAC


Fortunately, it is easy to convert a PWM output to an analog voltage level, producing a true DAC. All that is needed is a simple low-pass filter made from a resistor and a
ceramic capacitor. The simple RC low-pass filter shown in the third photo converts the PWM signal to a voltage proportional to the duty cycle. For the Arduino, an R
value = 3.9K and a C value = 0.1uF works well for most applications.

For more details on this subject as well as calculating R & C values more suitable for your application, please consult this article .

Was this a useful electronics tip? If so, please cast your vote for it in the Electronics Tips & Tricks Contest .
How to vote: The voting button can be found at the top of this instructable. You can also visit the contest page and vote for other instructables as well. Multiple votes can
be cast in each contest. If you see a tip you like, please show your gratitude with a vote.

Image Notes
1. Various PWM Outputs

http://www.instructables.com/id/Analog-Output-Convert-PWM-to-Voltage/
Image Notes
1. Typical filter output
2. Steady-state voltage corresponds to PWM duty cycle
3. Steady-state voltage corresponds to PWM duty cycle

Related Instructables

Arduino Electronic
Waveform Instrument by Digital to
Lo-fi Arduino Generator by amandaghassaei Arduino Timer analog. (Photos) Girino - Fast
Guitar Pedal by amandaghassaei Interrupts by by Arduino
kylemcdonald amandaghassaei Computothought Oscilloscope by
Caffeinomane

Comments
1 comments Add Comment

amandaghassaei says: Aug 16, 2012. 11:18 AM REPLY


great tip! I find myself using it often.

http://www.instructables.com/id/Analog-Output-Convert-PWM-to-Voltage/

You might also like