How Can I Ensure Voltage Isolation in My Microcontroller Circuit?

In summary, this circuit is designed to read in voltages from an onboard ADC, and it uses an optoisolator to rectify the input signal. The bias conditions are incorrect for the components in the circuit, and the output waveform is not what was expected.
  • #1
msj08
2
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
  • #2
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.
 
  • #3
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 !
 
  • #4
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.
 
  • #5
Would be interesting to apply a triangle wave drive and see what kind of linearity the thing has...
 
  • #6
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
 
  • #7
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.
 
  • #8
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.
 
  • #9
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...
 

FAQ: How Can I Ensure Voltage Isolation in My Microcontroller Circuit?

What is voltage isolation?

Voltage isolation is the process of separating two circuits or components to prevent electrical energy from flowing between them. This is typically achieved using an insulating material or air gap.

Why is voltage isolation important?

Voltage isolation is important for safety reasons and to prevent damage to electronic components. It also helps to ensure accurate measurements and prevent interference between circuits.

How do I test for voltage isolation?

To test for voltage isolation, you can use a multimeter to measure the resistance between two points in a circuit. If the resistance is infinite or very high, then there is good voltage isolation. If the resistance is low, then there may be leakage between the two points.

What are some common methods for achieving voltage isolation?

Some common methods for achieving voltage isolation include using optocouplers, transformers, and isolation amplifiers. These components use various techniques such as optical, magnetic, or capacitive isolation to prevent electrical energy from flowing between circuits.

What safety precautions should I take when working with voltage isolation?

When working with voltage isolation, it is important to follow standard safety protocols for working with electricity. This includes wearing protective gear, using insulated tools, and ensuring that the power source is disconnected before working on a circuit. It is also important to carefully follow the manufacturer's instructions for any isolation components being used.

Similar threads

Replies
22
Views
3K
Replies
25
Views
4K
Replies
3
Views
2K
Replies
5
Views
2K
Replies
3
Views
2K
Back
Top