Driving neopixels using the glowbit library on a pico

Hi Liam,

And I am butchering up an ATX PSU tomorrow into a bench supply that I can use for the 5V supply instead of the 12 V battery and the buck converter to see if the system is suffering from power bus sag …
and poking around with a borrowed 20MHz 'scope

inch by inch …

2 Likes

Scratch trying the scope - stupid windows - USB device … All it did was abort windows.

1 Like

Hi Murray
Don’t know what you are doing here but a scope is the only thing you are going to be able to use to see any glitches, particularly ones caused by peak currents coinciding with any PWM control. I am not certain but I think each pixel has its own PWM control of brightness. Irrespective where it may be happening a scope across the 5V line will tell you if the voltage is sagging due to overcurrent.
Cheers Bob

1 Like

Hi Bob et al,

Managed to snarf a real scope and the 5v line is rock solid … it was not the worlds most up-to-date scope, but there was no difference in the trace apart from vertical position change up from zero as the 5v came on.

The scope is not up to scratch enough to look at the data line to the pixels though.

I could see the scope picking up some ripple from the room lights (or its’ own internals) but the ripple level never changed, nor was there any dip from the 5v level, irrespective of pico powered up with no PIO LED driver loaded, or powered up and all 3 PIOs running …

Just finishing up the ATX PSU bench supply so will try that tomorrow as there is 14A available on the 5v rail - that should provide enough oomph for all the LEDs!

Murray

1 Like

Hi Murray
I will admit I am at a bit of a loss here. When you monitor the 5V rail I assume you are running the scope time base at a slow enough speed to pick up everything. I would run it at about 5mSec per div. and any dipping will be apparent.
With my simple set up I am running 2 strips of 150LEDs each in parallel and only running running a sketch as if I were only controlling one strip. Also a 5V Arduino so I don’t have the conversion problems. Running 2 separate LED strings is my next experiment when I get to it. I am not at all familiar with Pico or any other RPi product so would not comment or suggest anything pertaining to your programming.
If your programming is OK and power supply has enough grunt there must be something silly going on. It would be interesting to see a circuit sketch of exactly what you have. It is almost impossible to decipher anything from the pics
Cheers Bob

1 Like

Hi Bob et al,

Here is a schematic of the LEDS …

I was running the scope at the lowest sweep range (10-100Hz - it is an old TRIO CO-1303G CRO).
I have now re-acquired a 20MHz scope and will retry the power glitch search, and start to look for other glitches on the data lines.

Question - does anyone have complete specs for the neopixel versions used in the arrays?

Cheers
Murray (not yet a KiCad expert …)

Hi Murray
You have the level shifter on your schematic marked as “DFR0831”. when you search for that it comes up as the 12V - 5V DC-DC converter. I think you have the two mixed up. What actually is the level shifter. From that circuit provided all the grounds are connected, The 5V has enough grunt and your program is OK I don’t see why this won’t work. You may have to use the scope to make sure the level shifter is doing its thing. 2 channels will be useful for this.
Cheers Bob

Duh - CE07510 level shifter
M

Hi Murray
That is better. If the criteria above are met this should work. Have you tried using the larger 5V supply yet. That would be interesting. I would use that to do the rest of your trouble shooting until you find your problem. That will at least remove one thing out of the equation. There is nothing much harder than fixing anything with more than one problem where each fault will mask the effects of the others. Eliminating each possibility one by one is the only way to go under such conditions.
Cheers Bob

Hi Bob et al,
First the power monitoring test with the new (also borrowed) scope and the existing power, then yep, swap in the big guns and look again on the scope, as well as checking the actual arrays driven in isolation, and all together per the event code.

Lots of individual tests to be done.

I have noticed that I need to give a reasonable power down (reset) gap between each cycle, as sometimes LEDs that were locked on at the end of a test, would light up again if I powered up too soon. Not sure if that is the 1000uf cap holding up enough energy across the powerdown/up cycle, or if there is some ‘memory’ action within the pixels ???

My theory is given that the pixels ‘pass through’ the data stream, and only ‘execute’ the data on the long trailing low gap, I assume that the pixel is remembering the last state until the power level goes completely to zero, so it is probably both the energy reservoir in the cap, and the internal memory operation within the pixels holding state.

Murray

Hi all,
Well this explains the 3W LEDs … They are neopixel-ish! but very out there timing - they need to run slower than the current WS2812(etc) chips. Some PIO re-engineering to be done here soon

Data sheet for the driver chip

Murray T

1 Like

Given the previous ‘discovery’, I am looking for but can’t yet find the actual spec for the pixels in this chain of leds that I am using … I have a elephant stamp ready for whoever finds the details :elephant:

Murray

2 Likes

Good. That is another thing not eliminated but isolated.
While trouble shooting disconnect that 1000µF cap. It will not get rid of high frequency noise due to its in built inductance and could cause more trouble than what it is supposed to eliminate. It will be a short circuit at switch on and could cause shut down of your 12V-5V converter due to overcurrent.
Cheers Bob

1 Like

Hi Murray.
Add on to above. I will try to explain why that capacitor is there on some things but not others.
When you are switching a relative higher current lots of strange things will happen. Best explained by thinking of a PWM driven motor speed controller. If you have a long wire connection from your supply to the switching circuit there is a pumping action and your long wire could have appreciable inductance. If this inductance is high enough the pulsating current will cause an artificial increase in apparent voltage at the supply. This could be 1 or 2 volts or even more if the current is high enough. This means that with long wires the 5V could rise to 6V or more.

The cure for this is to have the length of wire between the supply and switching point as short as possible. You may have noticed that battery golf buggies have what seems sometimes a ridiculously short wire between battery and switching controller. If you have a long wire it is impossible to set up a low voltage shut down with a variable supply, if you have a think you will realise why. The other alternative if long wires are needed is to put a large capacitor AT THE SWITCHING POINT. Which means your 1000µF cap is in the wrong place anyway. It should be right at the supply input on the LED string provided they are close together or if not one at the input to each string.

Looking at your pics it is not impossible that while current is being switched all sorts of things could be happening. There will be lots of stray capacitance around too but this should be in the pF range.
So it is very possible that some of your problems might be due in some degree to the wiring layout or “rats nest” as it used to be commonly known on your testing set up. In particular the wire length from your 5V source to the LED strings. Don’t forget the negative or ground wire length is included here too.

As a practical example I have a bit of a project under way and I have some unwanted pF floating around causing a bit of a problem. However when I look at the “rats nest” of bits plugged into a proto board I have decided to reserve judgement until I have built it a bit better.
Cheers Bob

4 Likes

Hi all,
hmmm, On poking around with the scope, I have found that the HV side of the CE07510 level shifter, even with no attached load, is only just outputting about 3 volts on the pulse train for the LED arrays.

Given that all the LEDS are powered up at 5 volts, I am wondering if the data signal is not ‘robust’ enough to properly drive the neopixels and the 3w LEDs … it certainly works ok for the Glowbits WS2812Bv5 chips, but seeming not for the WS2811 chip in the 3w LEDs, and whatever is in the neopixel string …

Question for the Core team, is there a rise time issue on the level shifter? I can see a full 5V on the HV side if there is no data stream present - i.e. the LV side is static at 3V.

Will try the neopixel string on 3V supply to see if it can follow the 3V data line, all directly from a pico …

Murray T

3 Likes

Hi Murray

It certainly looks that way. Those Level Shifters are just that. They will shift the voltage but supply virtually no current. The reason being that the voltage is supplied via about 10kΩ resistor which will limit the current to 0.5mA when shorted.
The thing I don’t understand is

Is with the data stream source connected and just no data or is the source disconnected. As the 3V and 5V is present when the Mosfet is OFF I would expect to see that reduced voltage even with no data if there was a problem on the 5V side.
Is there any chance there is some sort of pull down on the 3V side. If so the Mosfet could be ON and such a pull down would form the bottom leg of a voltage divider with the 5V side pull up. I am pretty sure the pull ups in the converter are 10kΩ and if there is anything like 10kΩ to ground on the 3V side the 5V would only get to 2.5V.

There is another possibility here. The 3V signal on the low side MUST be the SAME 3V applied to the level shifter or the Mosfet will not turn off. If the signal is lower than the applied voltage to the converter The Mosfet will be on or partially on.
You do have the 3V connected to the level shifter don’t you? Even though your use is only one way it still must be connected.
Cheers Bob

2 Likes

Hi Bob,

The level shifter LV side is powered by the 3V3 pin of the pico, the HV side by the 5V output of the buck converter, and the data is from pin 18 (glowbit), 19 (neopixel) and 20 (3W leds). The ground is also connected even though it has no electical connection within the level shifter (effectively just a ground plane).

The data pin is connected, and set high for the static test. Any other pull down resistor would be within the pico.

The circuit is as shown in the schematic previously, ie no other resistors before the level shifter.
(and re one of your other comments, the 1000uf cap is actually located on the power common buss where the various arrays power from… depending on the array, it is within about 10cm of the first neopixel and 3w LED, and about 20 cm to the Glowbits)

Murray (I still dislike USB/win10 scopes, but it is working)

2 Likes

Hi Murray

Never used one. I have a stand alone scope. Of modest specs but digital and does the job.

Cap position sounds OK. What does the 5V signal look like with LEDs disconnected. Data disconnection will do. If data is Ok with nothing connected on the 5V side this all points to the LED strings requiring a little bit of drive CURRENT. Which the Level Converter will not do.I would be nice if you had a 5V device you could program up without using the converter to prove this.

Assuming the 5V data is OK with no LED strings connected and the problem proves to be level shifting there are a couple of ways around this.

As you are only shifting one way you could use an OP Amp to provide the grunt.

  1. As a comparator to switch. With about 2V reference to the inverting input and the 3.3V data on the non inverting input which would probably require a bit of hysteresis to ensure positive switching. The logic level converter is discarded. Supply to OP Amp is 5V. High input impedance requiring almost nil current.
  2. Retain the converter and connect OP Amp as voltage follower. That is connect 5V data direct to non inverting input and output direct to inverting input and to LED string (via 220Ω resistor if you choose. Extremely high input impedance, safe to say zero current. OP Amp supply 5V.
    The OP amp will provide any required drive current.
    My OP Amp of choice is LMC6484 as it is very close to rail to rail (0V to 5V), Wide operating voltage range and readily available. Rise time specs are modest but pretty good, would be OK for your application. Device is Quad amplifiers, Dual is LMC 6482.

Keep going there has got to be something fixable.
Cheers Bob
PS. Just realised this data string frequency could be quite high so you would have to try this OP Amp and see. It may not be OK as a switch but OK as a voltage follower (this mode requires fewer additional parts anyway) and would be simpler to try.

2 Likes

Hi Murray
Add on.
As another alternative if level shifting is proven to be your problem. I seem to recall during browsing seeing Level Shifters that seem to have OP Amps built in. Maybe this type has some better drive capability and you could consider changing types.
Cheers Bob

1 Like

Thanks for the suggestions Bob.

I am also looking at this chip

and the associated data sheet

It has a rise time of 2 nS/V and typical/max transitions of 3.8/5.5 nS … as the neopixel switching rates are multiples of 125 nS this should give good transitions and clean edges. And hopefully full range swings.

Your comments re current drive requirements may still be an item to check out.

Murray

1 Like