2026-01-06

Garden LEDs

I installed LEDs in the garden over a year ago, on the fence and over the hot tub. It worked well.

This year things broke, and I have reinstalled, going for 12V working this time, and latest LED strips.

Overall, 12V LEDs can be much better.

2026-01-05

WS2812

I have been using "WS2812" based LEDs for some years - both on PCB using tiny 1x1mm LEDs, and on LED strips, and fairly light chains and so on. These types of LEDs are becoming very popular, with a range of subtle variations (colour order, if RGB or RGBW, and all sorts of other attributes like voltage and backup data lines).

The key feature is they work by a serial data stream that is chained along the LED strip. Each LED eats its data bits and then acts as a passthrough for remaining data until a reset pause, when all LEDs apply the new value to the LED itself. A clever system really.

For use on PCBs, I have already blogged on use of 1.5mm x 1.6mm shallower version of the same Xinglight LEDs that are way nicer in many ways. I can litter a PCB with status LEDs in all sorts of styles, and have done so on various PCB designs, all using a single GPIO pin to drive them.

But even on a board with just one status LED, this still makes a lot of sense using just one GPIO.

This recorder board is a nice example, 7 LEDs on the board. Making rows of LEDs as a level indicator is great.

Drivers

The fun is drivers for this. You need a way to control the LEDs and what they show.

Thankfully Espressif have a driver, a managed component led_strip, which allows you to create a strip with LEDs in a variety of formats, update LED values, and send.

They use the RMT hardware, which is intended for generating pulse streams used for IR remote controls. This makes a lot of sense to generate the exact timing. Here is an example of timing needed for WS2812.

So, pulses 400ns and 850ns, and gaps 850ns and 400ns. Makes sense to use RMT.

But wait, here is another WS2812 data sheet...

This has pulses 400ns and 800ns, and gaps 850ns and 450ns! OK, both say ±150ns, but why different?

A similar chipset SK6812 has these...


This is rather oddly specified as 1.25us total, but pulses of 300ns and 600ns, but gaps of 900ns and 600ns. So very different, and also adding up to 1.2us not 1.25us.

On face value this does not overlap the spec for WS2812 (either one) quite. But close.

The LEDs I am using are Xinglight, and they have a data sheet of...

This is very different, it lists minimum pulses only, of 300ns and 900ns, and gaps 900ns and 300ns, and a longer reset time.

But the part number is XL-1615RGBC-WS2812B includes WS2812B in it, yet this is different to WS2812 timings (either of them). But this overlaps with WS2812, which is good, well sort of, 850ns fails a minimum 900ns, so sort of.

But let's look for the data sheet for that exact part again, and oh, now I see.


What the hell? This is a 1.75us bit timing, and not an overlap with WS2812. Also, note, they have max 0 280ns and min 1 650ns, so what happens between those - there has to be a decision to read as 0 or 1.

But surprise! They all work using the same driver. It really is an appallingly crap set of data sheets.

Using SPI

RMT is great for exact timings, but struggles with the amount of buffer you need (4 bytes per bit) and struggles to cope under heavy load - even when set to use DMA - so when re-flashing the LEDs go disco.

An alternative way to drive these LEDs, which the Espressif driver now handles, is to use the SPI bus, to clock data. This would not handle things like 450ns and 800ns, but can do nice round multiples like 400ns and 800ns pulses and gaps using 3x clock and coding 100 and 110 per bit.

In practice I have made my own SPI drivers now. This is because I want things the Espressif drivers will not do, such as multiple strips on same GPIO but with different RGB order, or RGB and RGBW stacked up. I also want switching one SPI between different GPIOs cleanly with no glitches. The earlier LEDs will quite happily pass on the controls for the later LEDs even if different order and format - clever isn't it.

My code does allow for different chipset timings, with WS2812 being 400/800 and 800/400, SK6812 being 300/900 and 600/600, and Xinglight being 300/900 and 900/300. But I have found with a lot of testing that basically all of these work with various different types of chip. Crazy.

So I have settled on a simpler driver being 300/900 and 900/300 as that seems closest to being in spec for all formats. It makes encoding simple, 4 bits on SPI bus per bit of data on this, so coded as 8 or E per nibble.

I have no clue why so many subtle, but sort of overlapping, and sort of working specifications. What is crazier to me is the exact same chips seem to have multiple data sheets with different specifications.

In practice, it should be simple, a pulse below say 500ns is a 0, and over that is a 1. A gap of under say 50us is a gap to next pulse, and beyond is a reset. There is no need for a ± on any of these, just a clearly defined minimum and maybe a minimum pulse 100ns and recommendation to stay 50ns away from the limits to allow for rise/fall times on real wires.

I have found some cases of differences though. Initially my SPI code switching GPIOs caused a glitch before a gap (reset) then data. This worked on various LEDs, but one WS2811 fairy light strip failed with glitching and corrupted LEDs. I fixed the SPI glitch and it was fine. But it showed a clear distinction in how reset was handled and how a glitch was handled on some chipsets.

2025-12-28

Getting old?

I have done a couple of videos on some history, which may interest some people...

2025-12-23

Christmas hassle

A new rant, again as a video...

It seems Companies House are more of a pain in the arse than I realised. Not just new ID crap on "confirmation statement" but also for anyone that is a PSC and not a director on anything company it is 14 days from start of month of birthday. Worse, it is not a deadline, it is a 14 day window - you cannot confirm ID now, you have to wait for the right moment, FFS. Why?

But also hassle with Wex and Royal Mail and Amazon (again).

2025-12-20

Another rant at Amazon

This site was "RevK's Rants" and someone said that seemed unprofessional and I changed it - I may change it back as the whole idea of this was to be "personal" not "professional", and anyone thinking the MD of an ISP "Ranting" on a "personal blog" is "unprofessional" does not comprehend the difference between "personal" and "professional".

This problem is that some or many of my reason to rant are work related. Indeed my first rants and reason for making the blog, separate from work status pages, was because of dealing with BT as a supplier. So maybe leave the name for now. But somehow I need a way to say "personally this is bullshit" separate from "As MD of an ISP I do not agree with the way this supplier handled this situation".

However, this time is a proper rant at Amazon, yet again, but as a video this time.

Enjoy, and if you are considering dealing with Amazon, then also "beware"...

2025-12-17

Going mirrorless

I have used Canon SLR for a long time (decades), with an upgrade every few years.

But let's start by saying I am not a professional photographer - I understand the logic and rules but lack some of the eye you need. However, I have managed to get a few good pictures, and use cameras for things like product shots. Indeed, product shots are probably the main use these days. I have however done some sports (ice hockey, and even some at F1). I got started on this as we sponsored ice hockey and so having lots of shots from matches was good for showing company name. On some occasions I even had live stills updates on a web page with overlaid score board on image for some matches. The high end Canon SLR cameras were very good for that, and as always proper lenses get really good pictures - there is really no substitute for proper glass. Sports with long, L, IS, lenses, gets some impressive shots.

But the last SLR was 5½ years ago, the Canon 1Dx MkIII. I finally decided it may be time to upgrade. The trade in value of the 1DxIII is surprisingly good though.

To be fair, I had tried a Canon R (mirrorless) when they first came out, and actually sent it back. But they have moved on, and have a range of cameras. Yes, the model numbers make no sense numerically.

The new camera is the Canon R5 MkII, with EF to R adaptor for my EF lenses.

Some simple observations after a couple of days...

  • The good news, as expected, is it fits the EF lenses with the adaptor, and just works. No need for new lenses.
  • It is smaller and lighter, which feels strange, but makes sense.
  • The view finder works well, but getting used to using the display more anyway for product shots (I was starting to use more on the SLR).
  • The operation and menus is all familiar - very much the same as the professional SLRs, but extra features and options.
  • The images are stunning, and 45Mpix. I have yet to play with video, but it has options to fill my memory card in like a couple of minutes if I want (8K60p movie grade video!).
  • I don't like the tiny batteries - I am used to the SLR having larger batteries that last for ages. But for product shots it just needs a dummy battery / power supply anyway.
  • The product description listed Ethernet, which I used on the SLR, but it is actually an optional (expensive) extra. WiFi works but not as fast, but will suffice for now.
  • It has some interesting extra modes, an Fv which is lots of auto with overrides, so easier than M but more flexible than just Av/Tv. It also has an totally auto mode - which hides/limits loads of settings and works very much like just using a phone camera - point and click and it does a really good job of picking things that work - handy in some cases, especially for someone that is not a professional photographer.

Playing with HEIC

A separate thing I tried is more on HEIC. My SLR had this, and I ended up using JPEG. RAW was always an option, but for product shots a max quality JPEG was just simpler.

HEIC is used more and more now - my iPhone does it, and various tools just work with it, and I can use in web pages - but product pages on web sites are not up to it yet, so I end up converting to JPEG. As I found last time JPEG direct from the camera is always better than HEIC later converted to JPEG, So somewhat annoyingly I am probably sticking with the max quality JPEG, at least for now. I suspect tools will get better or I will find better tools on my Mac.

Basically, RAW, needs special apps/tools to process and will have to be converted - and I love the idea of RAW to PNG actually, must find a way. HEIC is not as bad in that HEIC is a common standard, but still needs work. Using JPEG direct from camera needs very little work, though I have to crop or scale for Mastodon as 45MPix is too much for it!

I am very pleased with the product shots, and have started to add LEGO minifigs for scale :-)


"This gate, ..., is plastic"

2025-12-12

AJK

A long long time ago I mashed my initials together in to a sort of logo. I was what, 12 or something, not sure...


It is really simple, but even now I realise it works well for a few reasons - mainly it is mono, so easy to do in any colour, and also it is simple stroked, to works in various special cases like raised or indented lettering. It is also relatable to the matching letters "AJK".


I find it amusing that an idea I had literally decades ago as a child, and one that is so simple, is now a logo I am finally using, even with a UK registered trademark!

Garden LEDs

I installed LEDs in the garden over a year ago, on the fence and over the hot tub. It worked well. This year things broke, and I have reinst...