Background Story:
Recently, while helping my friend in building his Automatic
Cleaning filter, I designed driver circuit for Solenoid Valves and DC Motor.
You can easily find enormous amount of How-To, tutorials,
circuits on google. But they are specific with those applications. Simply they referred
other designs and decided to use them in theirs.
Most of them do not discuss about calculation involved for
designing driver circuit according to power rating of the solenoids/relay/DC Motor.
Depending upon the
power rating of your Relay,Solenoid and DC Motor; selection of driver circuit
is done.
This post to address those issues,
- How to choose right driving element like Power Transistor, Power MOSFET etc. ?
- How to calculate sink or source current needed?
- How to safeguard your microcontroller from notorious back EMF of Relays and Solenoids?
Solution:
As described above, For Automatic Cleaning Filter, I need to
drive Solenoid Valves & DC Motor.
Component
|
Nos.
|
Power
Rating
|
Solenoid
Valve (8 mBar)
|
3
|
+12V /
5Watts.
|
DC Motor (30
RPM)
|
1
|
+12V / 400mA
|
[NOTE: Remember, When
designing such a driver circuit, you need to over-rate it.
Why? – In such
loads (Solenoids,DC Motors) starting current A.K.A. "Inrush current"
is high for few-millisecs. Your driver circuit should withstand this high
inrush current. Otherwise it will fry the circuit.]
Driving Solenoid Valves or relays:
Solenoid/Relay is nothing but electromagnetic switch, available in
various sizes and ratings, widely used in many industrial applications.
One can use BJT or MOSFET based driver circuit. I choose BJT
for easy-availability and cost of
component.
We are using solenoid valves of rating +12V/5W, that
is Operating current is around I = 200mA.
We can drive the solenoid from
MCU GPIO using driver circuit, with proper safety consideration.
I decided to go with TIP122 (NPN) Power Transistors,
which is more than enough to drive the Solenoid Valves. Also easily available in your nearest electronics store.

Calculations:
When we are driving any load using either BJT/MOSFET we are
using it as a switch.
So For Transistor, we need to calculate the
minimum base current required to fully turn ON (“Saturate”) the
transistor.
Calculating Base Current and Base Resistor:
Load Current [Solenoid Valve] = ILOAD = 200mA.
And ILOAD = IC.
From the datasheet of the Transistor we will need, β, IC, VBE (MIN).
From the Datasheet of TIP122 we have,
- β = 1000 (Typ.2500).
- IC = 5A (Max).
- VBE (MIN) = 2V to 4V.
We Have Formula for Base Current,
Putting values,
Base Current = 200mA/1000 = 0.2mA
This is the amount of current sourced from microcontroller GPIO, to turn on the transistor.
· Base Resistance,
Putting values,
Base resistor = (
4V - 0.7V) / 0.2mA = 16.5KΩ
(Standard Value = 16KΩ).
| Solenoid Valve/Relay Driving Circuit |
Safety: Flywheel Diode.
Generic diode 1N4007 is added, to safe guard MCU circuitry from back EMF/ Inductive kick generated by Solenoid Valve.
Indication: We have added LEDs (5mm), to get notified when, Valve turns ON.
Driving DC Motors:
DC Motor which is again an Inductive load. Same principle
that we used for solenoid valves applies to the DC Motor.
We do not need to control the speed of a motor, simply
turning ON/OFF.
Again, we are going to use BJT based driver circuit. Same
TIP122 Power transistor used here to drive DC Motor.
We are using DC Motor of rating +12V/400mA.
Calculating Base Current and Base Resistor:
Load Current [DC Motor] = ILOAD= 400mA.
And ILOAD= IC.
Using same formula as above,
Calculating the base current
and hence base resistance required to drive transistor.
Base Current = 400mA/1000 = 0.4mA
Base Resistor = (4V - 0.7V) / 0.4mA = 8.2KΩ
(Standard Value = 8.2KΩ).
Few Facts:
- BJT & MOSFET are widely used devices in driving DC loads.
- There are two types of BJT - NPN & PNP.
- In case of PNP, you need to sink the current.
- In case of NPN, you need to source the current.
- NPN driver Circuit works like this:
- When the microcontroller pin is at Logic 1, current will flow into the base of the transistor, driving the device into saturation: the required current will then flow and turns ON the device.
- When the microcontroller pin is at Logic 0, however, no current will flow into the base of the transistor and the load will be turned OFF.
- For medium powered loads like Relays, Solenoid Valves BJT is best suited solution.
- For high-powered loads, one can use MOSFET. I will cover this next time.



Very nice article. Keep share more article with us.
ReplyDeleteThank you!
dust collector solenoid valve
Vannuoccongnghiepsaigon.com specializes in providing solenoid valves, gate valves, vanbi, electric butterfly valves ... from world famous brands. More: https://slides.com/vansaigon
ReplyDelete