Testing an RGB LED Matrix With Different Supply Voltages

by kevinjwalters in Circuits > LEDs

141 Views, 1 Favorites, 0 Comments

Testing an RGB LED Matrix With Different Supply Voltages

rgbledmatrix-voltagetest-fullsetup-TEST-43.jpg
rgbmatrix-voltagetest-boardonly-1.jpg
ga-rgbmatrixboardrear-crop-43.jpg

Strips and grids of RGB LEDs are typically powered at 5V or 12V. In the absence of a credible datasheet these can be tested** to determine if the LEDs still work at lower voltages and to observe any associated effects on brightness, colour balance and current consumption. This is useful if 3.3V is only available for a 5V strip or if the power supply voltage drops considerably with high currents. Understanding the current draw can help to implement brightness limits in software to stay below the maximum permissible current.

This article tests the GurgleApps Custom RGB LED Matrix Display (8x8, Full-Colour) in steps from 2.3V to 5.0V. These are addressable 5050 RGB LEDs with an integrated driver chip using the WS2812B protocol. These LEDs are similar to the ones sold by Adafruit as NeoPixels. The tests with updates to the RGB LED values also check if the driver chip still functions correctly at these voltages.

The voltage on the RGB LED data in signal pin is kept at the RGB LED supply voltage for these tests using an improvised simple level converter. The level converter didn't initially work - the broken and working versions are shown and discussed. The minimum voltage for a high bit and maximum for low on the signal input wasn't tested.

** Testing only indicates the behaviour of the device under test. A specification in some form from a credible manufacturer/supplier is the best guide to appropriate voltages for reliable operation.

Supplies

  1. Some RGB LEDs, e.g. GurgleApps Custom RGB LED Matrix Display (this is used in a Word Clock)
  2. A variable voltage power supply, 3 amps should be okay for 64 RGB LEDs.
  3. Some wires of appropriate thickness to connect power supply to RGB LED board. The cheap bunches of crocodile clips sold to hobbyists are unlikely to be suitable.
  4. A BBC micro:bit (or another MicroPython compatible board) for running the tests.
  5. The low-quality signal level converter
  6. Breadboard (the one from the Kitronik Inventor's Kit was used as that has a very useful edge connector breakout board).
  7. 2x BJT NPN transistors, e.g. 2N2222. BC337 may not work in the final circuit presented here.
  8. 5x 2.2k resistor.
  9. 1x 1k resistor.
  10. 1x schottky diode.
  11. Connectors from micro:bit to breadboard.
  12. Jumper wires.

Test Setup

rgbled-powertest-diagram-1.jpg
rgmatrix-voltagetest-labelled.jpg

The diagram shows the components and how they are connected. The photograph shows the actual devices minus the power supply which is out of shot. Two multimeters are used for the voltmeter and the ammeter. The crocodile clips on the red and black wires are only used to clamp other wires together. The ammeter has the leads reversed to present a positive value.

The software cycles every 5 seconds through five brightness levels of 0, 6, 22, 58 and 255 used to create white colours by setting the red, green and blue values to the same value. Two sets of RGB LEDs are illuminated, 13 and all 64.

RGB LEDs may use current control or pulse-width modulation (PWM) to vary the brightness of each LED. The latter is used for WS2812B ones. The hope for the ammeter is that it can represent any high frequency variations in current as a reasonably accurate average value.

The BBC micro:bit is running MicroPython with the program rgbmatrix-tester.py.

Testing Supply Voltage From 2.3V to 5.0V

Testing an 8x8 RGB LED matrix with supply voltages between 2.3V and 5.0V

The video above shows all the tests. The brightness level and number of RGB LEDs illuminated are varied in the order below.

  1. 13 RGB LEDs illuminated white (R=G=B)
  2. 0 (off)
  3. 6
  4. 22
  5. 58
  6. 255
  7. All 64 RGB LEDs illuminated white
  8. 0 (off)
  9. 6
  10. 22
  11. 58
  12. 255

This is repeated for each of the voltages below by manually setting the value on the PSU (edited out of the video), the video start time is in brackets.

  1. 2.3V (00:06)
  2. 2.7V (00:56)
  3. 3.0V (01:47)
  4. 3.3V (02:37)
  5. 4.0V (03:27)
  6. 4.6V (04:17)
  7. 5.0V (05:07)

The camera was set to manual exposure mode with a fixed exposure and daylight colour balance. The testing was in a dark room with a small torch illuminating just the LCD display of the multimeter on the left showing the voltage.

The RGB LED colour is obviously yellow at 2.3V (due to the higher forward voltage of the blue LEDs) and off-white at 2.7V. At 3.0V and above they have a white appearance.

The 3.3V testing shows that at full brightness 13 RGB LEDs draw 246mA at 3.28V and 64 RGB LEDs draw 923mA at 3.18V. At 5.0V 13 RGB LEDs draw 516mA at 4.94V and 64 RGB LEDs draw 2.31A at 4.64V. The current flowing when all the RGB LEDs are off must be mainly due to the integrated driver chips, only a small amount (1-3mA) is used by the level converter.

The power supply used for the testing is rated at 2 amps which isn't sufficient. This, together with burden voltage from the ammeter and resistance in cabling is the likely explanation for the drop to 4.64V when the current is 2.31A in the final test.

Level Converter - First Attempt

levelconverter-breadboard-attempt1.jpg
levelconverter-scope-attempt1.jpg
lc-mk1-low-crop.png
lc-mk1-high-crop.png

The first attempt at a simple level converter capable of converting the 3.3V (GPIO output) to 2.0 to 5.0V using two NPN transistors and a few resistors did not work!

The oscilloscope shows the pulses from the microcontroller in yellow at the top and the output pulses in cyan at the bottom. The output pulses are delayed, the first one might be absent, the width is incorrect and the rise time is appalling giving the pulses a rounded look. It's not surprising these didn't work as the WS2812B protocol uses two different pulse widths (at 800kHz) to indicate 0 and 1 values.

The simulation looks good in the Falstad circuit simulator for an 800kHz square wave but this doesn't have a model for the BC337 transistor and looks like it's not modelling the junction (or depletion) capacitance (Cj) and diffusion (or charge storage or transit time) capacitance (Cd). Breadboards introduce more capacitance between the rows.

Level Converter - First Improvement

levelconverter-breadboard-attempt2.jpg
levelconverter-scope-attempt2.jpg
lc-mk2-low-crop.png
lc-mk2-high-crop.png

The first attempt at improving the circuit was to replace the BC337 transistors with 2N2222 transistors. Note: these transistors have the same TO-92 case but the pin order is different. This can be seen in the photograph of the breadboard with the transistors' flat side now on the right.

The first pulse has appeared and the width of the pulses is shorter but the width still does not match the input pulses. These pulses did not work on the RGB LED matrix.

Level Converter - Second Improvement

levelconverter-breadboard-attempt3.jpg
levelconverter-scope-attempt3.jpg
lc-mk3-low-crop.png
lc-mk3-high-crop.png

In this circuit the first transistor's base current limiting resistor has been replaced by a potential divider. This lowers the base current when GPIO is high and provides a slightly lower path to ground when it's low. A more radical change is the addition of a schottky diode across the base-emitter of the second transistor. This is a type of Baker clamp. The two components together are called a schottky transistor and are the basis of Low-Power Schottky (LS) TTL logic.

The pulses are still are rounded but the width is close to the input pulses and empirically this worked for this particular RGB LED matrix.

This circuit isn't ideal and could do with more refinements to provide faster rise times - switching to MOSFET transistors could be tempting. The WS2812B protocol transmits data at 800kHz but it's important to remember these pulses are square and have variable width meaning the bandwidth required is far higher, perhaps 10MHz bandwidth might be needed to transmit these without too much distortion. This is where breadboards start becoming problematic with the high parasitic capacitance.

Going Further

rgbmatrix-voltagetest-3.3v-13-255-daylight.jpg

The photography above shows all of the 64 RGB LEDs illuminated with a value of (58, 58, 58) with a desk lamp to the left.

Ideas to explore:

  1. Test different signal levels on DIN to see when it stops working. This should always be below the RGB LED supply voltage unless the manufacturer/supplier says otherwise. A common scenario is 3.3V GPIO driving RGB LEDs powered at 5V.
  2. Check the voltage drop across the RGB LED matrix particularly at high currents and look for brightness variation across the RGB LEDs. This is easy to do on typical WS2812B and APA102 RGB LED arrays as they are designed to daisy-chain. This will reveal if there's a decent amount of copper on the power and ground traces.
  3. Compare the ammeter values with and without a hefty (1000uF?) capacitor across the RGB LEDs to ensure it's representing the average current well.
  4. Use a power profiler to check how spiky the current is - the driver chip for RGB LEDs typically uses PWM to vary the brightness. Turn on a single RGB LED pixel around the mid-value of 128 to check the PWM rate.
  5. Do some thermal testing to see how warm the RGB LEDs get at high brightness levels. If they are going to be in an enclosure then check that too.

Further reading:

  1. Adafruit Learn: Adafruit NeoPixel Uberguide
  2. Paul Stoffregen Blog: How Much Current Do WS2812 / NeoPixel LEDs Really Use?
  3. World Semi WS2812B-V5/W datasheet (pdf) - specifies supply voltage as 3.7V to 5.3V.
  4. Dongguang Opsco Optoelectronics SK6812 datasheet (pdf) - specifies supply voltage as 3.3V to 5.5V.
  5. Instructables: RGB LED Current Measurement With Nordic Power Profiler Kit II - this shows some NeoPixel power profiling but did not look at the PWM rate.
  6. Instructables: Logic Gate Analyser With Cytron EDU PICO or Adafruit CLUE Demonstrated With MH-EDU-Electronics LogicBoard and Kitronik Inventor's Kit - this features some logic gates implemented with a BC337 NPN transistor on a breadboard with similar rise/fall issues.
  7. Nuts and Volts: Understanding Digital Logic ICs — Part 2 - shows circuits for logic gate circuits including Low-Power Schottky (LS) TTL which uses schottky diodes to reduce switching time and therefore gate propagation delay.
  8. StackExchange: Electrical Engineering: How do I make the turn off and turn on time equal in a NPN transistor?
  9. DigiKey Education Forum: The Real Impact of Breadboard Capacitance on Prototype Designs
  10. Keysight Labs: Breadboards - Trash or Treasure? | S-Parameter Bandwidth Test + Wave Winners (YouTube)