DIY Relay Board

4,413

53

14

Introduction: DIY Relay Board

About: An electronics hobbyist

Relays are always used for AC switching circuits...we frequently need AC loads like Fan Bulbs to operate automatically with conditions like decreased light, increased temperature, etc.Also we come across situations like when we need to control appliances remotely using smartphone or we have sensor that detects human presence and turns on light ,fan and turns off when it is not detected..in all these applications we use a Relay board and we are now going to make such a Relay board that can be used along with logic circuits or micro-controllers to handle AC loads or High voltage DC loads..

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts Required

1. 5/6 V relay

2. 2 1K resistor

3. 1 1N4007 diode

4. 1 BC 548

5. 1 3 pin Screw connector

6. 1 MCT2E / 817 / 4N35 Optocoupler

7. Male headers

8. Solder kits and perfboard

Step 2: Theory and Breadboard Testing

Relay is an electromagnetic switch. Initially when there is no input signal, the COM(common) and NC(normally closed) are connected. The input coil when energized sets up magnetic field and becomes an electromagnet. This magnetic field pulls the COM terminal and connection is now formed between COM and NO(Normally Open).

The circuit has an optocoupler that is just an optical isolator ...it has a IR led at one end and a phototransistor at the other end. When the IR led glows and light falls on the base of phototransistor, the BJT turns ON, otherwise OFF..

Now the signal from the microcontroller or logic circuit glows up the IR led..and turns it on.

The emitter of Phototransistor is fed into base of another BC548 NPN BJT via a 1K resistor, hence a Darlington Configuration, The overall current gain is now B1*B2+B1+B2 (B1 is current gain of phototransistor and B2 is current gain of BC548)....This gives a better drive to the relay coil.

Now when signal line is high, IR glows, phototransistor and BC548 is On and current flows through the relay coil and energize it..then the COM terminal moves to the NO side and hence COM and NO are shorted, ..when signal line is LOW the COM and NC are shorted..

The diode is used as a flyback diode. After the circuit is operated for a while and is then switched off the stored energy from inductor now discharges, this voltage can even go up to 40-60V for a very short interval and can damage the other components, the diode is used to provide the circular path for that stored energy and is dissipated in the diode, keeping the components safe..

Test the above circuit in breadboard and see if this works, if properly connected it MUST work...

Step 3: Soldering on Perfboard

Now after breadboad testing is complete, move on to soldering, take the schematic beside you and start careful soldering. Be careful since you will be dealing with high voltages with this, hence a single error can damage everything...observe carefully the circuit traces using magnifying glass and light. Check yourself with continuity tester to find the NO and NC, the COM is always the middle one..

now test it first with DC load then you can move onto AC loads

I've attached a sample schematic to test with DC load, look at the video too attached here...

If everything is all right, you are all set..

contact me for any problem regarding schematic or theory or testing at robosanu1@gmail.com or comment below..

Be the First to Share

    Recommendations

    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest

    14 Discussions

    0
    LuigiA15
    LuigiA15

    Question 7 months ago

    Thank you for sharing this. Can I use a 12v relay with the same schematic? Do I have to change the resistor?

    0
    SayantanM4
    SayantanM4

    Reply 5 months ago

    yes, you may need to change that. this will also depend on the current rating of the coil.

    0
    figjam963
    figjam963

    Answer 7 months ago

    same question here too mang, i'm thinking 12vdc could be supplied to JDVcc, but would i have to change out the 1k resistor(R2) between the opto-isolator and the BC548 or would i have to add a resistor between JDVcc and the opto-isolator to lower the voltage going into the opto-isolator and leave the 1k resistor(R2) as is?

    0
    rb_23
    rb_23

    1 year ago

    can you please provide the schematic for this relay module

    0
    SayantanM4
    SayantanM4

    Reply 1 year ago

    That's in step 2..please scroll all the pics..

    0
    gm280
    gm280

    2 years ago

    I applaud you for using an opto-isolator in this circuit. That way there is no chance to have line voltages ever get to the controlling signal. I realize you are not using line voltage to energize the relay, but you easily could if you selected such a relay and still use the same setup.

    0
    SayantanM4
    SayantanM4

    Reply 2 years ago

    I'm planning to use it in my Ac loads and I've tested it with high voltage dc load, it works fine.. and now I'll move on to test with small ac loads like small lights or indicators.. If everything is all right I'll also move on to controlling my fans.... The opto is a vital component... The input and the output side are now fully isolated

    0
    gm280
    gm280

    Reply 2 years ago

    I guess I misrepresented my view. Obvious line voltage isn't used in this circuit to energize the relay. However, the relay contacts can be used for any (within its capability of course) AC or DC voltage and that does include typical line voltage. And with a few changes you could use line voltage as well to switch a relay. But that is another circuit design. Sorry some misunderstood what I was trying to convey. I'm sure it was my wording.

    0
    SayantanM4
    SayantanM4

    Reply 2 years ago

    No problem bro

    0
    SayantanM4
    SayantanM4

    Reply 2 years ago

    No....line voltage is not used to energise the relay...5-6V DC signal is used to energise the relay coil..look at the circuit carefully...it is a normal 5V relay

    0
    abhinnkp
    abhinnkp

    2 years ago

    Nice work!!! Simple but effective circuit.

    0
    SayantanM4
    SayantanM4

    Reply 2 years ago

    Thanks... You can use this in your arduino and home automation projects

    0
    abhinnkp
    abhinnkp

    Reply 2 years ago

    Your instructable will be helpful in my instructable

    https://www.instructables.com/id/ESP-12E-Home-Automation-Board/

    0
    SayantanM4
    SayantanM4

    Reply 2 years ago

    https://www.instructables.com/id/Controlling-Appliances-From-Smartphone/

    I've also done a similar project... Cheers..