So I have a 4-channel relais. 3 Input pins are connected with the arduino mega on ports 5,6,7.
I also have a mixer, which has a remote control feature. With that, I can press the buttons on the mixer and it will output a signal to a 6,3mm jack. And each of the 5 channels that have that button, are connected with a digital input pin on the arduino (where HIGH means button not pressed and LOW means button pressed). And when a button is pressed it will send a command to the serial port to the pc.
That totally worked until yesterday, when I set up the new 4-channel relais. As soon as I activate the outputs that switch the relais
the arduino somehow acts like I pressed one of the buttons (so it creates a low on a random pin that a button is connected to). Note that only happens when I actually switch the relais inputs not just when I activate the relais outputs, but it has definetely something to do with the relais.
EDIT: The relais switches 230v and I just plugged of the cable and it switches perfectly without sending any fake signals. So is it maybe just the relais? Maybe it can't work with that high amount of voltage (even though it is made for 230v)?
Digot:
EDIT: The relais switches 230v and I just plugged of the cable and it switches perfectly without sending any fake signals. So is it maybe just the relais? Maybe it can't work with that high amount of voltage (even though it is made for 230v)?
Are you switching inductive loads.
Then the spark created by the relay contacts could upset the Arduino.
A solution could be a snubber circuit or VDR/varistor across each relay contact.
Leo..
You should not connect a regular relais directly to your Arduino. And do not forget the freewheel diode. A low power relais might work well.
A digital out pin can give you an absolute maximum of 40 ma. The maximum output capacity of an ATmega328 is 200mA.
So you should limit the output per pin to a maximum of 20 mA to be on the save side (when using up to 10 pins).