Relay Module With Selectable High/Low Trigger
by leethayer8 in Circuits > Electronics
66 Views, 2 Favorites, 0 Comments
Relay Module With Selectable High/Low Trigger
This is not a new module by any means. I know these can be purchased for very low cost but I wanted to make one, knowing how it is designed and the parts used. If you buy one, you need to specify 5 or 12 volts (I have not tested my module with 24 volts so I am not advertising it as 24 volt capable), and with my module, all you need to decide is if are going to use 5 volts or 12 volts, and install that relay, the rest of the parts are exactly the same.
The relay I used is a Omron G2R-2-DC5V. which is a DPDT relay, you have 2 common points, 2 NO points, and 2 NC points, so depending on what you are trying to control, you can connect up to 4 items, with 2 on and 2 off when the relay is not energized, and switch those when you energize the relay.
The name on the PCB is simply Relay Module, as it can be a 5 volt or 12 volt module depending on the relay you install.
This is an optocoupler isolated module that operates with +5 or +12 VDC and the relay can be triggered with either a High or Low level on terminal IN. The high or low trigger is selectable with a header pin jumper.
I found the schematic for the store bought version of this module, and that is available here, with full credit to them for making the schematic.
The relay used is triggered with +5 or +12 VCD, or a ground from a switch, etc., or LL0 or 1, or a proximity sensor, etc.
Rating of the contacts on the Omron 5 volt relay is 5A @ 250VAC and 5A @ 30VDC.
The store bought module is approximately 50x26mm, and the one here I had made is approximately 57x45mm.
There is a short parts list and this will assemble quickly. I built a 5 volt relay module. Component functions will be described in each assembly step.
Supplies
Parts:
Note: All resistors are 1/4 watt, 1 or 5% as there is nothing critical in this circuit.
The PCB gerber files and schematic can be found on my Proton drive here, and the PCB can be ordered from PCBWay here.
PC814 AC optocoupler, x1
4 pin DIP socket, x1
2N3906 PNP transistor, x1
SR260 Schottky diode, x1
1K resistor, x2
10K resistor, x1
2.2K resistor, x2
LED, green, 3mm, x1
LED, blue, 3mm, x1
5 volt DC relay, G2R-2-DC5V, x1 (or 12 volt relay, G2R-2-DC12V, x1)
male header, 2.54mm pitch, single row, 1x3P, x1
screw terminal block, 2.54mm pitch, 3P, x2 (KF128-5.0-3P) (or a single KF128-5.0-6P)
screw terminal block, 2.54mm pitch, 3P, x1 (TB002-500-P-03-GR)
standoffs with screws, x4, (I used M3x6 standoffs and M3 screws)
header jumper, x1
Tools:
Schematic.
Electrical tape, for holding parts in place when soldering.
Soldering iron & solder, plus liquid flux and solder wick if mistakes are made.
Flush cutters, for trimming component leads.
Small breadboard, or pin header soldering tool, used for installing the header pins.
Downloads
Assembly: Header Pins, Resistors, and Diode
The general promise when installing components is to start with lowest profile parts to the tallest, but when there is header pins, I like to get them out of the way first since a smooth board will help in getting a nice vertical alignment on the pins.
Place the male header, pin side downwards into either a breadboard or pin header soldering tool, place a spare pin header row on its side away from the header.
place the relay module board, bottom side up, and line up the header pins to the holes in the board. The PCB should be laying flat, adjust the spare header as needed so the PCB is level, hold down the PCB with a weight, I use a large nut.
Solder the end pins, check to make sure it is sitting squarely on the PCB, adjust either or both pins as needed, then solder the middle pin. Header pins are now complete.
For the resistors and diode, simply bend the leads to fit the hole spacings, insert into the board, tape in position, solder, check that there is solder on both sides of the holes, trim the leads, and move on to the next part.
Pay attention to the diode as that goes in a specific direction according to the cathode.
Now you can add the standoffs to the corners if you wish.
Functions:
H1, is used to determine if a high (LL1) or a low (LL0) will trigger the relay. When the H and center pin are connected with a jumper, a logic level 1 will activate the relay. When the L and center pin are connected, a logic level 0 will activate the relay.
R1, R5, are current limiting resistors for the LEDs.
R2, is the current limiting resistor for U1 pin 1.
R3, R4, are for current limiting on U1 output and base of Q1.
D3, is a fly back diode for high voltage protection when power is removed from the coil on relay K1. A Schottky diode is used for fast switching.
Socket, Transistor, and LEDs
If you are using a socket, go ahead and solder that in place, making sure it is sitting flat on the board, aligned properly and the notch on the socket matches the notch on the silkscreen. If you want to skip the socket, go ahead and solder in U1 directly to the PCB, making sure the IC sits flat and is aligned to the pin 1 mark on the PCB.
Install the LEDs, paying attention align the LEDs with the flat side to the flat side on the silkscreen. If you cannot see the flat side on the LED, look through the LED and the large metal piece is the anvil, that is the flat side or the cathode of the LED. On the PCB, the flat side on the silkscreen is under the 1 or 2 (for D1 or D2).
The transistor Q1 is straightforward to install, just make sure the flat side of the transistor aligns with the flat side on the silk screen.
U1 Socket, U1 is an AC photocoupler, across pins 1 and 2 are two LEDs connected in reverse with one another, and a phototransistor across pins 3 and 4. This provides electrical isolation between the control circuit and the DC or AC switched by the relay. The two LEDs is what allows this module to be selectable High or Low trigger input.
D1, is a green 3mm LED as the power on indicator, (labeled PWR). This is lit when power is applied to the module.
D2, is a blue 3mm LED as the relay on (energized), (labeled R ON) indicator. This will light only when the relay is energized.
Q1, is the switch turning relay K1 on or off.
Screw Terminals & Relay
Connect the two screw terminals, U6 and U7, together and place in the appropriate holes. Use another similar size screw terminal and place in the holes for J1, turn the board over and make sure it is flat and level
Only solder 2 pins on U6 and 2 pins on U7, check to make sure they are flat on the board, then solder the middle pin on U6 and U7 terminals.
For terminal J1, insert that in the holes for J1 and turn the board over, and since that is shorter than U6 and U7, you need to prop that up, some spare PCBs work well for this. When the board is sitting flat on J1, solder two pins, make sure the terminal is flat on the board, then solder the center pin.
For the relay, fit that on the board, then turn the board over and the board should remain in place on top of the relay. Solder two leads in opposite corners, check to make sure the relay is flat against the PCB, adjust if needed, solder remaining leads.
Now you can place the PC814 into the socket. Your relay module is now compete. Remember to place a jumper cap on H1 depending if you want to use a LL1 or LL0 to trigger the relay.
Functions:
U6, and U7, are screw terminals for the load. U6 is one pole of the relay and U7 is the other pole, each are sperate, so you can have for instance one item one when the relay is energized and another item off, and they switch when the relay is energized.
The C1 on U7 and the C2 on U6 is the common line, or the load input or hot wire, such as Line for AC or + for DC load, and the other terminals are NC (normally closed) and NO (normally open). Normally only NO terminal is used and you would connect Line for AC or + for DC to your load, and Neutral for AC or - for DC is connected to your load and not connected to the relay module. When the relay is energized, either with a High or Low signal (determined by H1), power is supplied to your load when the relay triggers.
J1, is a terminal to connect your relay power, where +5 or +12 volts (voltage of relay coil) is connected on + terminal and ground on the - terminal. The SIG (signal) terminal is for the High or Low logic signal to turn on or off the relay.
K1, is either a 5 or 12 VDC DPDT relay, allowing you to safely switch up to 240 volts 5 amps using a low voltage control.
Testing and Use
Testing:
Simply apply power to J1 +, is either +5 or +12 volts (depending on the relay you installed), J1 -, is ground. Attach one end of an insulated wire, with each end stripped, to the SIG terminal.
Place the header pin jumper on H1 across pins H and center, this allows for a LL1 to trigger the relay.
Turn on your +5 or +12 power source.
Using the wire you installed on the IN terminal on J1, touch the end of the wire to the + terminal, the relay will click on when it energizes and D2 will light. Remove the wire touching the + terminal and the relay will click off and D2 will go out. Touch the wire to the - terminal, nothing should happen, no relay click, D2 will not light. This shows that a High Level will trigger the relay.
Position the jumper on header H1 between the center pin and L. Using the wire attached to the SIG terminal on J1, touch the - terminal, the relay will click on when it energizes and D2 will light. Remove the wire touching the - terminal and the relay will click off and D2 will go out. Touch the wire to the + terminal, nothing should happen, no relay click, D2 will not light. This shows that a Low Level will trigger the relay.
For the Photos, I connected my breadboard proximity sensor, Power Supply Module, and the Relay Module to demonstrate using a logic level for the relay trigger.
Photo 1 shows the H1 jumper on the relay module set to the High trigger pin. The relay is powered as seen with the green LED, and the proximity IR section of the module is not covered which produces a logic level 0 on the output pin of the module, and does not energize K1 on the relay module.
Photo 2 shows same set up as Photo 1, except the IR section of the proximity module is covered, producing a logic level 1 on the output pin of the module, and energizes K1 on the relay module as shown by the blue LED (relay on) illuminated, and looking closely, the NO contacts are now closed.
Photo 3 shows the H1 jumper on the relay module set to the Low trigger pin. The relay is powered as seen with the green LED, and the proximity IR section of the module is not covered which produces a logic level 0 on the output pin of the module, and energizes K1 on the relay module as shown by the blue LED, and looking closely, the NO contacts are now closed.
Photo 4 shows the same setup as Photo 3, and the IR section of the proximity module is covered which produces a logic level 1 on the output of the module, and does not energize K1 on the relay module, and looking closely, you can see the NC contacts are now closed and the NO contacts are now open.
Arduino Use
Since a relay coil pulls more current than what an Arduino digital pin can provide, you will need to drive the SIG input of the relay module with a mosfet, or if you are using more than one relay board, use a Darlington array (such as ULN2003).
If you are using a 12 volt relay, or even a 5 volt relay, a simply switch can also be used to trigger the relay.
Future Versions
I am working on designing modules for 2, 4, 6, and 8 relays.
I am also researching another module layout to use screw terminals for ring or fish tail wire terminals, which would be a more robust module.