I have connected digital pin 2 of arduino to the circuit as shown: pin 2 to 1kOhm resistor to base of 2N222 transistor. Emitter to -ve of 9v battery. Collector to -ve of LED, +ve of LED to 330Ohm resistor, resistor to +9v The problem is that the LED is not turning on normally its only turning on when I touch anything on collector side of circuit. What seems to be the reason? Seems like grounding problem as its turning off when I don't touch my legs to ground. turns on when I touch it

Thank you in advance.

  • if that's an npn, it's (probably) backwards. you also need to common the ground with the MCU
    – dandavis
    Mar 11 '17 at 11:40
  • Hint: Use wires intended for breadboards. The battery wires lack pins. Mar 11 '17 at 12:50

Sounds like you have guessed it: although it's very hard to say from those photos, it doesn't look like you have the circuit grounded.

Connect a ground from the Arduino to the black wire from the battery.

  • Yes, you are right its working now. Thank you very much :D. Mar 12 '17 at 8:00
  • Sorry for the photos, I uploaded this from my phone and I put connections in image descriptions, but they are not visible in the post. Mar 12 '17 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.