In this tutorial we will see how to control 12V LED and motor with 5V Arduino by using Transistor TIP122. And we are using transistor as a switch and also controlling led and motor with plus width modulation. We will also see how to calculate base current resistor. So let’s get started.
For this you will need
- Transistor (TIP 122),
- Diode (1N4007) If you are controlling motor,
- 12V battery,
- 2K ohms Resistor,
- Jumper wires,
- 12V LED, (If you are controlling LED)
- 12V Motor (If you are controlling Motor)
How to find base current resistor?
First we need to calculate base resistor for transistor. Using this method you can find any transistor base resistance. Download data sheet of transistor TIP 122. Now goto page number 3 and in second figure we can see equation on top right corner Ic=250 X Ib,
So we need to check how much load current is require to run a motor. My motor require 0.44Amp current. It may be printed on motor or it is written in motor specification. So my Ic value will be 0.44Amp. Now calculate Ib which is equal to 1.76mA.
Ib = 0.44/250
Look at figure 2 again now we know collector current. Check 0.44 value in figure 2 and Match with Vbe saturation. Its value is around 1.375 V.
Vbe= 1.375 V
It means that Arduino has voltage drop of (5-1.375) which is equal to 3.625V. Now according to ohms law R = V/Ib.
3.625/1.76×10-3 = 2059.65 ohms
So we get 2059 ohms as a base current resistor value.
but I am using 2.2K ohms resistor. You can calculate base resistor according to your load current.
To control 12V LED we need to connect our circuit like this.
After doing connection. Open Arduino IDE software,
goto file > Examples > Basics > blink.
Upload led blink sketch. Now we can see we are using transistor as a switch it will turn on and off 12V led for 1 second. Now again goto Arduino IDE software
goto file > Examples > Basics > fade,
upload fade sketch from examples. Change pin number to 9. Now we can see it is fade on and off. We are controlling this with plus width modulation.
Now we will control motor. Just add diode across the motor.
Now upload the blink sketch. I have given 1 second delay for ON and 3 second delay for OFF. So that we can see clearly motor is stop spinning. Now we will control motor with plus width modulation. Upload the sketch of fade from examples. Now we can see it is varying its speed in every 300 millisecond.
Components list to buy online:
For more videos subscribe the channel
Till than keep learning keep making. 🙂