Вы находитесь на странице: 1из 4

technology

workshop

living

food

play

outside

Analog Output - Convert PWM to Voltage


by ProvideYourOwn on August 16, 2012

Table of Contents
Analog Output - Convert PWM to Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

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

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

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 Audio
Output by
amandaghassaei

Simple Wav
Player Using
Arduino by
ElecFreaks

Stereo Audio
with Arduino by
amandaghassaei

Arduino Due
Guitar ADC
Input and DAC
Output Mixer by
mdtevans

Arduino RC
Circuit: PWM to
analog DC by
DavidW10

Lo-fi Arduino
Guitar Pedal by
kylemcdonald

Advertisements

Comments
10 comments Add Comment

alan000 says:

Jan 24, 2015. 6:54 PM REPLY

Can you make it reverse. Voltage to pwm signal

Kurt E. Clothier says:

Feb 7, 2015. 1:45 AM REPLY


A simple microcontroller circuit would also be very easy to use... use the ADC to measure the analog voltage input, and adjust the output PWM duty
cycle accordingly.

Smartfelly says:

Feb 3, 2015. 5:19 AM REPLY


I believe a 555 timer would work for that. It's not as simple as this circuit. Here's an example of using it as a PWM light dimmer.
http://www.instructables.com/id/PWM-Lamp-Dimmer-using-NE555-Timer/

bdrako says:

Jul 30, 2014. 10:07 AM REPLY

Can you make it quicker? I mean can you make time necessary for capacitor to charge smaller?

AleixM says:

Dec 1, 2014. 9:29 AM REPLY

Maybe with a coil in series with the resistor and a very small cap....
Just speculating

tomas.ussing says:

Aug 29, 2014. 2:17 AM REPLY


Do remember that the 'RC-circuit" provided hereover will only provide you with a given voltaic output LEVEL, i.e. for driving a given high-impedance controller. If
you want to provide real power to your application via your "analogue" output, you will have to consider the current drawn by your load, and take that into
account when chosing resistor and capacitor -values.

deeen says:

Oct 29, 2013. 10:17 AM REPLY

Thanks a lot!!

roughly says:

Nov 28, 2012. 5:59 PM REPLY

this is gonna be super helpful -- thanx so much

YakAttack says:
Thanks for a quick and useful Ible...should be just what I need!

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

Sep 1, 2012. 5:30 PM REPLY

amandaghassaei says:
great tip! I find myself using it often.

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

Aug 16, 2012. 11:18 AM REPLY

Вам также может понравиться