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. 将本地的mongodb迁移到阿里云

    首先在阿里云上安装mongodb,可以根据官方教程 https://docs.mongodb.com/manual/tutorial/install-mongodb-on-amazon/ 完成之后启动 ...

  2. 第9月第13天 传递lua匿名函数到c/c++

    1. lua函数都在refid_fun refid_fun[refid] = fun TOLUA_API int toluafix_ref_function(lua_State* L, int lo, ...

  3. Thinkpad X220 升级 Windows 10 后无线网卡消失问题

    11年购买的Thinkpad X220从Win7升级到Win10后,用着还是挺顺手的,网络显示等一切正常,直到今天合上盖子电脑睡眠以后再次打开,wifi消失不见.重启,关机再开机,都没用,只显示有线网 ...

  4. redis从入门到踩坑

    背景 Redis在互联网项目的使用也是非常普遍的,作为最常用的NO-SQL数据库,对Redis的了解已经成为了后端开发的必备技能.小编对Redis的使用时间不长,但是项目中确两次踩中了Redis的坑, ...

  5. 001_关于选中的磁盘具有MBR分区表。在 EFI 系统上,Windows 只能安装到 GPT 磁盘。问题解决

    问题: 今天我的diy电脑重装系统时,遇到了一个棘手的问题.在选择安装分区的时候,提示有这样的错误. Windows 无法安装到这个磁盘.选中的磁盘具有MBR分区表.在 EFI 系统上,Windows ...

  6. Kali Linux没有声音的解决方法

    Kali Linux系统默认状态下,root用户是无法使用声卡的,也就没有声音.启用的方法如下:         (1)在终端执行命令:systemctl --user enable pulseaud ...

  7. 钉钉机器人-实现监控通知功能-python

    1. 首先得创建有 一个 钉钉群.(因为只能发群通知) 2. 添加机器人,得到一个url: 3. 开始写Python脚本: # -*- coding: utf-8 -*- ""&q ...

  8. [java笔记]JDK的安装和配置

    1.JDK安装下载java JDK:点击下载(http://www.oracle.com/technetwork/java/javase/downloads/index.html )JDK(Java ...

  9. 详解使用 Tarjan 求 LCA 问题(图解)

    LCA问题有多种求法,例如倍增,Tarjan. 本篇博文讲解如何使用Tarjan求LCA. 如果你还不知道什么是LCA,没关系,本文会详细解释. 在本文中,因为我懒为方便理解,使用二叉树进行示范. L ...

  10. 图学ES6-2.let与const命令