anonymous signals

Hi All,

I use arduino's for my Home light switches and much more.
I use the Superhouse product sets - Mega IO breakouts and the Superhouse lights switches.
Simply because they use standard Ethernet cabling and it makes it easy between switches and the boards. I use Cat5E to all my light Switches back to central Arduino's.

I then use Opto separated relay boards to drive 12volt circuits (over Cat5E Cabled) to Field 250VAC Domestic relays to drive light switches/FAN's etc.
I do this for complete separation and i like the idea of 250Volt Certified Domestic relays. Good separation anyhow.

For some reason, every so often i get random On's with lights and have no idea why.
Originally i thought this was average programming - ive confirmed its not.
I can sometimes repeat this with repeatedly turning a light on/off until another light comes on for no reason(not always the same light either). This especially happens when i adjust a ceiling fan speed on one of those old 3x speed switches.

I'm Convinced this is a EMI problem now... however..
All my light switches are input_pullup... i would assume grounding a circuit for button press would not be affected by EMI ? Amy i wrong ?

Ive done a fair bit of reading around EMI and Arduino's with field cabling.. There is alot of varying opinions on there on how to handle it.
This is the point - i wish i installed shielded cables. Curious if other people see this out there ?

I'm already going down the path of adding Ferrite choke clips to all cat5e cables.
I was going to add 100NF 250VAC Polypropylene capacitors to the load side of the field relays. Also adding them to my ceiling fans too.

Should i be adding 0.01uf capacitors to all my light switch digital input pins to reduce further noise ?
Does this work considering I've done a input_pullup and grounding a Pin to signal a button push ?
Should i be looking a diode to my relay coils too ?

Thanks in advance for suggestions.

Years ago, I had long wires going to digital inputs, with pull-ups. I kept on getting random triggers. My solution was to opto-isolate the digital inputs.

100% put those diodes across the relay coils.

You might find that the ferrite beads, placed as close as possible to the place where the digital inputs enter the case solve the problem.

bencornish78:
Am i wrong ?

Yes :slight_smile: Spikes can go both ways.

Opto's can work but not really because of there opto function. They simply make the input lower impedance.

Idahowalker:
Years ago, I had long wires going to digital inputs, with pull-ups. I kept on getting random triggers. My solution was to opto-isolate the digital inputs.

A stronger pull-up (or pull-down if you use it that way) can fix this, as well as a small cap (1-100 nF).

Im trying to get my head around the cap logic in a Pullup scenario.

When does the cap go ? Close the the arduino or close the the push-button ?

Close to the Arduino. That's the location you want to make lower impedance.

Between pin and GND, near the pin. The cap filters out noise: it forms an RC filter together with the pull-up resistor.

To best help we need to better understand your setup.

From what I understand, you have:

some inputs -----? wire?----->Arduino – long Cat5—> Opto isolated Relay board —> mains light fixtures

From what you said it sounds like the the lights controlled by the relays are turning on / off unexpectedly.

So unless you have latching relays the issue is in the Arduino, either the input wires or output wires are picking up noise and causing the Arduino to change state. My guess would be the inputs.

Capacitance at the input is in the right direction. Such capacitors should be as close to the input as practical and grounded near the Arduino ground.

Would like to know more about the input circuit to be more specific.

John

Capacitors absorbe large narrow spikes of interference because they look like a short circuit to a short circuit to a rapid rise time signal.

wvmarle:
Between pin and GND, near the pin. The cap filters out noise: it forms an RC filter together with the pull-up resistor.

The capacitor and pullup resistor are in parallel as far as ac signals are concerned, in reality
the capacitor acts as nearly a short circuit to high frequencies, reflecting such interference
back down the wiring, and acts as a capacitive divider at lower frequencies, reducing the
strength of capacitive interference from mains etc. A low valued pullup resistor will also
dilute capacitive interference.

Grumpy_Mike:
... a short circuit to a short circuit ...

Wow! :astonished:

Better lengthen it immediately. :slight_smile:

Grumpy_Mike:
Better lengthen it immediately. :slight_smile:

Then you'd have a short circuit to a short circuit to a short circuit!

Yes but a long one.

I have one Arduino which handles all the inputs from light switches around the house.
Based in this configuration:
EtherMega2560 → 1K Resistor → Long Cable → remote Pushbutton
Using a stock standard INPUT_PULLUP configuration in the code. I Also run a debound delay of 400
The Cable is Cat5e - Generally around 20 meter runs. ON the same cable i also run 5Volts to power the pushbotton bezzels

This is the i2c connected to another EtherMega that runs the relays.
I run those 16x Opto Issolated relay boards next to the arduino’s which are 12Volt. These run all the field relays which are more domestic rated for 250Volt.
these 16 way boards are like this - https://www.makerstore.com.au/product/elec-12vrelaymod-16chan/

EtherMega → Opto Relay board → long cat5e Cable → Field Relay → 250Volt device.
Generally run 4x Relays per Cat5E Cable and 2x Cables to a box of upto 8Relays.

All this is also connected to ethernet running mqtt.
Debugging so far shows im getting what looks like a button pushed.

I generally dont see a light going off - just on. and randomly different lights.
its rare for a light to just go on … couple of times per week.
I can replicate it happening when changing fan speed with one of those old school 3x speed fan switches to a fan.

So assuming i try putting a Cap on the input pin on the Arduino - what size Cap would you recommend ?

In the hope i can make this all go away, I’ve kinda of gone a few different approaches to reduce this suspected EMI and make it go away for ever. I was looking at adding:

  • Ferrite chokes on all the Cat5E cables Entering the field relay boxes and also near the arduino’s. Theory is suspecting EMI coming back via the relay cables.
  • Ferrite chokes on all the push botton cat5e cables coming back to the arduino
  • MOV (100nF 250VAC Metallised Polypropylene X2 Capacitor) on the 250volt load side of all field relays.
  • 470Volt Varistor on the 12volt side on the field relays with a Zenner Scrubber on the Coil side on the field relays (1n4733a + 1n4148 )

Few different approaches i know… but they all are cheap components.
AM i going down the right path here ?

So assuming i try putting a Cap on the input pin on the Arduino - what size Cap would you recommend ?

The normal decoupling capacitor is a 0.1uF ceramic one. Also use an external pull up resistor of 1K on those inputs.

Yes you are going in the right direction but these things are tricky. Also look up “snubber” circuits for the contact side of the relays.