I want to control a few 12v relays with my UNO and they aren't switching.
so i have a 12v power supply with the (+) connected to one side of the relay coil. The (-) is connected to the GND of the arduino.
On a breadboard, i have a 2n2222A transistor with the collector connected to the GND, emitter to the other side of the relay coil, and the base to pin 13 on the UNO (5.1k resistor was used on base).
i also have a diode between the 2 leads of the coil.
I am just using the 'blink' example for testing.
Can anybody help me?? >:(
Your (npn) transistor's connected back to front I think; picture would be better than words though.
It should look like this, emitter to ground and load above the collector.
Always supply us with:
Show us a good schematic & image of your circuit wiring.
Use CTRL T to format your complete code.
Attach your sketch between code tags
[code]Paste your sketch here[/code]
This pic from the electronicsclub is better; shows the diode: