5v one channel relay affecting I/O pins

I use a couple of 5v one channel relays in my project and I have found that when the relay fires it can cause disturbance to the other I/O pins causing buttons to think they’ve been pressed etc.

I have the relays connected directed to the I/O pins on my Particle devices as I understood this was possible with this type of relay? Am I wrong?

thankss-l300

This might suggest some issues with the power supply or wiring of affected pins.
What kind of load are you switching with the relay?

What are you powering the relays with ?
If using USB to power the module, and then using the Vin pin to power them, this is probably your issue.

In one case a 1A 12v AC Bell transformer, and in the other case a 9v DC transformer. The relays are ultimately switching electromagnets in both cases I guess. In the first instance it’s a doorbell and in the second a call box.

So maybe powering the relay is causing the power to the Core/Photon to drop causing phantom I/O problems?

You might not have enough capacitors causing brown outs when the relay is in action. I always make sure to put a 470uF capacitor on my Photon Vin for good measure. Make sure each chip has bypass capacitors (i.e. a 4.7uF and .1 uF in parallel). You probably want bypass capacitors on the I/O pins or a small RC circuit to suppress feedback and spurious signals (similar to debounce circuits). You could go so far as to put a Schottky and/or Zener diodes on the I/O lines to suppress ringing as well. Make sure your other I/O signal lines are as far away from the magnetics/relay as possible. A little shielding between signal lines could help. If your lines are long, use twisted pairs and make sure the signal is twisted with the supply voltage or ground (as opposed to twisting 2 signal/IO lines together).

This is all speculation since you haven’t shown a schematic or picture of your setup. If you have a multi-meter (or better yet an oscilloscope), test and monitor the voltages on the I/O pins that are getting tripped. You can also monitor the supply voltage to the Photon for dips or spikes.

1 Like

@netpex, can you provide a link to your relay board? Though the relay is electromagnetic, the boards are designed to used 5VDC to power and control the relay coils. From the picture you provided, it looks like the board may use an opto-isolated input. Perhaps the question should be: How are you powering the DC+ and DC- logic side of the relay board?

2 Likes

Everything is being powered from the VIN port on the Photon (apart from the load of course, which is powered by totally separate transformers). The relay board is this one.
Thanks all