Filtering Interference.

Discussion in 'General Electronics Chat' started by R!f@@, Oct 13, 2016.

  1. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    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 ?
     
  2. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    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
     
  3. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,699
    905
    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.
     
  4. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    If the 12 V and 5 V supplies already are common-grounded somewhere else, he might not have any control over the input grounding.

    ak
     
  5. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    I don't know what the native language of Estonia is, but I think you need better translation software.

    ak
     
  6. SLK001

    Well-Known Member

    Nov 29, 2011
    819
    229
    Tightly twisting the wire going to the switch will greatly help with noise reduction.
     
  7. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    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: Oct 14, 2016
  8. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    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
     
  9. drc_567

    Member

    Aug 23, 2016
    82
    9
    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.
     
  10. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    Coax is not an option
     
  11. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,320
    889
    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.
     
    Sinus23, ci139 and R!f@@ like this.
  12. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,689
    2,750
    Or, you could throw away all the complexity and try this.
     
    R!f@@ likes this.
  13. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    @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 ?
     
  14. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,689
    2,750
    Not critical -- should be OK.
     
    R!f@@ likes this.
  15. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    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: Oct 14, 2016
  16. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
  17. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,689
    2,750
  18. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    I was afraid of that. :oops:
     
  19. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    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
     
  20. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    See the difference
    1.png

    2.png

    I believe @joeyd999 one turns ON harder
     
Loading...