Filtering Interference.

Thread Starter

R!f@@

Joined Apr 2, 2009
10,004
I like some suggestions on this issue.

Filter.png

Above Image is a part of trigger of a project I am working on.
Opto output is directly connected to PIC pin.
The Switch is remote. Distance may be 10 to 40 feet depending on the installation.

I like some suggestions to improve the noise rejection filter. Anything from mains induced noise to higher frequency interference. I do not have noise figure. I just like the input to be immune to 50Hz mains and motor induced interference as such.

Any Suggestions ?
 

AnalogKid

Joined Aug 1, 2013
12,128
My guess is that R3 should be in the OK1 collector. As shown, OK1 tries to short out the 5 V supply.

Separate from that, the main noise filtering action provided by OK1 is that it takes a lot more LED current to turn on its output transistor than it would take driving a 1-transistor BJT or FET inverter instead. But this can be solved with a base-emitter resistor to lower the input impedance. If the input side and output side really share a common ground, I vote for ditching the optocoupler and protecting a 1-transistor inverter with a couple of resistors and diodes.

ak
 

jpanhalt

Joined Jan 18, 2008
11,087
upload_2016-10-13_18-59-48.png

There is noway that the MCU can affect the voltage at that node nor can the optocoupler given a 5-V supply of reasonably low internal resistance. Try something like this to give a signal to the MCU:

upload_2016-10-13_19-5-55.png

John

PS: No need for a common ground, nor would I use one.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
10,004
so when the elephant stands above the trap you push the button that kills the 5V to solenoid pushing the sleeve to a CLOSE position so the spring pushes the sleeve OPEN ASAP and µ sends sms to zoo "Caught!" -- but when there is noize -- the elephant may succeed to escape
What Elephant ???
It's just a switch located else where.

@jpanhalt..The redrawn part had mistake....The Original one is ggod
Sorry Guys..:(

Below is the correct schema of that area

opto.png

I figured the opto provides a better isolation than a transistor from the PIC.
I am looking for ideas for a better approach for a RC filter.
The resistor values are chosen to keep the current at an appropriate level as the circuit will be powered 24/7.
 
Last edited:

Thread Starter

R!f@@

Joined Apr 2, 2009
10,004
Another idea is to use a 12V relay. I believe a 12V relay will be immune to all the noise, won't it and it will provide far better isolation. Something like below

Relay.png
 

drc_567

Joined Dec 29, 2008
1,156
Find a length of standard coaxial cable such as RG-50. Connect the braided shield at one end to the 12 volt supply. At the switch end, the coax shield braid is connected to one pole of the switch, and the center conductor of the coax goes to the other pole of the switch. An appropriate modification at the terminal end of the cable should yield a suitably shielded transmission line for your switching signal.
 

OBW0549

Joined Mar 2, 2015
3,566
Never underestimate the versatility of the common 555 timer. They're good for all kinds of neat things, including acting as a Schmitt trigger in this switch debouncer circuit:

debouncer.png

A 555 is perfect for this sort of thing because it's got lots of hysteresis (equal to 1/3 of its supply voltage), which gives you good noise immunity. Add a filter (R2 and C1) in front of it with a 10 millisecond time constant, and it should be immune to just about any conceivable interference short of a lightning strike. You can use a regular 555, or a CMOS TLC555, either will work.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
10,004
@OBW0549 Thanks but I do need to cut down the cost.


@joeyd999

.png

The circuit is quite simple and I believe is cheaper than my approach.
Is the transistor no. specific, I have BC639 through out the circuit. Common number costs me less than use different number transistors.
Can I use BC639 or any NPN for that matter ?
 

AnalogKid

Joined Aug 1, 2013
12,128
In the schematic in post #9 you have a steady-state on current of 9 mA. Assuming the optocoupler needs less to turn on, like 4 mA, then you need an induced current of either 4 mA or 9 mA to cause false outputs. In the post #15 schematic you need much lower error currents to cause false outputs. I suggest decreasing the 10 K pullup resistor to 1 K and adding a 1 K resistor across the 1N4148 so the transistor is harder to turn on and off. This creates an open-circuit Thevenin voltage source of 2.5 V and 500 ohms, providing almost 4 mA of base current to the transistor for a nice solid turn-on, and a much lower input impedance for the outside noise to overcome.

And just in case the outside world is *really* noisy, I'd add a second 1N4148 from the base to Vcc. One transistor, 2 identical resistors, 2 identical diodes; total less than $0.20.

OTOH, this approach never would be acceptable in the MIL rugged world because there is no explicit current limiting resistor between the input and the base, but that is more for device protection than for signal integrity.

ak
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,128
D1 is a carryover from the series base resistor case, so it could be dropped. R2 lowers the input impedance (reducing noise sensitivity) without increasing the base current to an uncomfortable level. I don't like driving small signal transistor bases with more than 5 mA, and wanted the input impedance below 1 K.

ak
 
Top