Shop OBEX P1 Docs P2 Docs Learn Events
False triggering — Parallax Forums

False triggering

nohabnohab Posts: 96
edited 2008-04-08 15:05 in Propeller 1
Hi,

My first project is very close to be completed, it's controlling the signals around a railway/road-crossing.

By pressing a switch the following sequence is started:
The cars gets red
5s wait
The trains gets white (=go·in Sweden)
15s wait
The trains gets red again
5s wait
The red cars signal goes out (=go in old Swedish road signal systems)

In lab everything works fine but when attached to the model railway, when the sequence reaches it end, it starts over again, without any keypressing.

The switch is a momentary one, attached between pin 16 and Vss. Pin 16 is also pulled-up with a 10K resistor to Vdd.
With very short wires to the switch, it's no problem.
With medium wires, the curcuit is faulty trigger occasionally.
With long wires (about 2 meters), the curcuit is faulty triggered all the time.

So, I guess the wires pick up some interference.
How to supress this?

Regards
Niclas
802 x 319 - 34K

Comments

  • DynamoBenDynamoBen Posts: 366
    edited 2008-04-01 16:10
    Personally I would try two things. First I would include some sort of software debounce in the program (150-250ms wait). This should minimize false triggers. If that doesn't make much of a difference you may want to try a 4.7K pull-up.
  • nohabnohab Posts: 96
    edited 2008-04-02 11:13
    Thank's for the tip, sounds reasonable.
    So you don't think any filtering capacitors are needed?
  • DynamoBenDynamoBen Posts: 366
    edited 2008-04-02 19:57
    You can go the cap route but I usually only do this when I want a "hardware" debounce.

    I think the software debounce should get you going without any changes in hardware. Basically you check the switch state like you are already going then wait 200ms and check it again. If its still pressed then its considered "vaild" and you move onto your button routine.
  • nohabnohab Posts: 96
    edited 2008-04-08 15:05
    Thanks, it worked out perfectly !

    /Nicke
Sign In or Register to comment.