Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: Dyspho on Feb 26, 2019, 05:24 am

Title: WS2812 LED Matrix not responding
Post by: Dyspho on Feb 26, 2019, 05:24 am
Hi everyone,

~ this is my first Arduino project and I am a general beginner in electronics.

I am working an a really simple project:
Displaying a specific image on a LED matrix controlled by an Arduino Micro when a button is pushed.

So far I just wanted to try connecting the LED matrix to the Arduino and make the LED change color to see how it was reacting.
Simple, but well, it doesn't work and I have issue to understand where the problem could come from.

I bought a LED matrix that is similar to the NeoPixel NeoMatrix from Adafruit.
It's not for Adafruit but it's made with RGB NeoPixel LED WS2812-2020.

It's this piece to be precise :
(https://www.led-paradise.com/data/peace-corp/product/20180928_0d584e.jpg)

The specs are the following:

Input voltage: DC 3.7 V - 5.3 V (5 V recommended)
Rated power: 5 W (max.)
Operating temperature: -25 to 65 ° C
LED type: WS 2812-2020
Luminescent color: RGB full color (G - R - B order)
Number of LEDs: 64 LED (cut not possible, cascade connection possible)
Accessory: capacitor 220 μF 16 V

I followed the recommendations from the adafruit website and put a 440Ω resistor (actually 2x220Ω in series) between the matrix and the arduino output pin (pin n6).
I haven't solder the capacitor yet, it should work without it (right ?).

Here is what it looks like:

(https://i.ibb.co/ZWWj3bK/arduino-circuit01.jpg)


And here is my Arduino code:

Code: [Select]
#include <Adafruit_NeoPixel.h>

#include <Adafruit_NeoPixel.h>

#define PIN 6 // input pin Neopixel is attached to

#define NUMPIXELS    64 // number of neopixels in strip

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 100; // timing delay in milliseconds

int redColor = 0;
int greenColor = 0;
int blueColor = 0;

void setup() {
  // Initialize the NeoPixel library.
  pixels.begin();
}

void loop() {
  setColor();

  for (int i=0; i < NUMPIXELS; i++) {
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(redColor, greenColor, blueColor));

    // This sends the updated pixel color to the hardware.
    pixels.show();

    // Delay for a period of time (in milliseconds).
    delay(delayval);
  }
}

// setColor()
// picks random values to set for RGB
void setColor(){
  redColor = random(0, 255);
  greenColor = random(0,255);
  blueColor = random(0, 255);
}


Nothing is happening on the LED matrix, they are not lighting up.
Is the problem from my circuit or my code ?
Can I power this Matrix from the Arduino only ?

If you have some tips on this one I would really appreciate !
Title: Re: WS2812 LED Matrix not responding
Post by: Grumpy_Mike on Feb 26, 2019, 09:05 pm
Quote
I haven't solder the capacitor yet, it should work without it (right ?).
So why do you think they include a capacitor then?

Quote
Can I power this Matrix from the Arduino only ?
No.

Title: Re: WS2812 LED Matrix not responding
Post by: PaulRB on Feb 26, 2019, 09:22 pm
Quote
Rated power: 5 W (max.)
64 X ws2812b can consume around 20W at maximum, so either the seller is telling you to not to exceed 25% maximum brightness (perhaps because the PCB is poorly designed), or they don't know what they are talking about.
Title: Re: WS2812 LED Matrix not responding
Post by: Grumpy_Mike on Feb 26, 2019, 09:55 pm
The WS2812-2020 only takes 16mA per colour per LED so that would only give a maximum power of 15.34W, but yes well over 5W.

The maximum current can be just a tad over 3A.

If you code has a single running LED thought then you could drive it from your Arduino's supply.
Title: Re: WS2812 LED Matrix not responding
Post by: Paul__B on Feb 26, 2019, 10:06 pm
3.84 Amps.  OK, whatever!

Having a PCB like that is a perfect opportunity to design a double-sided (as it clearly is) PCB with a ground pour (as it appears) and power rail forming a complete mesh in both axes to provide optimum power distribution.  The capacitor in the middle seems to be the perfect location.

It would be nice to have a decent image of it to see exactly how it is done.  I have ordered a couple of similar ones from eBay to play with as they represented the most economical price per LED but cannot spot or confirm this particular design.
Title: Re: WS2812 LED Matrix not responding
Post by: Dyspho on Mar 04, 2019, 05:44 am
Hi !

Thanks a lot for your answers.

So why do you think they include a capacitor then?
In the documentation, they say to use it if I use a large power source. I assumed powering the LEDs with the Arduino only wasn't a large power source.
Anyway I soldered it now.

I made another try by powering it with a 9V battery.

Here is my circuits:

(https://i.ibb.co/Mh1ftbG/arduino-circuit02.jpg)

I tried to run the same code, and in addition the sample examples code from the Adafruit_neopixel and Adafruit_neoMatrix libraries but nothing happened...

At that point I just don't know how to troubleshoot this.

How can I know if the blocker is from the code or the hardware ?
The connections seems ok but I damaged the hardware because of a bad practice... ?
(on that point, I checked the voltage across all component of the circuit and it seems ok, anything else I can check ?)


Paul__B> I will try to make proper photos tonight
Title: Re: WS2812 LED Matrix not responding
Post by: PaulRB on Mar 04, 2019, 07:58 am
9V batteries are only suitable for smoke alarms and useless for anything else. They can give perhaps a couple of hundred milli-amps. You need a 5V 3A power supply.

Your latest diagram does not show a common ground connection between the Arduino and the rest of the circuit. It won't work without that.

When you get a suitable power supply, 3A is too much to feed through a breadboard. You must connect the power supply directly to the led matrix, but don't forget you also need that common ground connection with the Arduino .
Title: Re: WS2812 LED Matrix not responding
Post by: Grumpy_Mike on Mar 04, 2019, 09:08 am
Quote
In the documentation, they say to use it if I use a large power source.
That is absolute rubbish. When using a voltage regulator you always need a capacitor.

Quote
How can I know if the blocker is from the code or the hardware ?
A very good question and one that goes right to the heart of the fault finding skills you need to develop in this line of business.
A good piece of advice is to never make a measurement without some expectation of what you will see.

Quote
checked the voltage across all component of the circuit and it seems ok
It is best to make voltage measurements from the ground to a component. Keep the ground measurement point fixed. You would spot the lack of a common ground by measuring the voltage on the LED strip's 5V and seeing nothing, if your meter was on the Arduino's ground or measuring the 5V on the Arduino and seeing nothing if your meter was on the LEDs ground.
Title: Re: WS2812 LED Matrix not responding
Post by: Dyspho on Mar 04, 2019, 04:08 pm
Thanks for your answers.

My bad, I made a mistake on my diagram but I did connect my arduino's GND to the breadboard ground.

Grumpy_Mike> Thanks for the measurement tips !
I retested the whole circuits keeping the ground measurement fixed.
It seems ok as well !

Ok, I guess I have to find a 5V / 3A power supply now and try that out !

Silly question then, I suppose I also have to change my regulator ? and plug a 5v / 3A regulator ?
So far I am using a 5V / 1.5A regulator...




Title: Re: WS2812 LED Matrix not responding
Post by: Grumpy_Mike on Mar 04, 2019, 05:08 pm
Quote
I suppose I also have to change my regulator ? and plug a 5v / 3A regulator ?
No the current rating of the regulator is only the current it will pass.

Quote
I guess I have to find a 5V / 3A power supply now
If you use a 5V power supply then you don't need a regulator.
Title: Re: WS2812 LED Matrix not responding
Post by: Dyspho on Mar 15, 2019, 02:30 am
Hi there,

I finally got a 5V / 3A power supply and made this circuits:

(https://i.ibb.co/hMKV88D/arduino-circuit03.jpg)

The arduino and the led matrix share the same ground (both connected to the Jack-In interface).

But nothing is happening, the led are not lighting up.
I tested the voltage along the circuit (keeping the same ground) and the led are receiving a bit more than 5V and the charge is 3A.

Is this electronics right this time ?


Title: Re: WS2812 LED Matrix not responding
Post by: Paul__B on Mar 15, 2019, 07:07 am
Your diagram show the right-hand resistor connected to a different row to the data wire to the LEDs.  Is this significant?
Title: Re: WS2812 LED Matrix not responding
Post by: Grumpy_Mike on Mar 15, 2019, 08:43 am
Also still no large capacitor shown.

Do you actually have a 5V Uno or do you have something else.

What about that photo of your wiring?
Title: Re: WS2812 LED Matrix not responding
Post by: Dyspho on Mar 26, 2019, 03:10 pm
Hi !
(Sorry for the slow replies, unfortunately I can't work on this project recently  :smiley-cry: )

I am really sorry for the imperfect diagram I sent last time.

Here is a correct one:

(https://i.ibb.co/CbkCPZN/arduino-circuit04.jpg)

I really thought I said what model of Arduino I was using in my first post but I didn't, my bad.
I am using a 5V micro.
And I've sold the capacitor a while ago on the matrix led.


What about that photo of your wiring?
You mean, you want a picture of my circuits ?
Title: Re: WS2812 LED Matrix not responding
Post by: Paul__B on Mar 26, 2019, 10:12 pm
I really thought I said what model of Arduino I was using in my first post but I didn't, my bad.
I am using a 5V micro.
And indeed you did say that in your first post.

You mean, you want a picture of my circuits ?
Always a good idea.  Quite often what people show in a diagram does not resemble what they actually built!

Well, I have received my 8 by 8 matrix modules from eBay, not tried them yet but these do not have the mounting tabs, or the position for the capacitor.  Probably not relevant to this discussion as I am not using a Micro - though I did order one of those also.  May find time to try it ...

(https://luckyretail.com/Uploadfile/201804162/151989/151989-7.jpg)(https://luckyretail.com/Uploadfile/201804162/151989/151989.jpg) (https://www.ebay.com.au/itm/8x8-64-LED-Matrix-WS2812-LED-5050-RGB-Full-Color-Driver-Board-For-Arduino-B9F8/292544173044)
Title: Re: WS2812 LED Matrix not responding
Post by: blender- on May 08, 2019, 01:15 pm
So did any of you guys get these to work?
From what i gathered the 2020 runs on a different clock speed, 2Mhz vs 800 KHz. I assume the neopixel library would have to be updated?