Author Topic: How to wire this setup?  (Read 6684 times)

0 Members and 1 Guest are viewing this topic.

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: How to wire this setup?
« Reply #50 on: May 19, 2018, 04:53:29 pm »
Ok guys. I think I got it working. I have the arduino and the led strip wired and they work. After a fair amount of frustration I was able to write a program that cross-fades between an array of colors. That's all good.

One minor issue though is if I use analogWrite(pin, 0) it works great for the Green and Blue LED. They both turn off completely. When I use it on the Red LED though it stays on very dim. I assume this is because there is a tiny bit of current flowing still and the reds forward voltage is less than green and blue. Is this correct? If so what do I do to fix it?

I think I need to add a resistor to bring the forward voltage on red below the threshold. Would I need to increase the resistor value for the base resistor that's already there or do I need to add an emitter resistor into the circuit?

Thanks again for all your help guys! I'm almost there :)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2549
  • Country: us
Re: How to wire this setup?
« Reply #51 on: May 19, 2018, 06:08:05 pm »
Add a diode between the transistor emitter and ground.  This will raise the threshold of the transistor base by 0.7V.  The Arduino output pin will then pull the base below the threshold and fully turn off the transistor.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: How to wire this setup?
« Reply #52 on: May 19, 2018, 06:08:26 pm »
With the transistor off it shouldn't matter what the forward voltage is. Do you have a leakage path somewhere that is allowing the transistor to partially turn on?
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: How to wire this setup?
« Reply #53 on: May 19, 2018, 08:26:29 pm »
A little more testing; if I pull the red transistor then the green would turn on. But if I pulled the green and red; blue would stay off. Weird. Anyway:

I turned the transistors around. The package for my transistors says the pinout for my model is different than the other ones you guys looked up. I think they are going the correct direction now. This is the orientation that was super dim in the past. This time though I have that jumper between the arduino ground and wall wart ground so they are tied. I wonder if that fixed the dimness issue. Anyway with this orientation they turn completely off; and are working at full brightness.

Seems to be fine now.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: How to wire this setup?
« Reply #54 on: May 19, 2018, 10:56:18 pm »
Yeah it sounds like that's right then, if they're working then you have it connected properly. I'm not entirely sure what was going on before, maybe the protection diodes in the IO pins of the microcontroller were conducting enough current to switch on one of the other transistors.
 

Offline YoukaiTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
Re: How to wire this setup?
« Reply #55 on: May 21, 2018, 06:30:32 pm »
I wonder if not having the grounds tied together before is what was causing it to be super dim when it was wired with the transistor in the correct orientation. That's the only thing I can think of that has changed between then and now. I didn't have the jumper from Arduino ground to Wall Wart ground before.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2549
  • Country: us
Re: How to wire this setup?
« Reply #56 on: May 21, 2018, 07:24:37 pm »
I believe that was exactly the cause of the LEDs beinig super dim.  There would not have been any return current path for the Arduino outputs.  You could try to verify this by removing the ground jumper to the Arduino.

Sorry it took me so long to reqlize you were using the BC547B transistor instead of the 2N3904 and that you had them wired correctly in the first place.
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12298
  • Country: au
Re: How to wire this setup?
« Reply #57 on: May 22, 2018, 05:02:05 am »
I wonder if not having the grounds tied together before is what was causing it to be super dim when it was wired with the transistor in the correct orientation. That's the only thing I can think of that has changed between then and now. I didn't have the jumper from Arduino ground to Wall Wart ground before.

That is why I said this:

  • The Arduino GND and the 12V GND should be connected together.  Your 12V supply IS isolated?  Correct?

This would be the FIRST thing I would attend to.

Without a solid ground connection, any voltages between the two sections of your circuit would have been from parasitic and non-obvious sources.  Getting anything to happen was a miracle.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf