How Can I Ensure Voltage Isolation in My Microcontroller Circuit?

  • Thread starter Thread starter msj08
  • Start date Start date
  • Tags Tags
    Isolation Voltage
Click For Summary

Discussion Overview

The discussion revolves around ensuring voltage isolation in a microcontroller circuit, particularly in the context of protecting the microcontroller from voltage spikes while reading AC signals. Participants explore various circuit designs, components, and methods for achieving effective isolation and signal integrity.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning
  • Experimental/applied

Main Points Raised

  • One participant describes a circuit design intended to allow a microcontroller to read voltages safely, questioning the expected output waveform from an opto-isolator.
  • Another participant suggests that the bias conditions for the components may be incorrect and provides guidance on adjusting the DC offset for better performance.
  • A different participant notes that the output frequency appears to be double the input frequency, indicating a potential issue with the circuit's operation.
  • Some participants discuss the limitations of opto-isolators for precision analog signals, suggesting the use of isolation amplifiers and transformers as alternatives.
  • One participant questions the necessity of using an opto-isolator, proposing a simpler method involving a transient voltage suppressor (TVS) for protection.
  • Concerns are raised about the dangers of connecting directly to AC sources, emphasizing safety standards and regulations.
  • Another participant expresses skepticism about the effectiveness of the opto-isolator for accurately discriminating voltage levels.

Areas of Agreement / Disagreement

Participants express a range of opinions on the best methods for achieving voltage isolation and protecting the microcontroller. There is no consensus on the optimal approach, with multiple competing views and suggestions presented throughout the discussion.

Contextual Notes

Some participants assume the use of a transformer for stepping down voltage, while others question the safety and effectiveness of the proposed circuit designs. The discussion highlights various assumptions about component behavior and circuit configurations that remain unresolved.

Who May Find This Useful

Individuals interested in circuit design, microcontroller safety, voltage isolation techniques, and those exploring methods for reading AC signals in microcontroller applications may find this discussion relevant.

msj08
Messages
2
Reaction score
0
Hi, I am trying to design a circuit to keep my microcontroller safe from any sudden voltage spikes. Here is a picture of my circuit. The ac source on the left represents the Ac main voltage from the house @ 120V 60Hz stepped down to 2.5v 60Hz. The 28k resistor on the right represents the internal resistance of the microcontroller.The maximum voltage into the adc would be 10V in the μA current range.

The purpose of this circuit is to have the microcontroller read in the voltages with its onboard adc.

Right now, i am not exactly sure what the "correct" output waveform from the opto would be. I was expecting a sine wave at both the emitter and collector. The Blue waveform is Voltage taken at the emitter, green at the collector, and the sine wave is taken at the source.

Can someone please comment on my circuit design/outputs and suggest ways to make this a viable solution? Any suggestions are welcome! I am an undergrad with much still to learn! Thank You.

output.jpg

pin.jpg
 
Engineering news on Phys.org
The bias conditions seem to be wrong for these components.

If you go to the "edit simulation cmd" section and choose "DC sweep", you can sweep V1 and determine the correct DC offset for it by looking for the linear area in the graph. Sweep from -20 V to +20 V in 0.1 V steps.

The DC offset is set in the properties of V1 which you get to by right clicking on the component (as you did to set up the sinewave).

I notice that your opamp seems to have a protective diode in it across the LED, and this may explain the half wave rectifying effect.

Your micro would probably need 0 to 5 volts as its input, so that negative supply might produce negative output unless you set up the bias correctly.
 
Note output frequency is double input frequency, as if signal were full wave rectified.

Note collector and emitter are both at supply rails in vicinity of input zero crossing.

Circuit is doing just what it should - transferring current from whichever of its input LED's is forward biased to output phototransistor. When input is too near zero to make either LED conduct no transfer occurs, of course.

Are you trying to use the optoisolator as a linear device that reproduces your input signal? You might get away with it by reducing input drive and adding some DC bias so you're only using one of the input LED's .

However, what you have looks to be reproducing the peaks better than i would have imagined it could. Just it inverts half of them.

I learned something here - thanks !
 
Thanks Vk6 and Jim for the responses. We were able to come up with a solution through adjusting the DC offset and bias, thanks to your suggestions.
 
Would be interesting to apply a triangle wave drive and see what kind of linearity the thing has...
 
Opto-isolators are inconsistent, sensitive to temperature, and age. Thus, they are not well suited for communicating precision analog signals.
There is a category of off-the-shelf amplifiers that are suited to this task: Isolation Amplifiers. Generally, you also need a 2kv isolated DC-DC converter to power the AC supply. Ti, Analog Devices, and Linear Technology are good places to hunt for this type part.
Transformers are an easier way of obtaining voltage and current readings without hazard. Cheap voltage transformers do tend to distort the waveform, but one made to rectify from 230V will be less prone to error at 120 (air conditioners often use 230V - 24V).
Current transformers are also straightforward. They perform better with lower output voltage (lower output load resistor), which means you'd probably want an op amp to produce a useable signal level.

Best of luck,

- Mike
 
Why the opto? Why not just read this stepped down 2.5VAC and put a, say, 3.3V TVS across it? I presume that'll keep your micro safe?

Sorry, I don't understand the problem you seem to feel needs solving.
 
Bad, bad, very bad idea to connect to AC directly. UL devotes entire chapters on ways to NOT do this, and the NEC would never accept it either. People get hurt this way and equipment gets destroyed.
 
I was assuming a 'stepped down' 2.5V would have gone through a transformer, so no direct connection (else I'd have expected to read '2.5V from a voltage divider - is there any other way)?

Well, if not through a transformer, then that'd be the better way for isolation - use a small transformer with a 'dumb' resistive load (and the TVS) on the other side. I am not at all convinced an opto isolator is likely to give any particularly useful discrimination of voltage applied to the internal LEDs.
 
  • #10
Sorry, cmb. I'm becoming more impulsive in my old age...
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
Replies
55
Views
8K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 39 ·
2
Replies
39
Views
5K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
8
Views
4K