Using Optoisolators

Thread Starter

signalflow

Joined Mar 12, 2014
50
I even replace T12 with an optoisolator and used an external power supply to drive the relay so the power supplies on both sides of the optoisolator are isolated in addition to the control signal (digitalout0). I still get noise when I turn the fan on/off with the manual switch or by turning the relay on/off. I cannot figure out how the noise is getting in. I ran the power supply for the microcontroller through a battery UPS backup and I ran the power supply for the relay side to a separate wall outlet so that noise couldn't get getting through the power lines.
 

Thread Starter

signalflow

Joined Mar 12, 2014
50
OK, I left the optoisolator in. I had 2 oscope probes not connected except their ground was connected to the board gnd. Oscope was plugged into same power strip as fan power was plugged into. I disconnected oscope probes and can turn the fan on/off with very little noise now and also switch the relay.

Now I just have to remove the optoisolator and the 2nd power supply and get it to work. But it seems that maybe noise can get onto the gnd line from the fan switching.
 

MaxHeadRoom

Joined Jul 18, 2013
28,688
Something does not add up, it is no consolation I know, but I have been installing low voltage & P.C. based industrial controller for some years now and never had any problems such as this.
If you control a less noise prone device such as a incandescent lamp, do you still get the same problem?
Max.
 

Thread Starter

signalflow

Joined Mar 12, 2014
50
I kept optoisolator and removed external power supply that was on relay side of opto. Now I am using the same power supply on both sides of opto. The noise is better than before but still get glitches every once in a while.

Possibly I am updating LCD too often and need to only update when absolutely necessary. Currently I am updating LCD every 10 ms or so.
 

Thread Starter

signalflow

Joined Mar 12, 2014
50
Not seeing any noise when switching a lamp.

Something does not add up, it is no consolation I know, but I have been installing low voltage & P.C. based industrial controller for some years now and never had any problems such as this.
If you control a less noise prone device such as a incandescent lamp, do you still get the same problem?
Max.
 

MaxHeadRoom

Joined Jul 18, 2013
28,688
It seems to me to be a problem when you switch the relay using an inductive load, what I would do is use a 2n7000 to switch a MOC3040/1, zero cross triac opto and use it to switch a triac, this way you eliminate the switching noise altogether.
If these are shaded pole motors they should not radiate any noise to speak of when running, only when switching.
Max.
 

Thread Starter

signalflow

Joined Mar 12, 2014
50
The LCD has a power down pin !PD that was just tied to a microcontroller pin. If the !PD pin goes low then the LCD powers down and freezes the display. I put a pull-up resistor of 1Kohm between !PD and 3.3V today. This helped a lot.

I also put 200uF between 5V and GND and another 200uF between 3.3V and GND.

These 2 things have helped a lot. Not having quite as many noise problems now with the LCD.

However, if I disconnect the fan from the relay, and just plug it into the power strip that the board is plugged into (so only input to the board is the power), and I turn the fan on/off with the manual fan switch, then I can see noise on the oscope on the all of the traces on the board. So noise spikes are getting in through the power supply. The power supply is a 120VAC to 24VAC transformer, then LC filter, then rectifier then voltage regulators (5V and 3.3V).

Another weird thing is if I hook the o-scope probe ground to the board ground, then I get lots of noise and LCD glitches. I get almost none when I disconnect the probe ground from the board ground.

Update: did more testing...the oscope probe really lets noise into the system somehow...even just connecting the probe ground to board ground.
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
28,688
Keep in mind that your 'scope probe is most likely at earth ground potential.
Although it seems you are having unusual problems from a circuit of this kind, it appears to confirm that going the zero switch opto and triac route might be the answer, especially if occurring at switch on/off times.
Max.
 
Top