element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Open Source Hardware
  • Technologies
  • More
Open Source Hardware
Blog Very Low-Cost Pulse-Width Modulation (PWM), and Isolated Analog Measurements
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Open Source Hardware to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 24 Nov 2023 11:25 PM Date Created
  • Views 6599 views
  • Likes 13 likes
  • Comments 14 comments
  • isolator
  • pwm
  • tl494
  • isolation
  • optoisolator
Related
Recommended

Very Low-Cost Pulse-Width Modulation (PWM), and Isolated Analog Measurements

shabaz
shabaz
24 Nov 2023

This is just an ultra-quick blog post about an interesting circuit.

I wanted to be able to measure an output up to about 1kV, and so I really desired the measurement to be isolated! I also wanted it to be cheap. This blog post shows the method I won’t use in the end for my specific use case, but is still worth documenting because it could be useful for other projects that either require cheap PWM or require very low-cost isolated measurements. This method costs under £1/$1. The result is not very instrumentation-grade at this price!

The method involves converting the analog signal of interest into PWM and then using an opto-coupler to send it to the other side (where low-pass filtering can be used to get back the analog signal). PWM can be created with a ramp (sawtooth) signal connected to a comparator chip. The diagram here shows the general idea.

image

A 555 plus a transistor could be used to generate a sawtooth output. However, despite being low-cost, the 555 was missing a comparator function. Op-amps could be used, but I was curious if there was something out there already designed for PWM type of purposes.

Looking around, I realized that a super-low-cost chip already contains the oscillator and comparator! It’s the TL494 , which is an ancient chip but still used in a lot of switching power supplies. Ordinarily, the TL494 generates PWM for driving transformer windings, and the control signals arrive at op-amp inputs on the chip. However, since we are only interested in simple PWM generation, it is possible to force the op-amp outputs low, putting them out of the equation, and instead feed an analog control voltage into a pin called Feedback, as can be seen in the block diagram.

image

 (image source: Texas Instruments website)

In the circuit below (which is pretty much just the test circuit from the datasheet), resistor R2 and the connections to pins 1,2,16, and 15 are used to permanently set the op amp outputs to low.

Components R1 and C1 are used to set the sawtooth oscillator frequency; it is about 12.5 kHz with the values shown. The TL494 requires at least 7V to operate, and there is an internal 5V regulator with an output on pin 14. It is used to provide the pull-up voltage using resistor R3, for the 5V PWM output. There is a spare output which isn’t being used (the CTRL pin is used to select the single-output mode).

image

That’s it! The above circuit costs about £0.70 even in a single quantity since the TL494 is so cheap. For isolation, adding an optocoupler to the output would add another 0.20 to the cost.

image

About the only main drawback* to the circuit is that the PWM duty cycle cannot quite reach zero percent. That’s because the TL494 isn’t intended as a fully general-purpose PWM output. It is intended for power supply applications. The PWM is inhibited from reaching 0% because of a small positive voltage that is added to the input of a pin called DTC (pin 4). There is a trick to forcing the chip to output PWM down to zero percent, but it isn’t straightforward; it needs a small negative voltage applied to pin 4 (this isn’t a documented method, but it seems to work with the TL494 that I tried). Anyway, it’s not always necessary to require 0% PWM for many other applications (for instance, hobby servo control doesn’t require zero percent; by replacing R1 with 47k and C1 with 100nF, the circuit above can be used as a servo tester), so I left the circuit as it is, with just the single supply.

*Actually, another drawback is that the chip requires at least 7V. It would be nice if it operated from 5V.

Testing It

I applied known voltages at the input and measured the output duty cycle using a ‘scope. The results are in the chart below. It was fairly linear between 1V and 3.4V. From the chart, it is clear this is not an instrumentation-grade solution. Nevertheless, it could be suitable for far less demanding use cases, and as mentioned, it’s super-cheap and will provide isolation with a low-cost opto-isolator. I didn't use it in the end because the low-pass filtering has a slow response, at least tens of milliseconds for the PWM rate being used (although there are ways to reduce this). However, that would be perfectly suitable for many applications.

image

Thanks for reading!

  • Sign in to reply
Parents
  • shabaz
    shabaz over 1 year ago

    The high voltage measurement boards arrived, and I have soldered one up, to see if there are any glaring errors! Turns out there are. I'll write a separate blog so that it can be tracked outside of comments here!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • shabaz
    shabaz over 1 year ago

    The high voltage measurement boards arrived, and I have soldered one up, to see if there are any glaring errors! Turns out there are. I'll write a separate blog so that it can be tracked outside of comments here!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube