Originally Posted by nsusammyeb
I actually tried to use a transistor as a switch but I think I wired it up wrong. I'm using a 5v reference from my megasquirt board. I set the shift point in the software and it sends signal to the pin when I hit that rpm. I've got an led blinker off of a motorcycle that will work awesome and is super bright. I just need to figure out what wire goes where. IIRC the base goes to a 1k resistor then to the 5v on the board, the emitter goes to the 12v light and the collector goes to ground. What I'm confused about is where the ground from the 12v light goes? I assume that the collector and the light share grounds. I'm also confused about the fact that the 12v led set up already contains resistors, etc.
I actually tried to use a transistor as a switch but I think I wired it up wrong. I'm using a 5v reference from my megasquirt board. I set the shift point in the software and it sends signal to the pin when I hit that rpm. I've got an led blinker off of a motorcycle that will work awesome and is super bright. I just need to figure out what wire goes where. IIRC the base goes to a 1k resistor then to the 5v on the board, the emitter goes to the 12v light and the collector goes to ground. What I'm confused about is where the ground from the 12v light goes? I assume that the collector and the light share grounds. I'm also confused about the fact that the 12v led set up already contains resistors, etc.
Short answer:
The ground from the 12v light goes to the cars chassis ground. The motorcycle turn signals have resistors in them to limit the current that flows through the LEDs - LEDs will allow more current through them than they can handle and will burn out without a resistor to limit that current.
Long, confusing, and more helpful answer:
Since you have a Base, Emitter, and Collector instead of a Gate, Drain, and Source, I assume you're using a BJT transistor instead of a MOSFET transistor.
How you connect the transistor depends on the type of BJT transistor you have. For NPN type, the transistor turns on when the Base is at greater voltage than the Emitter; for PNP type, the transistor turns on when the Base is at less voltage than the Emitter. For both PNP and NPN BJT transistors, if the Base voltage equals the Emitter voltage, the transistor switches off. (In summary)
If you have a PNP type transistor, it may not work properly because the MegaSquirt pin will not reach enough voltage to equal that of the Emitter pin (12 volts) and turn off the transistor. Even if it did work, the motorcycle LED would be on when you were below the shift point, and off when you were above.
An NPN type BJT will work. The left schematic, using a NPN BJT will work, the right schematic using a PNP BJT will not work.
This MOSFET will work as described in the video, and for your application.
Last edited by petelite
on 2011-09-01
at 03-05-07.