Strange input behavior

4 replies [Last post]
garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011

Hi All,

I was wondering if someone could confirm if the behaviour I'm seeing on my inputs is normal or due to my less than adequate soldering.

I have connected my house alarm bell output to a 12v relay and wired this via cat5 cabling to an input on the HAH. A script then sends a twitter message (and hence a pop up on my mobile) when the house alarm is triggered. This all works but I am getting the odd false alarm.

I immediately blamed my wiring and have since checked and double checked connection integrity.

On further investigation though, I noticed that by touching just one of the screw down terminals with a paper clip would generate a very brief on/off message (viewed in xfx, lasts millisecs) even though I didnt short the two terminals. I just need to touch one screw. This happens on all four inputs. I assume the some change in resistance/capacitance (?? my electronics is not good) of the terminal is triggering the input briefly.

I therefore assume that the resistance/capacitance of the wiring is changing slightly due to RF interference etc and creating a brief on/off signal from time to time and hence triggering a false alarm.

I can script round this with timers etc so only trigger an event after after a few secs of input being on but was wondering if this behaviour is normal or if I have a problem.

 

Thanks for any info as always,

 

Garry .

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Stronger pullup

Hi Garry,

As you know, each input is implemented by a connector pair. One pin is tied to Gnd, the other goes to an input pin on the micro. The code on the micro enables a pullup resistor that is internal to the micro itself. If you are seeing 'glitches' or 'contact bounce' then the most obvious (hardware) thing to do is to use a stronger pullup resistor.

If you locate the pin on the connector that runs to the micro input pin and then use a 4.7K resistor to connect that to 5V, that may well help.

You can go all the way & use a circuit such as http://ikalogic.com/debouncing.php

That said, some software debounce is probably easier. 

Hope this helps,
Derek

p.s. Excellent application!

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Debounce

The AVR firmware has a 25ms debounce on the input state change already.

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Much better

Thanks Derek. Pull up resistor has stopped the inputs being triggered by just touching the high pin alone. Have now reconnected and so far so good. Excellent support as always :) Garry

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Will add these resistors

Current batch of HAH PCBs are running low, so I'll add the option to fit these pullups to the next run of the boards.

Please, do consider posting up the Lua script that you've written to achieve the notification.

Cheers,
Derek.

Hardware Info