Shop OBEX P1 Docs P2 Docs Learn Events
Suspecting RF interference with button circuit — Parallax Forums

Suspecting RF interference with button circuit

John KJohn K Posts: 9
edited 2005-02-13 22:10 in BASIC Stamp
Hello,

In a circuit using a BS1, I have a switch to control the start of a function which has been found to do so at it's own will. I am suspecting RF interference as the wires for the switch are 5 feet long. Maybe the +5 side is RF'ing over to the sense side (to I/O pin)??? What can be done to fix this, without redoing the circuit to be an active-low? Should a capacitor be placed at the switch terminals (I thought I remember seeing this mentioned somewhere)?

Note: The circuit is an active-high, with a 10 k ohm res. between the I/O pin and ground.

Thank you,
John K.

Comments

  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-02-10 01:39
    John,

    If you have parallel runs of wire with DC voltage in them, the current in one wire can induce a current in an adjacent wire. The way to prevent this is to twist the wires. About 2 turns per inch should do fine.

    However, if you have +5vdc out to the switch, and a return lead to the stamp, and nothing else, induced current isn't what is causing the problem. Until the switch is closed, no current is flowing, so there is nothing to induce a current in the adjacent wire.

    In that case, it could be RF instead. The long leads are acting as an antenna bringing all kinds of signals into the stamp. Changing the switch leads over to a shielded pair should handle that.

    Disclaimer: I'm kind of new to this and there certainly may be other causes and corresponding solutions.

    Jim
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-02-10 17:24
    Minor clarification, steady state DC doesn't cause current induction in adjacent wires, AC does, and signals too. Basically if you have a line in which di/dt != 0 the inductance of that wire (inductance is inherent to all wires and signal paths) will express the di/dt as a change of its electromagnetic field surrounding the wire, this is what causes cross-talk (interference between two wires).
  • ErnieErnie Posts: 20
    edited 2005-02-10 18:05
    A cap should help, placed at the Stamp end (where the 10K should also be), but add some resistance between the cap and the switch so the cap doesn't blow the switch (unlikely, but good practive). 100 ohms or should work.

    That is 2 more parts. For a no-part fix, try making the 10K pull up 1K. Now any EMI needs be 10x to make the same change.

    A software fix would be to see how long the button is pressed; this assumes the EMI hit is a short term event, but a finger on the button lasts longer.

    Finally, are you 1000% sure its EMI over the lines and not a code problem? If the switch is mounted 3" away, does the problem go away? Can you write some no-brainer test code to see if the problem is still there at 5'?
  • John KJohn K Posts: 9
    edited 2005-02-11 17:17
    Hello,

    Thank you for the responses. I placed a .1uF cap at the stamp between the I/O pin and ground, in parallel with the 10k ohm pull-down resistor. Is this right? I am aware that cap are placed between + and - to stabilize circuits, does that work in this case too?

    Thank you,
    John
  • ErnieErnie Posts: 20
    edited 2005-02-11 19:03
    Huh.... I was about to quickly type NOOOOO, put it between the input pin and ground.... but sure, it should work just the same where you put it. I'd put it the other way more for tradition or habit then any real engineering reason.

    Reason: When doing an AC analysis of a circuit it is assumed power and ground are shorted together. That is what bypass caps (the ones between + and -) do anyway, short the power lines for AC.

    In this case, with the problem comming from several feet of wire allowing EMI in to an input pin, extra power supply bypass probably isn't necessary. But it can't hurt either!

    Bypass caps are funny, I've never calculated nor seen anyone say how to size them, just gave it a good guess where and how many are needed... if a problem is still there, add more or change to larger values. (And I get paid for doing this stuff, amazing, huh?)
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-02-11 19:20
    We calculate for them sometimes..... an example with a high speed layout, you might have multiple frequency poles. Bypass caps are chosen
    based on size and resistance (internal and external) to create an R-C filter to minimize the pole frequency. Since we can control the geometry
    of the cap we can also change the internal resistance as well as the cap value. In this way caps of various size may be placed in parallel to
    tackle other pole frequencies that might be causing circuit problems.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • John KJohn K Posts: 9
    edited 2005-02-12 04:15
    Hello,

    I think there might be some confusion on where I placed the cap. It is between the I/O pin and ground, just that this happens to also put it in parallal with the pull-down resistor, right? I attached a sketch showing what I did. The resistor is 10k ohm, and the cap is .1uF.

    John
    217 x 241 - 2K
  • PhilipPhilip Posts: 11
    edited 2005-02-13 22:10
    What sort of volts would you need on this line for the stamp to see an "ON?"

    I would just be concerned that perhaps that is going to be somewhat more than you might expect from RFI specially as the line should pretty much be at 0V to start with.

    I'm far from an expert on this stuff but it might be worth exploring the areas others have suggested, like putting your switch right by the stamp for example. Perhaps there is a fault with the switch?
Sign In or Register to comment.