Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Switch 3

Status
Not open for further replies.

wpayton

Electrical
Jun 1, 1999
2
I want to use a 2N2222 transistor to switch on and of Christmas light using a microcontroller. The collector and emitter of the transistor is in series with the Christmas lights wire. The base of the transistor is connected to a 5 Volt output of a microcontroller. My question is do I need a common ground? If so where would be the best place for it? I tried to hook up the circuit but nothing happens. Help!!!
 
Replies continue below

Recommended for you

You should tried to place a resistor on the emitter of your transistor and your output will be between the emitter and the resistor. I will tried to have a common ground between the micro controller and the christmas light circuits. I am still a students but give it a shot...hope it will help.
 
A good circuit would be a transistor that drives a relay. Then the relay contacts can be placed in series with the Christmas lights. Connect the output of the microcontroller with the base of the transistor through a 1-5k ohm resistor, ground the emmiter and place the relay coil between the colector of the transistor and the 5 volts power supply. Don't forget to place a diode (1N4001 or 1N4148) across the relay coil to protect the transistor from back EMF. <br>
GOod luck !
 
The relay suggested is a good idea. Remember you are controlling AC with the output of your transistor. To get around the idea of a common ground, use an opto isolator or simply power the mechanical relay with the microcontroller output. Either of these methods will eliminate the need for a common ground and might save your microcontoller, too!
 
The simple method is to use a SSR. These can come in a 5V input to switch on/off an AC signal. Check in the DigiKey catalog or Newark's catalog for the part number and costing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor