Transistor acts as a switch to control the 12v to relay coil.
Arduino relay transistor diode.
Diode acts as a protection for transistor against back emf induced through relay coil during transit conditions.
1 x tip120 darlington transistor is recommended but any one that will handle your relay will work.
An ac bulb is used for demonstration.
The project is used to demonstrate the high voltage driving capabilities of a relay using arduino uno.
2 x 220ω resistors.
Circuit diagram and working.
In this project the npn transistor 2n2222 drives the relay when the npn junction gets saturated.
The optocoupler is the most important part it isolates the circuit from the relay using.
The coil of the relay needs a large current around 150ma to drive the relay which an arduino cannot provide.
The following picture depicts how to connect the different parts using a solderless breadboard jumper wires a transistor a diode a relay a push button and two 10k resistors.
Therefore we need a device to amplify the current.
The following arduino program completes the post.
The parts you will need.
In this project the npn transistor 2n2222 drives the relay when the npn junction gets saturated.
The base terminal of the 2n2222 transistor is connected to any of the digital i o pin of the arduino through a 1kω current limiting diode in this project base is connected to pin 7 of arduino.
The coil of the relay needs a large current around 150ma to drive the relay which an arduino cannot provide.
We have connected transistor base to arduino pin a0 through a 1k resistor.
Resistor adjusts input current from arduino to the transistor.
Just a simple circuit that contains our transistor diode resistor and of course the relay.
1 x sharp pc817 optocoupler.
Connections to the household appliance are not shown.
B sc engineer in electrical and electronic engineering.
Arduino board jumper wires breadboard.
Arduino tricks is the online education platform which teaches students every day that too completely free of cost.
1 x 1n4001 diode.
Therefore we need a device to amplify the current.
The design of the circuit is described here.