DIY Relay Board

8.5K6019

Intro: DIY Relay Board

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..

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..

14 Comments

Thank you for sharing this. Can I use a 12v relay with the same schematic? Do I have to change the resistor?
yes, you may need to change that. this will also depend on the current rating of the coil.
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?
can you please provide the schematic for this relay module
That's in step 2..please scroll all the pics..

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.

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
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.

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

Nice work!!! Simple but effective circuit.

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

Your instructable will be helpful in my instructable

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

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

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