Electronicdesign 2713 Xl dc

Measure Your Floating DC Voltages

May 5, 2010
How to enable a microcontroller to measure floating dc voltages to 2% accuracy.

Transformer isolation

Rectified voltage

Measuring a floating dc voltage using a microcontroller’s analog-to-digital converter (ADC), with the dc+ to dc– ranging from 2.5 to 30 V and the low side able to float as high as 120 V above logic ground, presents a major challenge.

Connecting the dc low side to the microcontroller’s reference risks ground loops. Using a resistor divider to reduce the offset would also scale down the voltage of interest, making it difficult to read accurately. Analog isolation ICs tend to be an expensive solution.

To solve these problems, start by transformer-isolating the dc voltages (Fig. 1). Then, create an ac waveform by using a spare general-purpose I/O (GPIO) line from the microcontroller to control an optoisolator (Q1) that switches the dc on and off.

Connecting a diode (D1) in reverse bias across the transformer’s primary will suppress the inductive kickback when the optoisolator turns off. Rectifying the transformer output converts the signal back to dc. Using R2 and C1 to create a low-pass filter creates a dc voltage proportional to the original ac.

The circuit uses two additional resistors, R3 and R4, for two reasons. First, they bleed charge off the capacitor that has no other path because the ADC has a high-impedance input. Second, they divide the voltage to a level within the ADC’s range. The zener diode (Z1) provides protection for the ADC.

A few notes on transformer selection and circuit layout: To protect against the possibility that the microcontroller goes astray and leaves Q1 turned on, the transformer primary’s winding resistance should be high enough to limit the input current to a safe level. In layout, take care to allow sufficient clearance distances in the isolation areas of the transformer and the optoisolator.

Test results for this circuit show that the output is quite linear (Fig. 2). A simple linear equation in the microcontroller allows dc measurements to within 2% accuracy.

Sponsored Recommendations

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!