2
\$\begingroup\$

First of all I want to say that I'm a complete beginner in circuit design but I really want to do one thing. I'b trying to drive WS2812b LED strip using STM32F103 chip. Since WS2812b use 5V and MCU works on 3.3V I use logic level shifter. Here is a scheme: enter image description here

Here is my LED strip connection sketch diagram: enter image description here

Here is WS2812b scheme: enter image description here

MCU generates data stream using PWM. The strip is only 5 LEDs but I use only one for test. I've connected Logic Analyzer (saleae16) to the data line(2) and I see that data is Ok, i.e. I see 24 waves, each one with period=1,25 us, as required in the datasheet. I have reset time=50us before and after the data sequence.

But the LED doesn't work. I've tried everything. And I was really racking my brain when suddenly found that if I shortly connect additional power wires 1 and 3 (you see them on the scheme) the LED suddenly begins to glow. I can't really explain it. Sometimes, maybe once in 10 the circuit works without this trick. I just switch the power off and then on and it works.

How do I fix this issue? I really hope that someone will help me.

Here is a project schematics.

\$\endgroup\$
10
  • \$\begingroup\$ What does "if I shortly connect additional power wires 1 and 3" mean? Were you not powering the LED strip before and just sending it PWM? \$\endgroup\$
    – user146139
    Aug 13 '18 at 12:29
  • \$\begingroup\$ No, the strip connected to power as you can see on the scheme. But the strip has additional + and GND wires, here you can see that. So these wires are remained not connected. And so if I connect these wires for 1 sec. the LED begins to work, i.e. it glows with the color I've send. \$\endgroup\$
    – folibis
    Aug 13 '18 at 12:50
  • \$\begingroup\$ So it sounds like you fixed it. Just keep those wires connected to power. A pinout diagram for the LED strip might be helpful in figuring out why it works. \$\endgroup\$
    – user146139
    Aug 13 '18 at 12:59
  • \$\begingroup\$ No, no ... I don't connect them to power. I connect additional + to GND (free wires on the scheme) i.e. I guess it looks like a short circuit. \$\endgroup\$
    – folibis
    Aug 13 '18 at 13:17
  • \$\begingroup\$ You need to show (very specifically) how you are connecting the LED strip. Please find a pinout diagram for the LED strip. \$\endgroup\$
    – user146139
    Aug 13 '18 at 13:20
1
\$\begingroup\$

Additional power wires are set to supply external power to the LED strip.
1. not to overload the controller if it is low-power, and.
2. if several LED bands are connected in series - supply external power to subsequent bands. otherwise, due to the voltage drop in the thin wires of the strips, the latter in the circuit will not receive enough power and will either light up barely or not at all.

\$\endgroup\$
1
  • \$\begingroup\$ The OP describes behavior where sometimes they turn on power and the circuit works, but sometimes it doesn't. Although I understand your answer and it is accurate, you really haven't connected your answer to the specific question that was asked. Can you add more information? \$\endgroup\$ Feb 3 '19 at 19:54
1
\$\begingroup\$

I'm not very knowledgeable, but one thing impresses me. In the question, the author has mentioned that he will use a logic level shifter (R4-Q1-R5) because of the difference between the MCU and the LEDs. But the circuit has only one resistor, R4. Can this be the problem?

\$\endgroup\$
1
\$\begingroup\$
  1. 5V Power supply is needed
  2. Circuit with a transistor will do the job
  3. By experience, PWM does not work always very well with a long strip of led (150 ws2812B) and sometimes, you can get problem.
  4. Better to use the SPI (MOSI pin) to send the pulse to the WS2812. With a Stm32F103, change the clock speed to 80MHz (overclocking) or 40 MHz. At 80MHz, the BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32, @40MHz, divider is 16. Encode the value before sending to the leds. The speed will be of 400ns/pulse (80MHz/32=2.5MHz). The value 1 will be: 110 (2x400ns:HIGH, 1x400ns:LOW) and 0: 100.

See the link below: Few Strip of WS2812 with 3V3

\$\endgroup\$

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.