4 Relay Module Pinout

0 views
Skip to first unread message

Cora Synder

unread,
Aug 5, 2024, 2:05:43 AM8/5/24
to portsuctadas
Inyour upcoming project, you might want to use your Arduino to control a high-voltage device, like a lamp, fan, or other household appliance. However, because the Arduino runs on 5 volts, it cannot directly control these high-voltage appliances.

This is where relay modules come into play. These well-contained modules are inexpensive, simple to connect, and ideal for home-brew projects that require switching modest amounts of AC or DC power. The only downside is that, because these are electro-mechanical devices, they are more prone to wear and tear over time.


At the core of a relay is an electromagnet (a wire coil that becomes a temporary magnet when electricity is passed through it). A relay can be thought of as an electric lever; you turn it on with a relatively small current, and it turns on another device with a much larger current.


On the other side of the module, there are two input pins, IN1 and IN2, for controlling the relay. These pins are 5V logic compatible, so if you have a microcontroller like an Arduino, you can drive a relay with any digital output pin.


The module has a jumper between the header pins JD-VCC and VCC (the relay power is connected to the logic power). This jumper determines whether or not the relay module is physically connected to the Arduino.


Warning:

This board interacts with HIGH AC voltage. Improper or incorrect use could result in serious injury or death. Therefore, it is intended for people who are familiar with and knowledgeable about HIGH AC voltage.


This relay module has two channels (those blue cubes). There are other models with one, four and eight channels. This module should be powered with 5V, which is appropriate to use with an Arduino. There are other relay modules that are powered using 3.3V, which is ideal for ESP32, ESP8266, and other microcontrollers.


The lamp is connected to the relay using a normally open configuration. The Arduino controls the relay through pin 8 (pin 8 is connected to the relay IN1 pin). Finally, the PIR motion sensor is connected to pin 2.


Oi Rui!

Tenho acompanhado e lido as suas interessantes e excelentes postagens; Aproveitando o ensejo, gostaria de lhe pedir/sugerir para fazer algum projeto que use mdulo GPS como esse, por exemplo, Ublox GY-NEO6MV2 GPS Module; Obrigado


Any way we can omit the use of another 5V power adapter? Because doing so will waste sockets. Can we, say, draw the power from the same wire that powers the light, and feed that same mains power into Arduino (with a bit of circuits to drop the power to 5V before feeding to Arduino)?


One thing I found with my relay board was that some of the contacts on the back of the board run at 240v (I had made the somewhat silly assumption that the only bits I had to worry about not touching were the 240v terminals, and grabbed the back without even thinking about it, fortunately with one dry dry hand.


Would love to see you write a tutorial demonstrating how to use more than 1 different type of sensor at a time, for example a distance sensor and say a tilt sensor that could be combined for use on a wheeled robot that could detect objects in front as well as if it has been picked up or knocked over.


Hi,

When i attempt to run this code, I get an error with the line

attachInterrupt(digitalPinToInterrupt(PIRInterrupt), detectMotion, RISING);

the error says that there is an undeclared identifier. Do you have any idea what this means?


Can you go a little more into why this is a good idea please? I built an arduino and an array to control garden watering cycles (so I can do it or not based on the weather forecast) and sometimes it seems like the arduino resets when it flips the relay. Would opto-isolation be likely to stop this happening (if so, I guess I need to use another power supply to go to the relay?


I thought you may want to add in your box about Jd-vcc , that most of the generic boards are not idiot-proof because the GND and VCC are right next to each other so make sure you put that jumper in the right place!


Hi everyone, I don-t know if you-ve expirience this issue with this modules where an ondulating mains voltage remains between the central point of the relay and the NO contact. This voltage may faintly power on some aparatus and I don-t understand why this voltage remains



Hi! Excellent tutorial! Thank you! Just one question. Sometimes the relay stays turning on like a loop and does not stop. Do you know why this happens? I just changed the delay to 2000. Thank you! Kind regards!


Hi! When I pass in front of the sensor the relay turns on. And then when I get far from the sensor range the the relays turns off. But sometimes, not always, the relay does not turn off when I get far from the sensor range, instead it keeps turning on and off sometimes 2, 3, 4 times. Sometimes It does not stop, just when I get close to the sensor again. I changed the code in: long debounceDelay = 10000; to 2000 (2 seconds).

The rest of the code is the same.

Could it be because of that? Or what could it be?

Thanks for answering! Kind regards!


Hi Sara

I want to do something similar but using a dual coil relay to switch 12 volt dc.

Is there a sketch to suit a dual coil relay ?

Can the code be modified to suit. It is just the dual coil bit that I need to know about.

Thanks


Hi,

Interesting project. I need a help from you regarding the following;

Instead of PIR sensor I need to send a signal to Arduino via PC serial/COM port using jQuery script to activate the light. Can you help me for this? Many thanks.


made an clap switch using an arduino uno and 5v relay sigle channel but the relay channel is not working with 9 volt batteries although my light is also 9v but its not working.. can you please tell me how to solve it


Affiliate Disclosure: Random Nerd Tutorials is a participant in affiliate advertising programs designed to provide a means for us to earn fees by linking to Amazon, eBay, AliExpress, and other sites. We might be compensated for referring traffic and business to these companies.


In this tutorial, we will discuss 5V single channel relay modules and their important features such as pinout, pin configuration details, features, working, interfacing with microcontrollers and applications. Relay is an electro-mechnical device which acts as a switch. DC electrical current is used to energize the relay coil which opens or closes the contact switches. Internal circuit of a single channel 5V relay consists of normally open contacts, normally closed contacts and a coil.


Signal Pin : It is used to control the relay. This pin can be active low or active high. In case of active low, the relay will activate when we apply an active low signal to the signal pin. On the contrary, in the case of an active high, the relay will activate when we apply an active high signal to the signal pin. But usually, these modules work on an active high signal. This signal will energize the relay coil to make contact with the common terminal with the normally open terminal.


Ground Pin : Connect it with the ground terminal of 5V power supply. Furthermore, if you are driving a relay module with a microcontroller, also connect this pin with the ground terminal of the microcontroller.


NC Pin : As the name of the normally close terminal suggests, it is normally connected with the COM pin and forms a closed circuit. But this normally closed connection breaks when the relay is activated by applying an active high or active low signal to the signal pin of the relay module from a microcontroller.


NO Pin: This pin is normally open unless we apply an activation signal to the signal pin of the 5V single channel relay module. In this case, the COM pin breaks its connection with the NC pin and makes a connection with the NO pin.


At the heart of the module is a 5V relay covered in blue color plastic. Maximum operating current and voltage for both AC and DC load are also mentioned at the top of the relay cover. SRD-05VDC-SL-C is part number and it shows the operating voltage. It is known as a 5V relay module. Because the relay operates at 5V DC. In other words, a 5V active high or low signal activates the relay by energizing its coil. As mentioned earlier, internally a 5V relay consists of a NC, NO, COM terminals and a coil.


On the left hand of this figure is an output terminal which is used to connect a DC/AC load and DC/AC input power source. We will discuss the wiring diagram to connect a LOAD and power source with this terminal in later sections of this tutorial. Each terminal of the output connector is connected with NO, NC and COM pins of 5V relay. Each point of the module has screws which make it easy to connect cables and wires with the relay module. This 5V relay module supports 10A maximum output current and maximum contact voltage of 250V AC and 30V DC. If you are using a high AC voltage and high current load with this module, you should use thick main cables.


Status LED is SMD LED which is connected through current limiting resistor and it is available on top right corner of the module. It shows the status of the relay. In other words, the status LED turns on when the relay is active and the coil is energized through a signal input pin. The DC current passes through a relay coil.


Power LED is also a SMD type and it shows the status of power source connected with the 5V single channel relay module. Do not connect more than 5V source to Vcc and GND pins of the module. Otherwise, higher voltage may damage the status and power LEDs.


A freewheeling diode is connected across the coil to avoid the effect of back EMF. It is also known as a flyback diode. The coil used in the relay is an inductive type. When the current passes through an inductive load, it produces an back EMF voltage. This back EMF may damage the circuit. Therefore, a freewheeling diode is used to avoid this effect.

3a8082e126
Reply all
Reply to author
Forward
0 new messages