Doorbell wire - induced current?

Thread Starter

John Croucher

Joined Dec 20, 2015
9
I have a very simple setup using an Arduino connected to a doorbell button.
I have a pull down resistor on the input pin, and trigger the code when the pin goes high.
The other side of the doorbell wire is connected to the 5v rail.
When the doorbell is activated it triggers some relays.

The issue is that it randomly goes off a few times a day for no apparent reason.
I have found that using the igniter on the gas stove can trigger it, and I think the washing machine can randomly also.

I tried it in reverse ( go low to trigger ), this was also randomly triggering.

Does anyone have any ideas of what is going on?
 

ebeowulf17

Joined Aug 12, 2014
3,307
What length of wire, and is it twisted-pair and/or shielded? Do the wires run in parallel with other, higher power wires for any significant length?

What value of pull-down resistor?
 

Thread Starter

John Croucher

Joined Dec 20, 2015
9
What length of wire, and is it twisted-pair and/or shielded? Do the wires run in parallel with other, higher power wires for any significant length?
What value of pull-down resistor?
10k pull down.
The wire is just two core doorbell wire. It is not shielded and runs about 15 meters.
It runs near 240v wires for about 2 meters as it goes into my network cabinet.

You might try a RC filter at the Arduino to suppress any transients.
I have a question on this - could you simply connect a capacitor from the input pin to ground, relying on the input impedance of the Arduino for the resistive part of the RC filter?
Thanks for that idea, I will look up some examples.

I use 12volts and an optoisolator for switched inputs, low impedance eliminates false triggers.
That is an interesting solution.
 

ErnieM

Joined Apr 24, 2011
8,377
Stove igniters tend to be much faster events than a person pressing a button. Your debounce routine should have caught this. If not, just increase it's sample delay some.

You do have a debounce routine, right?
 

crutschow

Joined Mar 14, 2008
34,285
I have a question on this - could you simply connect a capacitor from the input pin to ground, relying on the input impedance of the Arduino for the resistive part of the RC filter?
No.
You need a resistor in series with signal line and then a capacitor to ground at the Arduino input.
The Arduino input impedance has negligible effect on the circuit.
 

crutschow

Joined Mar 14, 2008
34,285
Stove igniters tend to be much faster events than a person pressing a button. Your debounce routine should have caught this. If not, just increase it's sample delay some.

You do have a debounce routine, right?
A debounce circuit normally cancels out subsequent signals after the first and thus has no effect on the initial pulse, so it would do nothing to eliminate a fast signal, such as from a stove igniter.
But you certainly could add a delay circuit so that it responds only to a signal longer than a given duration (such as 100ms or more) to insure that it's from the push button.
 

#12

Joined Nov 30, 2010
18,224
I'm with BReeves in post #5. Lower impedance reduces false triggers. Change the 10K to 1K (to ground). Keep the doorbell switch operating with the 5V supply.

(Simply because it's a simple way to do this.)
 

ErnieM

Joined Apr 24, 2011
8,377
A debounce circuit normally cancels out subsequent signals after the first and thus has no effect on the initial pulse, so it would do nothing to eliminate a fast signal, such as from a stove igniter.
Mine do. I would beg to say most do the same as they are the digital equivalent of a low pass filter.
 

Sensacell

Joined Jun 19, 2012
3,432
Getting a clean "contact closure" signal over long, unshielded cables requires a bit of thinking.

The wiring becomes a big antenna, coupling all kinds of nasty into the system, a high impedance (10K) makes things really sensitive.

Reduce the value of the pull-down to 220 ohms, follow that with an RC filter, 10K and 0.1 uf to the input pin.
This network will also help protect the input from getting damaged by induced voltages.
If you look at the input circuitry for a wired burglar alarm, you would be surprised to see how much circuitry they hang onto the inputs.

Some types of switch contacts can become oxidized, a few milliamps of current flow helps keep the contacts in good order as well.
 

#12

Joined Nov 30, 2010
18,224
Reduce the value of the pull-down to 220 ohms, follow that with an RC filter, 10K and 0.1 uf to the input pin.
That's taking it a bit farther. I thought about dropping the first resistor to 220 ohms, but worried about the 22 ma load on the +5V supply. If the power supply can handle it, that's the last of my worries on that front.:)
 

ebeowulf17

Joined Aug 12, 2014
3,307
No.
You need a resistor in series with signal line and then a capacitor to ground at the Arduino input.
The Arduino input impedance has negligible effect on the circuit.
Thanks for setting me straight on that! Re-read a few tutorials on passive filters and I see where I went wrong now.
 

crutschow

Joined Mar 14, 2008
34,285
Mine do. I would beg to say most do the same as they are the digital equivalent of a low pass filter.
Perhaps that's how it's done in software, but not usually in hardware, since normally digital circuits want a fast risetime signal, so you let the initial fast rise signal through and then suppress the subsequent bounces.
That's particularly true if you want a fast response to the push button signal.
 

ErnieM

Joined Apr 24, 2011
8,377
Perhaps that's how it's done in software, but not usually in hardware, since normally digital circuits want a fast risetime signal, so you let the initial fast rise signal through and then suppress the subsequent bounces.
That's particularly true if you want a fast response to the push button signal.
An RC filter is a low pass, which is how you are suggesting to use in the hardware.

The same result, with an imperceptible delay to the user, may be achieved in software, which has a production cost of zero.

The only time I would add any parts in the button interface would be if I was protecting against over or undervoltage spikes.
 

djsfantasi

Joined Apr 11, 2010
9,156
Debouncing that pushbutton, either in hardware or software, is necessary for your sketch to operate reliably. The Arduino site has an example of how to debounce a circuit in software. Check this link http://playground.arduino.cc/Learning/SoftwareDebounce
Debounce can be done either by polling or using an interrupt pin on the Arduino. I have a function that debounces an arcade button (any NO pushbutton switch really), which detects either a short or long push.
 

crutschow

Joined Mar 14, 2008
34,285
An RC filter is a low pass, which is how you are suggesting to use in the hardware.
...............
No.
I'm specifically saying that's not how it's done in hardware if you want fast response.
This is typical for that:


It's a fast attack and slow discharge type of circuit.
But certainly that's unnecessary if you do it in software.
 

Attachments

DickCappels

Joined Aug 21, 2008
10,152
Not intending to derail this fruitful discussion of analog low pass filters, it should be noticed that a debounce routine such as used with mechanical buttons would probably be able to filter out the glitches with zero added parts.

Now to return to the thread in progress...
 

Thread Starter

John Croucher

Joined Dec 20, 2015
9
Stove igniters tend to be much faster events than a person pressing a button. Your debounce routine should have caught this. If not, just increase it's sample delay some.
You do have a debounce routine, right?
*looks up debouncing,, updates my code.*
Yeah it debounces, now.. :)

That fixed it! Rookie mistake, I hate to see it.

Thanks everyone for the help and suggestions.
 
Top