We have connected transistor base to arduino pin a0 through a 1k resistor.
Arduino transistor relay circuit.
The parts you will need.
Basically when 5v flow through the 1k resistor to the base of transistor a current of about 0005 amps 500 microamps flows and turns on the transistor.
1 x sharp pc817 optocoupler.
1 x 1n4001 diode.
The base of the transistor is connected to digital pin 9 of the arduino through a 1 kilohm resistor.
Thats it our circuit is complete now we can upload the code to the arduino to turn on or off the relay.
In this arduino relay control circuit we have used arduino to control the relay via a bc547 transistor.
Circuit diagram and working.
The second leg connected to analog in 0 of the arduino.
Arduino board jumper wires breadboard.
I just programmed the arduino and attach with my homemade relay circuit board and connect all four appliances with the relay board.
Basically when 5v flow through the 1k resistor to the base of transistor a current of about 0005 amps 500 microamps flows and turns on the transistor.
Below given is relay driver circuit to build your own relay module.
The picture above shows the circuit you need to build.
First leg of the potentiometer is connected to 5 volts.
Most motors require more current and or voltage to operate.
The optocoupler is the most important part it isolates the circuit from the relay using.
So whenever i turn the arduino the first relay is on and its on for 3 seconds and after that it goes off and the second relay is on 3 sec similarly for third and fourth and after fourth all will be off for 3 seconds and after that all four legs will be turned on.
2 x 220ω resistors.
A transistor can act as a digital switch enabling the arduino to control loads with higher electrical requirements.
Usually an npn transistor in a common emitter configuration used as a switch drives the relay.
The third leg is connected to ground.
Thats it our circuit is complete now we can upload the code to the arduino to turn on or off the relay.
Here is a simple circuit that uses a bipolar junction transistor bjt to drive a small 5 v relay coil.
This video npn transistor based 12v dc relay control drive simple make it this type transistor is a semiconductor device used to switch electronic signals a.
The arduino can only provide 40ma at 5v on its digital pins.
A cheap general purpose transistor such as the bc548 is capable of controlling a small relay with a holding current of less than 300 ma.
An ac bulb is used for demonstration.