Relay Board Hardware Design

Thread Starter

Vihaan@123

Joined Oct 7, 2025
220
I plan to design a relay board, so that i can figure out the issues when assembling the actual hardware, also learn PCB schematic design and related things. There are already lot of threads in this forum on relay interfacing after studying them I was able to reach the current level. But there are few clarifications
The requirements i choose are when 3.3V is received from micro controller port the relay to be ON / OFF.
The specifications are
Relay - SRD-05VDC-SL-C-Datasheet
Coil Voltage3.3V
Nominal Current37.5mA
Contactor Voltage12V
Contactor Current10A

I simulated the circuit in LTspice and functionally it seems to be ok.
The following are the design calculations
The coil current is 37.5mA which is the collector current i have chosen 40mA on the safer side,
Calculation of the Base Resistor
Ic = 40mA ,
Beta in saturation is 20
Hence Ib = 40mA/ 20 = 2mA
Rb = (Vcc - VBE)/ Ib
Rb = (3.3V - 0.8V)/ 2mA = 1.25kOhm
Calculation of the Collector Resistor
Vcc = Ic*Rc
Rc = Vcc / Ic = 12V / 40mA = 0.3kOhm
LED resistor
I have considered 5mA as the forward current
Rled = (12V - 0.6V)/5mA = 2.26kOhm

1773992339036.png
1773992555433.png

Schematic
I use EasyEda for schematic design i attached the schematic pdf. The input connector shall contain 3.3V, Gnd, 12V and the output connector shall contain NC, NO, Gnd for connecting the load (as per my understanding)
Few concerns are should 12V be connected externally by the user and this system works only for 12V? Is the design correct? I have seen recommendation for Mosfet, i will go without in the next step once i am confident with transistor.
Thank you in advance for your time and request to please guide for corrections.
 

Attachments

Thread Starter

Vihaan@123

Joined Oct 7, 2025
220
Initially i thought of 12V then changed to 3.3V, i will redesign the circuit for 3.3V and post it. I plan to go for standard.
 

ericgibbs

Joined Jan 29, 2010
21,390
hi V123,
A point to remember is the operation 'speed' of the relay contact open/close.
You will not get 1mSecs, more like 10mSec.


EG 2048.gif

EG 2049.gif
 
Last edited:

Thread Starter

Vihaan@123

Joined Oct 7, 2025
220
Calculation of the Base Resistor
Ic = 120mA,
Beta in saturation is 20
Hence Ib = 120mA/ 20 = 6mA
Rb = (Vcc - VBE)/ Ib
Rb = (3.3V - 0.8V)/ 6mA = 0.416kOhm
Calculation of the Collector Resistor
Vcc = Ic*Rc
Rc = Vcc / Ic = 12V / 120mA = 0.1kOhm
1773997433385.png
 

ericgibbs

Joined Jan 29, 2010
21,390
hi V123,
The method you are you using to set the relay current to a preset value will not work as you expect.
You could use a resistor in series with the relay coil, which is wasteful in power.

Or you could use a constant current source, but I would use a 12V relay coil as the easiest solution.
E
 

Jon Chandler

Joined Jun 12, 2008
1,560
You might consider using a ULN2003A (7 channel) or ULN2008A (8 channel) peripheral driver chip if you're driving more than a couple relays. They use a low voltage control signal to control relays with up to 50 volt coils and include the base resistors and the back-emf diodes for the relay coils.
 

Thread Starter

Vihaan@123

Joined Oct 7, 2025
220
You might consider using a ULN2003A (7 channel) or ULN2008A (8 channel) peripheral driver chip if you're driving more than a couple relays. They use a low voltage control signal to control relays with up to 50 volt coils and include the base resistors and the back-emf diodes for the relay coils.
As a first step, i plan to understand and fabricate a board for single channel and verify it.
 

Thread Starter

Vihaan@123

Joined Oct 7, 2025
220
hi V123,
The method you are you using to set the relay current to a preset value will not work as you expect.
You could use a resistor in series with the relay coil, which is wasteful in power.

Or you could use a constant current source, but I would use a 12V relay coil as the easiest solution.
E
Thank you for the replies. Is it possible to briefly explain the issues in the design? Also how to include the relay library, i could not find in LTspice.
 

ericgibbs

Joined Jan 29, 2010
21,390
hi V,
When using that 3.3V relay coil you have either 25R or 20R coil resistance, so you need a series resistor to limit the current when using a 12V voltage source

E
This zip has all the relay models, unzip and install, ask if you have a problem.
 

Attachments

eetech00

Joined Jun 8, 2013
4,704
Thank you for the replies. Is it possible to briefly explain the issues in the design? Also how to include the relay library, i could not find in LTspice.
Since you are using a transistor to drive the relay coil, you have isolated the mcu drive voltage from the relay coil drive voltage. Therefore, the relay coil voltage spec does not need to be the same as the mcu drive voltage. It can be different, as long as the same ground reference is used. So, with the transistor driver, you can use a 12v volt relay, and drive it with a 3v mcu drive signal.

The thing to remember is that the mcu drive output current is usually specified to a max of 40mA before subject to damage. So, the transistor drive current should be designed to be, at most, about 70% of maximum.
 
Last edited:

Jon Chandler

Joined Jun 12, 2008
1,560
As a first step, i plan to understand and fabricate a board for single channel and verify it.
If you are eventually going to drive multiple relays, the ULN2003/ULN2008 chips are a pretty common and reliable way to do it and will greatly simplify your design when it comes to driving more than one relay. Just suggesting alternatives that I have found useful.

Relay-Driver-Circuit-using-IC-ULN2003.jpg
 

panic mode

Joined Oct 10, 2011
4,864
The coil current is 37.5mA which is the collector current i have chosen 40mA on the safer side,
Calculation of the Base Resistor
Ic = 40mA ,
Beta in saturation is 20
Hence Ib = 40mA/ 20 = 2mA
Rb = (Vcc - VBE)/ Ib
Rb = (3.3V - 0.8V)/ 2mA = 1.25kOhm
Calculation of the Collector Resistor
Vcc = Ic*Rc
Rc = Vcc / Ic = 12V / 40mA = 0.3kOhm
LED resistor
I have considered 5mA as the forward current
Rled = (12V - 0.6V)/5mA = 2.26kOhm

how and why did you choose that current value? did you measure it? how?
because Relay - SRD-05VDC-SL-C shows that coil resistance is 70 Ohm.
5V (coil voltage) / 70 Ohm (coil resistance) = 72mA (coil current).

so the Ib is 3.5mA, so Rb = 750 Ohm etc.

do you have higher voltage (12V or whatever)? normally that is what would be used to power relay coils. relays need same power (same magnetic field) to actuate. so relays for higher voltage need less current. at 5V, they will need more current than at 12V, but this is something you can decide. using relay driver like proposed by Jon Chandler is a no brainer unless you are limited by space only need to drive one channel.
 
Last edited:

Thread Starter

Vihaan@123

Joined Oct 7, 2025
220
I got some clarity now this is the updated requirements and design

1774087449641.png

Now i consider 5V (as it is more common than the 12V from any evaluation board) and port from any MCU evaluation board.
Ic = 71.4mA
Ib = 71.4/20 mA = 3.57mA
Rb=R1 = (3.3V - 0.8V)/3.57mA = 700 Ohm
Rc=R2 = Vc/Ic = 5V / 71.4mA = 70 Ohm
RLed = R3= (5V - 0.6V)/5mA = 880 Ohm

The current drawn from the IO port is = 3.57mA
The current drawn from the +5V supply from the evaluation board = Ic + I_led = 71.4mA + 3.57mA + 5mA = 79.97ma.
1774088184626.png
One clarification is how do i adjust the resistors if someone gives 12V in place of 5V as input? I want to test it on the actual hardware, can i go for the pcb design?
 
Top