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的更多相关文章

  1. 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 ...

  2. MCU PWM DAC OP Voltage Output

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. PWM DAC vs. Standalone

    http://analogtalk.com/?p=534 http://analogtalk.com/?p=551 Posted by AnalogAdvocate on April 09, 2010 ...

  7. PWM DAC Low Pass Filtering

    [TI博客大赛][原创]LM3S811之基于PWM的DAC http://bbs.ednchina.com/BLOG_ARTICLE_3005301.HTM http://www.fpga4fun.c ...

  8. 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 ...

  9. The Secret Mixed-Signal Life of PWM Peripherals

    The Secret Mixed-Signal Life of PWM Peripherals Pulse-width modulation (PWM) peripherals have enjoye ...

随机推荐

  1. Android手机间无线互传功能探索及实现

    年前研究了一下Android如何实现无线互传的功能,写了个小demo,最近无事,遂整理一下,与各位共享.前期调研发现,Android想要实现无线互传有以下几种技术:1,Bluetooth通行已久,简单 ...

  2. c++ 函数指针简单实例

    一开始看函数指针的时候我是很懵的,因为不知道它有什么用,之后慢慢就发现了自己的愚昧无知. 假设我们想实现一个数据结构,比如二叉搜索树,堆.又或者是一个快排,归并排序. 我们一般是直接在两个数要比较的时 ...

  3. linux(CentOS7)中安装erlang(20.3)以及rabbitmq(3.7.9)的步骤以及一些注意事项

    首先下载安装包,之后先安装erlang,安装erlang需要很多依赖,所以一步步来: 首先 wxWidgets会报错,这个不是必须的,可以不安装,不影响 然后需要安装一些必须的依赖: yum inst ...

  4. 在线建立或重做mysql主从复制架构方法(传统模式和GTID模式)【转】

    mysql主从复制架构,是mysql数据库主要特色之一,绝大多数公司都有用到. 而GTID模式是基于事务的复制模式的意思,发展到现在也是越来越多人用. 以前很多文章,介绍搭建mysql主从复制架构,是 ...

  5. (转)substring和substr以及slice和splice的用法和区别

    转载地址:https://www.cnblogs.com/echolun/p/7646025.html 那么就由一道笔试题引入吧,已知有字符串a=”get-element-by-id”,写一个func ...

  6. 【linux】sed -e 's/-//g'

    sed是用来处理文本的 s/正则表达式/替换字符串/    :表示将正则表达式的内容替换为后面的字符串 g    :表示替换全部,即如果不加g,则只会替换第一个 -e    :多点编辑(这个没懂) 例 ...

  7. Error:Makefile:452: target 'config' given more than once in the same rule

    在解压的 linux2.6.15 文件夹下 make menuconfig 的时候出现下面的错误: Makefile:452: target 'config' given more than once ...

  8. poj 1611 求0号结点所在集合的元素个数

    求0号结点所在集合的元素个数 Sample Input 100 42 1 25 10 13 11 12 142 0 12 99 2200 21 55 1 2 3 4 51 00 0Sample Out ...

  9. vue1.0到2.0

    vue1.0到2.0 vue2.0 新手教程(一)   想想自己写vue的项目也写了一年了,从vue1.0到2.0,走过不少路,填过不少坑, 下面记录一下新手从0到1的过程,本文“应该”会持续更新 首 ...

  10. 2019 CCPC wannfly winter camp Day 8

    E - Souls-like Game 直接线段树合并矩阵会被卡T掉,因为修改的复杂度比询问的复杂度多一个log,所以我们考虑优化修改. 修改的瓶颈在于打lazy的时候, 所以我们预处理出每个修改矩阵 ...