Wednesday 17 April 2019

arduino - How do I energize a 12v relay coil using a 2N2222 bipolar transistor?



I'm relatively new to working with transistors, and I'm having some trouble getting this circuit to work. I want to use an Arduino's I/O pins (5V out) to energize a 12V relay coil. To do this, I'm powering the Arduino with 12 volts via the power port on the Arduino. For my transistor circuit, I'm pulling from the Vin pin on the Arduinio, which is also 12V.


I cannot figure out how to make it so that flipping an i/o pin from 0v to 5v switches the transistor, this allowing 12v to go across the relay coil.


I know the equations for the operating regions and I'm assuming I'm trying to drive the transistor into active by having Vbe > 0.7V, but I don't really know how to set up the circuit to properly regulate this.



Answer



This question has probably already been answered 100's of times. But here is maybe the 201'st time.


Use a circuit that looks like this:


enter image description here


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...