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 ...
随机推荐
- 月薪20K软件测试自动化岗必问面试题:验证码识别与处理
本文乃Happy老师的得意门生来自java全栈自动化测试4期的小核桃所作.正所谓严师出高徒,笔下有黄金~~让我们一起来征服面试官吧~~ 在做自动化测试的时候,经常会遇到需要输入验证码的地方,有些可以让 ...
- iOS动画1 — UIView动画
iOS动画基础是Core Animation核心动画.Core Animation是iOS平台上负责图形渲染与动画的基础设施.由于核心动画的实现比较复杂,苹果提供了实现简单动画的接口—UIView动画 ...
- centos6.5环境Redis下载及编译安装
centos6.5环境Redis下载及编译安装 1:官方站点: http://redis.io/download 下载最新版或者最新stable版 2:解压源码并进入目录 tar -zxvf redi ...
- MySQL乱码问题以及utf8mb4字符集
MySQL乱码问题以及utf8mb4字符集 1.乱码 推荐大家看 深入MySQL字符集设置 ,区分检查client端.server端的编码:最简单暴力的方式,是在所有的环节都显式明确的指定相同的编码, ...
- webRTC视频通话,https协议,录制端和播放端
最近做视频直播模块,在网上也看到很多大神写的代码,写的都不错,但不是我想要的,有的可能比较老,不支持https协议,有的又将直播端和显示端放在一个程序中,不利于我使用,则本篇着重添加了https协议( ...
- wpf 千位符 格式化字符串
StringFormat={}{0:N2}}//格式话字符串,增加千位符,2保留小数点后2位 StringFormat={}{0:N0}}//格式话字符串,增加千位符,无小数点后
- java 持有对象总结
java提供了大量的持有对象的方式: 1)数组将数字和对象联系起来,它保存类型明确的对象,查询对象时,不需要对结果做类型转换,它可以时多维的,可以保存基本数据类型的数据,但是,数组一旦生成,其容量就不 ...
- DateTime格式字符串HH与hh
早上写了一个关于接口的示例代码,结果发现了一个bug.接口中我内部将DateTime转化为12小时进制的字符串,这样就导致在用户没有指定小时时,不会默认写入00,而是12. 例如: DateTime ...
- DedeCMS常见问题和技巧
1: dedecms 访问空白(织梦如何显示详细错误) 我们在使用织梦的时候,有的时候会遇到访问空白的情况,尤其是再刚刚搬家之后,织梦会出现访问空白或者返给您一个500的友好界面错误,遇到这种情况该怎 ...
- prometheus的平台侧和应用侧结合,实现应用的metrics的抓取
这个细节,迷惑了我一段时间,前面也写过一篇blog,描述过这个问题. 今天看到一种更好的解决方法. 记录一下. prometheus在k8s集群里,抓取应用的metrics. 是需要平台侧和应用侧相互 ...