Relay modules available in the market are bundled with unlimited useless components. I bet unless you really use them, you may always be thinking of knocking them all out before using them in your project. Well, if you feel the need of having a simple relay module, with just the basic components, you are at the right place. In this tutorial I am going to show you how to make a simple relay module that can be used in any project.
Note: If you do any work with "mains power" such as 120v or 240v AC power wiring, you should always use proper equipment's and safety gears and determine whether you have adequate skill and experience or consult a Licensed Electrician. This projects is not intended for use by children.
Relay modules available in the market are bundled with unlimited useless components.
I bet, unless you really use them, you may always think of knocking them all out
before using them in your project. Well, if you feel the need of having a simple
relay module with just the basic components, you are at the right place. In this tutorial,
I'm going to show you how to make a simple relay module that can be used in any project.
This video is sponsored by JLCPCB. With JLCPCB, you can order very high quality
10cm x 10cm custom PCBs of any color for just $2. The ordering process from JLCPCB is very easy.
Once I had my design ready, I just had to upload the Gerber file to the JLCPCB's website
and then select the type, color and any other customization that I want and then just send it
for fabrication. For my project, I chose the black color. JLCPCB shifts from China to most
of the countries of the world within 3 to 7 business days. Talking about the quality,
it's absolutely mind-blowing. For this project, we need one 5V relay,
one 1K resistor, one 1N4007 high voltage high current rated diode to protect the microcontroller
from inductive kickback from the coil and one 2N2222 general purpose NPN transistor.
When current flows through the coil of the relay, a magnetic field is created
that causes the ferrous armature to move, either making or breaking an electric connection.
When the electromagnet is energized, the normally opened pin is the one which is
on and the normally closed pin is the one which is off. When the coil is demagnetized,
the electromagnetic force disappears and the armature moves back to the original position,
turning on the normally closed contact. The closing and releasing of the contacts
results in powering on and off the circuit. By connecting a multimeter to resistance
measuring mode with a scale of 1000 ohm, we can determine the relay's coil pins.
Since the internal suppressing diode is not present in this relay,
the relay has no polarity marked on it. Hence, the positive output of DC power
supply can be connected to any one of the pins. Connecting a battery to the right pin
can produce a clicking noise when the switch turns on or off. If you ever get confused between the
open and the normally closed pin, follow the steps below to find it out.
Set the multimeter to resistance measuring mode. Turn the relay upside down to see the pins.
Now connect one of the multimeter's probe to the pin in between the coils.
Then connect the other probe one by one to the remaining two pins.
Only one of the pins will complete the circuit and will show activity on the multimeter.
To know more about relays, please check out my tutorial number 4,
Driving a Relay with an Arduino. Link is in the description below.
Connect one end of the coil to the positive terminal of the battery.
Then connect the collector of the NPN transistor to the other pin of the coil.
By increasing the base current of the transistor,
we can magnetize the coil which will move the armature.
Next, we need to connect a diode across the electromagnetic coil.
When the transistor is turned off, the diode protects the circuit against a voltage spike
or the backward flow of current. That's it!
Now you can go ahead and connect the second circuit to the common
and the normally open pin of the relay.
Now, you can also make this simple circuit complex by adding two LEDs,
one for the power indication and one for the activation indication.
You can also add terminal blocks and turn this simple circuit into a heavily complex one.
So this is how my 10x10 PCB looks like.
It has an array of 12 relay modules and a few general purpose PCB perforations,
which all can be separated into individual boards.
First, I'm soldering the 1k resistor and the diode to the board.
Then I'm soldering the NPN transistor.
And finally, I'm soldering the 5V relay to the board.
Now, for this demo video, I'm soldering twisted pairs on both sides of the board.
By connecting the trig pin of the module to positive 5V,
I'm lighting up the LED attached to the normally open and common pin of the module.
Thanks again for watching this video. I hope it helps you.
If you want to support me, you can subscribe to my channel and watch my other videos.
Thanks. See you again in my next video. Bye now.