Need Specs/help with OddWires 5v relay module

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.

I'm really quite stumped as to the problem I'm having with this relay unit.

I rewired it so the grounds between the arduino and the relay aren't connected, as illustrated in this thread: how to hookup this relay? - Motors, Mechanics, Power and CNC - Arduino Forum

(By removing the jumper, hooking the external power to the JD Vcc pin, and disconnecting the common ground connection.)

However, if I feed power into my electromagnet from the separate power supply and through the switched connection to the relay, the switch pin on the Arduino still detects a button press (The pin shows as LOW) after a short, semi-random interval.

I rewrote my code so that pressing the button starts a fixed interval of toggling the relay that ignores button input until it's complete, and in that case it works fine.

The problem is that if I try to poll the button digital input pin while I'm toggling the relay and the relay has power flowing through my electromagnet load, the switch (which is in INPUT_PULLUP mode) reads LOW, falsely indicating a button press after a short, variable interval.

It makes no sense, since the load control of the relay is supposed to be completely isolated from the 5V control line.

That’s way too much to slog through to help with a simple relay issue and it sounds like you’ve omitted some necessary components. But, that’s just a guess since that’s all I can do with what you’ve provided.

Without a schematic, and an overview of what you’re trying to do, we’ll probably never know.

FWIW, here’s the relay documentation:

http://wiki.sunfounder.cc/index.php?title=2_Channel_5V_Relay_Module

You need a "free wheeling" diode across the electromagnet coil (same as with the relay coils in the schematic) to suppress inductive kickback when the E magnet is switched off, cathode (end with stripe or band) toward the + power supply. Take the JD-VCC jumper off, turn it 90 degrees and put it on the VCC post so you don't lose it, then hook up like the pic below.
OptoRelay4X_Wiring.png
Just imagine this is a 2 relay module.
D0upWXs_d.jpg