I bought a 2 relay module from OddWires.com
https://www.oddwires.com/5v-dc-dual-power-relay-module-with-optocoupler/
It claims to be 5v, optically isolated, etc.
It arrived with absolutely no specs documentation. I can't recommend OddWires as a source of components because they don't provide any specs at all. The same was true with the I2C LCD modules I got from them, and it was quite a challenge figuring out how to configure them.
The Vcc, ground, and line1/line2 inputs are clearly labeled, as are the common, normally open, and normally closed connections to the relay.
I figured out through trial and error that the input lines energize each channel of the relay when they are grounded, not when I feed them +5 volts.
However, there is a jumper on the relay module for which I don't know the purpose. It's labeled JVDcc/Vcc/Gnd, and it ships with the jumper connected between JVDcc and Vcc. My guess is that does something with the V in. Perhaps it tells the relay module whether the input voltage is regulated or if it needs to be fed through an internal regulator.
I am seeing some very strange results when I try to use it. I'm trying to drive an electromagnet that I toggle on and off pretty rapidly to drive the wheel rotation sensor (A reed switch) on a bicycle computer (Sometimes my cycle computer gets dislodged and I want to drive the wheel sensor to correct the odometer reading.)
I am powering an Arduino Uno with a USB connector, or alternately with a 9v battery into the barrel connector. I drive the relay module with a 1A 5v regulated power supply, and I power the electromagnet through a separate unregulated DC power supply running at 6-12v (selectable.)
The grounds between the relay and the Arduino are tied together, but their 5v rails are separate, since the relay draws a lot of current. The electromagnet's power is completely isolated from everything else, and is only connected to the relay contacts.
The setup:
I have built an Arduino unit with an LCD display, plus a momentary switch hooked between an input pin and ground, and set to INPUT_PULLUP.
If I sense the switch going low I toggle a bool "active" that tells the rest of the code whether to toggle the relay on and off or not. I have my switch control logic set to ignore the switch input for 1/2 second after a trigger to debounce it.
When active=true, I start checking the micros() function, waiting for enough time to go by, and when it does, I toggle my relay control line on/off.
The Arduino drives the relay output pin as a digital output alternating between high and low. In the low state it grounds the control pin to the relay, energizing the coils.
The problem:
If I don't connect the power supply to the electromagnet, all is well. the Arduino toggles the input line several times a second, the relay clickety-clacks along, and it's input LED indicates that it's getting turned on and off. A multi-tester on the relay contacts confirms that the contacts are being opened/closed as expected.
However, if I turn on the power through the relay contacts to my electromagnet, the relay runs for a few seconds, and then the Arudino stops toggling the input. The LCD stops updating it's display, as if I pressed the button to stop it. I can press the button to start the sequence again, and then a variable amount of time later it stops again.
It's as if the current flowing through the relay coils is screwing up the input to the switch pin on the Arduino, causing it to sense it being pulled LOW. however, The only connections between the relay module and the Arduino are the relay control line and the common ground. The relay contacts are supposed to be isolated from everything else.
I am stumped.
I'm hoping somebody else has bought this same relay module through another vendor and has specs.
I'm also hoping my symptoms make sense to somebody else.