An Isolated DAC Using PWM Output
An Isolated DAC Using PWM Output
Arduino‘s (ATmega328P) PWM outputs via analogWrite can be conveniently turned into analog voltage levels through the use of simple RC filters.
Since the PWM outputs are not isolated, using them to drive other devices directly could be potentially dangerous.
This is especially true if the target circuit uses a higher supply voltage.
Fortunately, it is quite easy to isolate the PWM output using an optocoupler.
The following schematic shows how we can build such a fully isolated DAC:

The PWM output pin from the MCU drives the emitter side of the optocoupler.
Most MCU output pins can deliver at least a few mA current so driving an optocoupler directly
via a current limiting resistor should not be an issue.
In my implementation, a 4N35 optocoupler is used, but you can pretty much use any optocouplers.
The output waveform from 4N35 is inverted with regard to the input as the optotransistor within 4N35 operates like an inverter.
The inverted PWM signal is flipped once again through the unity gain inverting amplifier.
An RC low-pass filter (R5 and C1) turns the PWM output into DC voltage
and finally this DC voltage is buffered through a voltage follower to the output.
The RC constant needs to be chosen so that it is significantly larger than the PWM interval.
The PWM frequency via Arduino’s analogWrite is roughly 490 Hz (roughly a 2 ms cycle),
and the RC constant in the example above is 100 ms, which is sufficiently large to guarantee a smooth output.
Note that the circuits on either side of the optocoupler do not have to share the ground reference as illustrated in the schematics above.
I used LM358 as the OpAmp.
Since LM358 is not a rail-to-rail OpAmp, the DAC output range is going to be limited by the supply rail.
If your application requires higher accuracy, you could either use a rail-to-rail OpAmp
or use a slightly higher voltage dual supply rail to power the OpAmp.
An Isolated DAC Using PWM Output的更多相关文章
- STM32 Timer : Base Timer, Input Capture, PWM, Output Compare
http://www.cs.indiana.edu/~geobrown/book.pdf An example of a basic timer is illustrated in Figure 10 ...
- MCU PWM DAC OP Voltage Output
- Using PWM Output as a Digital-to-Analog Converter
http://www.ti.com/lit/an/spraa88a/spraa88a.pdf http://www.ti.com/litv/zip/spraa88a The high-resoluti ...
- Make a DAC with a microcontroller's PWM timer
http://www.edn.com/design/analog/4337128/Make-a-DAC-with-a-microcontroller-s-PWM-timer Many embedded ...
- how to generate an analog output from a in-built pwm of Atmega 32AVR microcontrloller?
how to generate an analog output from a in-built pwm of Atmega 32AVR microcontrloller? you need a re ...
- PWM DAC vs. Standalone
http://analogtalk.com/?p=534 http://analogtalk.com/?p=551 Posted by AnalogAdvocate on April 09, 2010 ...
- PWM DAC Low Pass Filtering
[TI博客大赛][原创]LM3S811之基于PWM的DAC http://bbs.ednchina.com/BLOG_ARTICLE_3005301.HTM http://www.fpga4fun.c ...
- How determine the RC time constant in PWM DAC low-pass filter?
how determine the RC time constant in PWM digital to analog low-pass filter? I 'm looking for the be ...
- The Secret Mixed-Signal Life of PWM Peripherals
The Secret Mixed-Signal Life of PWM Peripherals Pulse-width modulation (PWM) peripherals have enjoye ...
随机推荐
- UVALive 6176 Faulhaber's Triangle
题目链接 http://acm.sdibt.edu.cn/vjudge/ojFiles/uvalive/pdf/61/6177.pdf 题意是 给定一个数n,代表着一共有n个人,且他们的身高从1到n ...
- redis初使用
下载地址:https://redis.io/download Redis项目不正式支持Windows.但是,微软开放技术小组开发并维护了针对Win64的Windows端口 windows版下载地址:h ...
- mybatis关联查询数据模型分析——(七)
1. 数据模型分析思路 1.每张表记录的数据内容 分模块对每张表记录的内容进行熟悉,相当 于你学习系统 需求(功能)的过程. 2.每张表重要的字段设置 非空字段.外键字段 3.数据库级别表与表 ...
- springMVC版本和jdk版本不匹配造成的问题
一个简单的例子项目,使用springMVC的版本是3.2,jdk的版本是1.7,使用的是注解的处理器适配器和处理器映射器.spring的xml配置文件中单独配置每个handler,可以正常的使用,如果 ...
- C#使用redis学习笔记
1.官网:http://redis.io/(英) http://www.redis.cn/(中) 2.下载:https://github.com/dmajkic/redis/downloads(Wi ...
- tomcat启动报错:Injection of autowired dependencies failed
tomcat启动报错:Injectjion of autowired dependencies failed 环境: 操作系统:centos6.5 tomcat: 7.0.52 jdk:openjdk ...
- linux 环境变量设置方法总结(PATH / LD_LIBRARY_PATH)
PATH和LD_LIBRARY_PATH本质都是变量,所谓变量的意思就是由别人赋值产生的,直觉往往会让我们添加和减少这个变量本身的某些路径,实际上这是不正确的.正确的做法是我们要去修改赋予这个变量数值 ...
- 【转】使用TCP协议连续传输大量数据时,是否会丢包,应如何避免?
使用TCP协议连续传输大量数据时,是否会丢包,应如何避免? 比如发送文件.记得有人提过可能会发生什么堆栈溢出.怎样避免呢?是不是可以收到数据后发送确认包,收到确认包后再继续发送.或是发送方发送了一些数 ...
- KDevelop调试NS2
1.将NS2项目导入到KDevelop 具体操作步骤:打开Kdevelop,首先,选择"Project"->"Open/Import Project".然 ...
- .NetCore下B/S结构 初探基于遗传学算法的中学自动排课走班(二)
分析下染色体基因 这里用 老师 课程 班级 教室 周天 上下晚 课时作为染色体编码我封装了如下类 /// <summary> /// NP 授课事件 由教室.课程.班级 时间片段构成 li ...