An Isolated DAC Using PWM Output

Source: Internet
Author: User

An Isolated DAC Using PWM Output

Arduino ' s (atmega328p) PWM outputs via Analogwrite can be conveniently turned to analog voltage levels through the use O F Simple RC filters.

Since the PWM outputs is not a isolated, using them to drive other devices directly could is potentially dangerous.

This is especially true if the target circuit uses a higher supply voltage.

Fortunately, it's 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 MCUs output pins can deliver at least a few MA current so driving an optocoupler directly

via a current limiting resistor should is an issue.

In my implementation, a 4n35 optocoupler are used, but you can pretty much with any optocouplers.

The output waveform from 4N35 are inverted with regard to the input as the Optotransistor within 4N35 operates like an inve Rter.

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 are buffered through a voltage follower to the output.

The RC constant needs to being chosen so, 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 a sufficiently output of which is large guarantee to smooth a.

Note that the circuits on either side of the Optocoupler does not has to share the ground reference as illustrated in the S Chematics above.

I used LM358 as the OPAMP.

Since LM358 is not a rail-to-rail OpAmp, the DAC output range is going to being 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.