-
Large round LED displays
06/15/2026 at 01:44 • 0 comments![]()
Large displays are of interest to me so I was intrigued by a large display I recently saw in public. It was a round screen about a metre in diameter with horizontal strips of RGB LEDs. It was translucent because of gaps between the "lines". One advantage is that it would be less susceptible to wind as it lets air through. It also allows you to see what's behind it. I don't think it folds; it looks rigid. Here it's used to attract attention with a live video feed. A search readily finds manufacturers and prices are in the order of hundreds of $.
-
Replacing floating point by fixed point for the AHTxx sensors
05/31/2026 at 08:35 • 0 comments![]()
The AHTxx series of sensors, e.g. AHT20, AHT30, measure temperature and humidity. The sensor returns 20-bit values for measurements. They are to be converted to °C and %RH by the formulae given above.
All the libraries I've seen so far do the calculation in floating point. For a small MCU that doesn't have native floating point this pulls in extra library code. I wanted to see if this could be done with fixed point arithmetic.
First the humidity calculation. If we load the raw value into a 32-bit variable, multiplying by 100 will not overflow as the max value is 2^20*100. So we do this:
uint32_t l = raw * 100;
Next instead of dividing by 2^20, we divide by 2^16. This can be done by shifting right 16 bits (effectively taking the MSW of the 32-bit value).
uint16_t w = l >> 16;Now the integer part of the humidity % is in the top 12 bits and the sixteenths of % in the bottom 4 bits. We store these separately. For display we can convert the fractional part to a number between 0 and 10000 in steps of 625, and then use as many decimal digits of that as we want (the accuracy won't be as good as 1/16th %RH or °C anyway). Even a 16-entry lookup table will suffice.
hum->frac = w & 0x0F; hum->whole = w >> 4;A similar calculation is applied to the temperature, except that we multiply by 200. For the temperature range of this sensor this also will not overflow 32 bits. After isolating the integral part we subtract 50. Here's a catch: If the result is negative, then we must add 1 to the integral part and subtract the fractional part from 1 (actually 0b10000 since it's in sixteenths) so that both parts are non-positive.
This has been tested with an ESP8266 module (because of the 3.3V supply requirement) driven by an Arduino sketch.
-
I'd been doing resistor binning wrong
05/29/2026 at 09:58 • 0 comments![]()
I have a collection of axial resistors from long ago; I think it was a grab bag purchase. I had organised them into 12 containers for the E12 series (non-E12 values like 50k went into the closest bin). I realised I had been organising it the wrong way. When I want a value like 50k, I went looking in the 47 or 56 container, but I might be happy to accept anything from 39k to 68k.
So I reorganised them into half-decades, splitting a decade at sqrt(10) or roughly 3.12. Thus 1 to 3.3 in one bin and 3.3 to 10 in the next bin.
Curious as to how many I have in the bins, I weighed the containers, taring with an empty container. The results are in the chart where the vertical axis is grams, and the horizontal axis is the value in ohms. As expected my projects have depleted the middle bins. But I don't think I'll get to use up the 2.2M resistors before I move over to surface mount resistors.
Ken Yap


Ian Dunn
Alex Xia
CanHobby.ca
BlackIoT SAGL
Joren Heit
Michael
Michael Wessel
Adam Wakelin
Alan Boris
supermarioprof
Markus Loeffler
mircemk
Dave
twodogstar
Bohan Xu
Wouter Minjauw
Silica Gel
Rasmus L.
Hi Ken, thanks for liking my #Isetta TTL computer !