Relay module control


I am not sure this is the right place to post.

I am an Arduino Uno user, and I have a problem in a relay module (SainSmart 2-Channel 5V Relay Module for Arduino). I wish you guys to help me.

In specific, I connected a Arduino Uno with a relay module in order to control (i.e. open and close) a solenoid valve. That is, at a certain period, the Arduino Uno delivers a signal to the relay module through the IN1 pin, finally controlling the solenoid valve. However, whenever the relay module controls the solenoid, it makes a noisy sound like “tic toc” while flickering one time. (I want to eliminate the noise).

For your information, I attached a link which includes a video:

In the video, you can easily see the noise at around 00:00:16 and 00:00:36.

Could you please help me solve this problem? Any advice would be really appreciated.

Hi, You need to look at how Optical Isolation owrks, and learn about Electromagnetic Interference..

See THIS: and THIS:

Hi Terry,

Thank you so much for your advice. I looked into the contents on the website (your blog) for which you gave me the links above.

After understanding electromagnetic interference and optical isolation, I tried to fix the problem in my design. In specific, I replaced a 2-channel relay module with just a simple (one-channel) relay module so that I do not need to concern about the optical isolation.

As for the connection in the (one-channel) relay module, I connected output signal, VCC, and GND with an arduino uno. Because this arduino uno controls a solenoid, I connected COM in the relay module with (-) of the solenoid and NO (normally open) with (+) of the solenoid so that the solenoid is open whenever the arduino transfer the output signal (HIGH) to the relay module.

However, as shown in the video:, the noisy sound like "Tic-Toc" still appears whenever the arduino uno gives the relay module an output signal (see 5s and 25s and 45s in the video).

Without connecting the solenoid with the relay module, this sound still appears. Therefore, I guess that there is some voltage spike when the arduino uno communicates with the relay module.

However, I do not know how to fix this problem. Could you please give me any advice? Thanks!

Sounds to me like you are closing the relay and immediately opening it. How long do you want the solenoid to remain operated and how long is the Arduino sending the signal to the relay board? (Relays and solenoids will make noise when operated).
Is the relay supposed to be a latching relay?

Optoisolation can solve the problem. You should use a separate supply for the relay module anyways, so why not configure it to use opto isolation? That way, both VCC and GND will be separate and no spikes can come in on the power rails.

Here’s how to connect your 2 relay module if you’d like to give it a try:

Do you have a diode reverse connected across the solenoid coil? (it’s needed)

The "Tic-Tock" is the normal sounds of the relay opening and closing the points, so that isn't an issue. If it is not operating the solenoid, check the wiring for the solenoid and ensure you have an adequate power supply to run it. If the relay is opening and closing outside of your program, double check the code. Pull the Vcc jumper.


Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7,148850.0.html

The glowing LED on the relay board just flickers OFF then ON, is the relay supposed to stay ON or just pulse ON-OFF.

(1) Does your project work, and all you are worried about is a click-click?
(2) Have you got ALL gnds connected?
(3) How many UNOs are you using? I see two…

Also that solenoid does not appear to have a back-EMF diode on it.


Including how you supply power to all your components.

Thanks. Tom… :slight_smile:
PS Do you have a DMM?