Take the 2-minute tour ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I have an object with a series of led and I want to turn on and off these leds from my Arduino. The input of the LED circuit is 24v DC 100mA.

What I've done is the following:

  • I've cut a wire of this object and I connected one end to the collector and the other end to the emitter of a NPN transistor
  • I connected the base of the transistor to a digital output (through a 1k resistance)
  • I connected the power to the led series while the digital pin was LOW (actually completely disconnected)

But with no current on the base of the transistor, the LED has turned on to my surprise. I may have completely misused the transistor and other items. How do I fix this circuit?

share|improve this question
    
Can you describe your circuit a little more? Did you put the transistor between the 24v supply and the LEDs? Also, are you using the same Ground for the Arduino and the external circuit? –  Peter R. Bloomfield Feb 28 '14 at 11:25
    
I put the transistor between 24v supply and LEDs and I tried using the ground of 24v supply only and also using both the ground –  Alessandro Niciforo Feb 28 '14 at 11:32
2  
A diagram or photo would be most helpful. I find words can miss out vital detail. –  Cybergibbons Feb 28 '14 at 11:47
    
@Cybergibbons meta.arduino.stackexchange.com/questions/12/… –  jippie Feb 28 '14 at 12:50
    
Thanks guys for the many advices. In the next days I'm going to completely rebuild this project, following jippie diagram, to avoid messing things. I'll let you know –  Alessandro Niciforo Feb 28 '14 at 15:17

1 Answer 1

up vote 2 down vote accepted

If I understand your writeup correctly, this is what you have built:

schematic

What you didn't mention in your question is that you made a connection from Arduino ground to the base of the transistor and the seconds circuit's ground connection. I drew the extra lead 'loose' for illustration only, but you see where it should connect. Current needs a return path, it is not sufficient to only have the forward path (from Arduino through R1 and base-Q1). The return path is emitter-Q1 to Arduino-GND.

Do notice though that the two batteries / power supplies must be floating with respect to each other otherwise you're going to short them out.

share|improve this answer
    
Note the transistor part number is just the standard partnumber from CircuitLab. I forgot to remove it and can't edit circuit any more. –  jippie Feb 28 '14 at 12:49
    
From the comments, it sounds like Alessandro actually has the transistor on the other side of the LEDs. –  Peter R. Bloomfield Feb 28 '14 at 13:28
    
@PeterR.Bloomfield one more reason to upvote meta.arduino.stackexchange.com/questions/12/… because that is not how I initially understood it. My transistor is "between 24v supply and LEDs" too ... it can be uderstood both ways. Apart from that this is the de-facto standard to solve the problem, unless ... –  jippie Feb 28 '14 at 13:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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