I have 4 Arduino-based systems which controls cameras and lights in a studio. I have just made a mains relay so that I can switch lights on and off automatically. The lights are 240VAC CFL horticultural growlight for plants, and each is 125W. I have just two at the moment, both connected to the same relay.
However, I have noticed that the Arduino has begun to do funny, erratic things. Could this be caused by the SSR and mains voltages? The Arduino controls the camera, and has digital input. When one of the Arduino pins is brought to ground, it triggers a sequence of things such as lights off / on, camera behaviour etc. However, the Arduino is seeing 'phantom inputs' i.e. no input signal is given, but it responds as if it has one. Pull Resistors are apparently active.
The input to the Arduino and the output from the Arduino to the SSR, are both in the same cable and share a ground with the Arduino. Could the presence of the SSR be causing the phantom inputs?
I have added ferrite clamps to this cable. No joy. I have ordered a mains conditioner which should arrive tomorrow, which I'll use to filter the mains to the Arduino power supply, and also the CFL lights (two separate conditioners).
I have an Arduino-based system that runs cameras and lights etc in a studio. The Arduino listens out for a digital input signal (fall edge on a pin that is held high), and upon this begins a sequence of things like firing a camera and turning 240VAC lights on and off via a SSR (see this post for details http://arduino.cc/forum/index.php/topic,148304.0.html)
However, the Arduino is seeing 'phantom' inputs and triggers events back to back. I was wondering if you knew any reason what might be causing this? The input is held high in code. The input and output to the SSR are on the same physical connector, i.e. the cable those two signals runs down is the same, and they share a ground. Could that be it?
Keep the mains wiring well away from the wiring to the switches.
Keep the wiring to the switches short if you can, and run the ground wire to the switches in the same bundle as the wires to the other side of the switches.
Never use a common ground wire for both inputs and outputs, and never put input wires in the same bundle or on the same connector as output wires. The capacitance between the output and input wires is probably causing your phantom inputs.
If you have bundled the input and output wires together, then it should be possible to modify the software to ignore short pulses on the input wires and hence get round the problem; but it's better to avoid the problem in the first place.
I've just about broken every one of your rules. Added a 4k7 pull up to no effect, and grounded the whole system now to earth via a AC in the relay system. That's improved things a little but there is still RF coming in, but it's now mostly refined to when the relay turns the CFL lights on - the process of switching them on triggers a false input on the Arduino. The relay has just one CFL on it and it's a 125W lamp, so not a huge load being switched, certainly not for a 40Amp relay.
Next stop is a firmware fix to ignore short trigger pulses and hopefully that will fix it.
Any ideas, do chip in. It's driving me up the wall at the moment.
The input to the Arduino and the output from the Arduino to the SSR, are both in the same cable and share a ground with the Arduino. Could the presence of the SSR be causing the phantom inputs?
I certainly wouldn't do that - its an obvious route for transients to produce spurious inputs.
Keep the SSR's and their control signals away from all sensitive circuitry, and never share a ground wire between
sensitive input devices and power / output devices.
You could add a 0.1uF or 0.01uF capacitor in series with a 100 ohm resistor between the Arduino digital input pin and ground (i.e. across the switch contacts). That should fix the problem.
Thanks! I'll try the capacitor and resistor idea tomorrow; which of the capacitor values would be best?
I agree the input and output need to be in separate connections, but that's not something I can do quickly sadly. Would require a good amount of work to detach them and drill in new connectors to the chasis. Something for a future amend when I have some down time.