1

I'm following this tutorial to build an Arduino powered RGB led strip controller but I'm facing two problems:

  1. When I use digitalOutput the lights are too dim.
  2. When I use PWM the leds change so slightly that I can barely detect a change.

These are the parts I'm using:

  • Wemos D1 mini
  • a USB cable to power the Wemos
  • 1k ohm resistors
  • TIP31c transistors
  • A power outlet 12V 1A to power the strip (which works fine with the original controller unit)

The circuit connected as presented in the tutorial (like the circuit below) doesn't work, the board does not start.

If I disconnect the board GND from the outlet GND then the board starts but the leds are too dim to be visible

What am I doing wrong?

schematic

simulate this circuit – Schematic created using CircuitLab

5
  • Is your strip also 1m as described in the article?
    – chrisl
    May 7, 2018 at 19:22
  • @chrisl no, its 5m long May 7, 2018 at 19:23
  • why are you applying -12V to a +12V pin?
    – jsotola
    May 7, 2018 at 20:22
  • @jsotola I'm not, I forgot to rotate the outlet May 7, 2018 at 20:24
  • as you've tagged this question with esp8266 - it may be worth noting, that the PWM range for esp8266 is 0...1023, whereas I believe arduino has a range of 0...255 - so, if your code only uses a range up to 255, you're only using 1/4 of maximum, hence ... DIM :p May 8, 2018 at 4:00

1 Answer 1

5

The Wemos D1 Mini is a 3.3V device. With a 1k base resistor, the most base current you're going to get is (3.3V / 1k ohm) = 3.3mA.

Looking at the datasheet, the current gain (h_FE) for the TIP31 transistor is no more than 50. So the maximum current you will pass from collector to emitter is 50*3.3mA = 165mA.

Your base resistor is too large and is limiting the current to your LED strip to no more than 165mA per channel. Try reducing the base resistor to 150 ohm. The TIP31 can handle continuous collector current of 3A, so you ought to be safe with a 1A power supply, and 150 ohm resistor.

UPDATE:

Per @Gerben's comment, the ESP8266 can source a maximum of 12mA from a GPIO pin, so you should not use lower than a 225 ohm base resistor on the initial TIP31. A Darlington pair would look something like:

schematic

simulate this circuit – Schematic created using CircuitLab

11
  • So wich transistor can I use? The fact that my strip is 5m long changes anything? May 7, 2018 at 19:49
  • What is the total current drawn on each channel of the strip? The TIP31 is not what is making your LEDs dim, it's the resistor value on the base of the transistor which is limiting the current that the transistor will allow. If you use a 150ohm resistor, you will max out your power supply before you max out the transistor. May 7, 2018 at 19:51
  • Sorry, misread your answer. The lowest resistor I have right now is 220ohms, meaning the maximum current I can get will be 750mA, is my math correct? Also, how do I calculate the maximum amperage? If I cut the led strip I will need less amps, right? May 7, 2018 at 20:03
  • 2
    The maximum drive current for a GPIO on the ESP8266 is only 12mA. So the lowest value you could use is 225 Ohms. Either get a different transistor, or wire two of them in a darlington-pair.
    – Gerben
    May 7, 2018 at 20:20
  • 1
    @NicosKaralis Maximum current is fixed (in TIP31 datasheet). The collector-emitter current is roughly Current gain times current between base and emitter. Led strip current is known, it's about 20mA per three LEDs for each color (again you need its datasheet or you can measure it).
    – KIIV
    May 7, 2018 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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