mailto: blog -at- heyrick -dot- eu

This is a long one today. So get yourself a tea (day) or hot chocolate (night, mini marshmallows optional but recommended) and strap in.

 

My heated blanket died

Yesterday morning, woke up, flicked on my heated blanket, checked the weather. It wasn't good, and it wasn't warm.
Neither was I.
What?

I looked down, saw the little red glow of the heated blanket was absent. Nothing. Not a peep.

Luckily I had a backup that I got from Lidl a couple of years ago, so I quickly swapped blankets.

I suppose I shouldn't be that upset, here's a screenshot of a video I made of a little trip down to Châteaubriant on the 14th of December 2019, just before I came down with a terrible...flu? Covid before Covid was known? Do you remember that? The days before Covid?

A screenshot from a video from 2019!
Wow, I forgot how straight down my first car's rear was.

Anyway, December 2019 to 20, to 21, to 22, to 23, to 24, to 25, to 26, and a month extra. I think this heated blanket has done me well. I actually expected the heating element to have worn/broken/given up years ago but it looks like it's the controller that failed.

 

Heated blanket repair

Oh, come now, you didn't think I'd just drop it in the bin without opening the thing up to find out why it had failed, did you?

This is why.

A circuit board with something missing.
The problem is plain to see.

If you didn't spot it, it's a 12KΩ resistor on the right hand side - it obviously overheated. Now I'd love to say "and fell off" but, well, I could see no trace of a resistor.

And, let's face it, that load of chained resistors is freaky. It's a single layer PCB, so we have one track (on the right) that has four tiny 12KΩ resistors one after the other. The last splits off for a different path that has five 30Ω resistors in series.
Why on earth is it being done like this instead of a ~47KΩ resistor, and a 150Ω one respectively?

The moment I touched the third resistor along, it fell off. So, okay, resistors aren't the most accurate things, so I guess it'll suffice to bung a 20KΩ in place of the two 12s, so see if this thing can be revived.

A bodged repair.
This is what's known as "An Engineer's Fix", aka a bodge.

Reader, yes it can.

Clearly, due to the Blue Petering of this repair, I won't be using this blanket in my bed any more - though I think I could use the older blanket with the newer controller? I'll need to measure the output and resistance of the blanket itself.
Anyway, I can't use this, in this state, in bed. But I can, if I felt cold enough, put it around me when I'm sitting writing this, instead of the little heat pad that's on my lap.

 

This is the track side of the circuit, with most of the components on it.

A photo of a circuit board.
The track side of the board.

And this is the other side, flipped horizontally so that the components seen here line up with the picture above.

A photo of a circuit board.
The component side of the board.

The premise is pretty simple. Power comes in and it gets dropped to about 5V for the microcontroller. The microcontroller reads the desired "heat" level from a slider switch that connects two contacts together - the top row of contacts are all common, it's the ones closest to the microcontroller that select the actual heat level.
The microcontroller then bangs a TRIAC really fast. A TRIAC, yes, capitals because it's real name is the mouthful "TRIode for Alternating Current", a type of thyristor, is basically a weird sort of diode that can conduct both ways (because AC swings both ways) when it is triggered.
Therefore, when the blanket is at maximum, say, you're just dumping current into it directly from the mains. When the blanket is at half, the TRIAC will be timed to only allow current to pass for half of the time. This is similar to a microwave oven or induction hub in that it does half power by actually doing full power (all it is capable of) for half the time.
And that's it.

The microcontroller is a Holtek HT66F018 - an 8 bit RISC microcontroller with 63 instructions, 4K×16 Flash memory, 192 bytes of RAM, 64 bytes of EEPROM, and stuff like ADC, timers, PWM...

Now, let's look again at the chains of resistors because this is where it starts getting interesting.

All of this is hanging off the LIVE input. So the big chain of resistors, the 12KΩ ones, is dropping the mains down before it passes through a Zener diode and a 220µF capacitor. It's hard to work out how much the microcontroller actually consumes because it depends on what bits of it are active, but 44KΩ with a 5mA load will drop 230V down to around 10V, dissipating about a watt. At any rate, this is a ridiculously basic way to run a 5V chip from 230VAC input. The resistors will be dropping the 230V down to something more useful, with the Zener diode doing the heavy lifting of voltage regulation. The capacitor will be providing the smoothing to have half of AC (there's no bridge rectifier!) into an acceptable looking DC. It probably helps that the microcontroller uses very little power. Given that there's a lot of mains around this little board, I'm not in any mind to probe around with my multimeter. It works, end of story.

But, wait, it gets better. What about those two chains of 30Ω resistors that barely go through anything before also being fed into the chip? Well, those two pins are the INT0 and INT1 pins, and it's my guess that they are set up in order to generate an interrupt based upon the AC waveform.

Why is it designed like this? Actually, safety. Tiny surface mount resistors are not exactly ideal for dropping mains, there's very little clearance around them. Putting several in series means each is exposed to less overall voltage. Because they are tiny, heat will be an issue so this is also intended to help use the circuit board itself to dissipate heat. You can see from the browning that it was indeed doing this. And, finally, if any one resistor fails as a short circuit (it can happen), it won't be a catastrophic failure. 48KΩ will become 36KΩ, which might be out of tolerance for the Zener to cope with, but it'll be a lot better than a single resistor failing and suddenly dumping the full 230V into it.

What is happening, overall, is that the microcontroller spots a rising edge of the mains. It then switches the heater on, counts for a length of time determined by the power level selected, and then switches the heater off. It'll then wait until it sees the opposite side of the AC, and will repeat this. This way it'll be exactly switching power when there is power to switch.
Also, in the background, it is counting down time (because it turns itself off after two hours).
The microcontroller is maybe a little overpowered for this application, but it's probably cheap enough to use a generic part like that.

As I said, I don't feel confident with a hack-repair to use this blanket in bed any more, especially when there is a small but non-zero risk of me falling asleep and having the timeout kick in. Given the repair was to the method of powering the microcontroller, possible effects:

  • The Zener cooks itself from being run too hard
  • The resistor overheats (though this doesn't seem to be an issue as far as I can tell?)
  • The microcontroller crashes with the blanket powered off (so no more heat)
  • The microcontroller crashes with the blanket powered on (so runaway heat)

I am currently sitting in the kitchen with the blanket wrapped around me, and a fleece around that. My back appreciates it, and between this and the 2kW fan heater, I'm feeling pleasantly warm. This was definitely worth getting out of bed for. 🥰
[that and an absolute need to unload processed tea and then refill]

 

Update a few hours later: Even a heat level 1, the blanket gets decently hot when it is between, say, the chair and my back. It's been running long enough it ought to be turning itself off any time now, and the controller unit is still cold to the touch and I have noticed no unexpected effects. So I'm glad that I have been able to revive this blanket. It's far more powerful than the little lap one. And the one with the velcro for my back? I don't use it, it barely gets warm. 🙁

 

Now, you don't think I'd leave you there, did you? I mean, 150Ω from mains to microcontroller is smokey-smokey time. There's more to this than can be seen from a first glance. And, to be honest, it's brilliantly freaky engineering to use the minimum of cheap parts to get something done. Let's deep dive because, well, why not?

Let's home in on the inputs.

First resistor chain: The mains passes through a fuse and a switch. It goes into the first resistor chain which passes through a diode and also a transistor, and then into INT0 pin.
The diode passes one polarity, while feeding the mains into the base of the transistor does the same thing for the other polarity. So in effect this is a trigger running at 100Hz (each side of the AC waveform).

Second resistor chain: The mains goes into the second resistor chain. There's a small resistor and capacitor to ground, but otherwise this is mains via a 150Ω resistor going straight into the microcontroller.
This is likely a phase-shifted version that is used to verify the interrupt as protection against glitchy interference and/or dirty mains. It looks like it may also only trigger in one sense as there's nothing to invert the signal here.

There are two separate resistor chains because they both have a current budget (remember VIR: current consumption, voltage, and resistance are all interrelated), and it also helps to prevent interference from the signal shaping on one chain from interfering with the other.

But, wait, what? We're practically pushing mains nearly directly into a pin of a dinky microcontroller? Well, yes, yes we are.
But there's a catch.
A very important and big catch.

This catch is the power supply of the microcontroller. This is the 48KΩ resistors passing into a Zener and a diode. Basically a resistive mains dropper. The secret to this is that the Zener is what is defining the ground plane relative to the positive plane through the diode. In effect, the microcontroller "sees" the 5V that it requires, and the 150Ω chains mean that the interrupt pins see, maybe something large enough to trigger an interrupt - maybe 3V or so (I can't be bothered to do the maths here).

How does it do this with the mains? Simple - the microcontroller is actually floating alongside the mains waveform. If the AC is at 127V, the ground is going to be at 122V. When the mains is 230V, the ground will be 225V. Referenced to earth, the power supply of the microcontroller is bouncing all over the place. But referenced to itself, it only sees 5V.
There is no direct connection to neutral. I've not traced the ground plane around, but there's probably some sort of capacitor or somesuch to be a weak reference to Neutral in order to be a functional circuit; but ground as seen from the microcontroller is not ground as it is understood in normal mains circuits, because that would cause smoke, pee, flying shrapnel and other sorts of distress.

Like I said, it's a brilliantly freaky design that means it doesn't need a regular power supply, transformer, optocoupler, or anything complicated/expensive like that. And it works because this a sealed unit. But it's worth noting that "ground" floats just off mains (like old TVs marked chassis live), so one would need extreme care when probing around this circuit. Now do you understand why I wasn't feeling like metering this thing?

 

Shein haul

Now that it is possible to, once again, buy random junk from Shein, I did exactly that.

I previously mentioned the glow-in-the-dark ghost. It's... unexpected. Like a kind of lacquer paint directly on a piece of wood (it isn't canvas with a frame).

A picture hanging on the wall.
A ghost in the light.

And in the dark...

A picture hanging on the wall in the dark.
A ghost in the dark.

In reality, it's not quite as bright as it looks. The camera is quite sensitive, but once it has been illuminated a while, it glows nicely.

I got some glow-in-the-dark tape from The Bezos Tat Emporium and put it on the pull-cord of the light, and also bordered the "Wash your hands" sign. This was done in order to guide me, in the dark, to where the light, and its pull-cord, is located.

I also have other strips of tape by the switch for the lamp in the living room, and a strip along the edge of the wall so I can tell where the wall edge is, and from that know exactly where the bedroom door is.

This next sign, hanging on the wall by the clock, really shouldn't require any explanation. Not that anybody is ever going to turn up, but if they do they had better be British because at this exact moment in time I have six different types of tea and zero coffee. ☺

This is a safe space
Let's have tea and celebrate our weirdness together.

The choices are: Tetley (of course), Tetley decaf, PG Tips, Typhoo, Sweet Sakura (Japanese black), Green tea with lemon (quite pleasing on crappy cold days). It comes in a mug, I have plenty of teapots but no reasons for ceremony. Hot water, sugar, teabag, milk (if appropriate), and a mug to put it all in.

Actually, I lie. I think I have a something like a caramel macchiato (no, I'm not going to bother leaning back and reading the pack to see how to spell it!) for my Tassimo...but it's maybe two or so years old and quite likely long out of date. I would absolutely recommend tea instead, but you knew that already, didn't you...

Three more pin badges. Need I say anything at all here?

Pin badges.
Three new pin badges.

Lurking in the background is a bag of metal pin clips, because these clamp down properly on the pin badge stalks, rather than those silly little rubber things that they come with. I actually lost a ghost in the car park of Lidl, but I heard it fall and was able to retrieve it. But I have no idea where the rubber dodah went. Now my pin badges all have proper clips.

I have now amassed an interesting assortment of pin badges. I think my favourite is the little ghost (surprise!) that is "Living the dream one nightmare at a time".

A box of pin badges.
So I can express exactly how I'm feeling in the snarkiest way possible.

I also got another ghost painting, this one 30×40 (I think). It's a ghost sitting by a fireplace reading. No picture as it is still rolled up.
I really ought to sort out some way of framing/hanging these.

 

On trade with China

Trump is lashing out at the UK striking up a trade deal with China. Thankfully, for the moment, it seems that the EU's proposed trade deal with India has flown under the radar.

I have only one opinion, and that is basically: 🖕

You see, very few countries are properly self-sufficient. We all depend upon stuff from elsewhere to some degree, and given the never-ending quest to "maximise profits" we also depend upon getting stuff made cheaply elsewhere to sell expensively at home. China, somehow ending up as the world's warehouse, ticks both of these boxes. International trade needs to happen, it's what our current economies are built on, and the Trump administration has been doing rather a lot to try to break this, for no real reason other than "because I can" - just look at his insane approach to tariffs (until he chickens out) which seem to be more based on whether something or someone has dented his fragile ego than any actual economic necessity.

So it stands to reason that, if a traditional long-time ally is going to start acting in an erratic and destructive manner, that countries may start to strike up alliances elsewhere. Ones that may have been shoved to the back burner because trade deals with the US were more lucrative...only now that's been turned upside down.

Will China spy on us? Probably. Will the shiny new mega-embassy in London be a hub for spies? Probably.
But don't live under any delusion whatsoever that the US isn't already spying on everybody. Not that exactly need to put any effort into it, for the hapless British government seems quite willing to drop all sorts of sensitive things into the lap of Palantir, and asking a bit of the former Lockheed Martin to handle the UK census. Even as British offshoots, the parent companies are based in the US so The Patriot Act applies. Which means that the British government is not in any position to offer any assurances whatsoever on whether or not British citizen's personal information is in the hands of the Americans, nor can they offer any solid assurance that British/EU privacy laws will be respected. One must surely wonder if the US knows more about British citizens than the British government does. Well, there certainly seem to be a lot of Jedi Knights around...

It is worth noting, on this topic, that there is an increasing push within the EU to wean companies off of American tech solutions. At this point in time, the EU is mostly powerless to do anything useful to get US-based social media companies to follow EU laws in the EU (Elon Musk, I'm looking right at you, you massive piece of shit). This is largely borne out of a fear not that the US would retaliate with "more tariffs!" but that they might instead retaliate by pulling access to American cloud solutions. Even if only for a week, the economic damage could surpass that of Covid's lockdowns. I'm pretty sure that the company I work for uses Microsoft 365, Zoom, and a bunch of other cloudy stuff - mostly because it's much simpler to stick all your crap on somebody else's computer rather than set up and correctly administer your own solutions. This, however, creates painfully obvious weak points and dependencies.

As far as China's rights and humanitarian record go, it's a pretty poor show. That being said, let's look at the US right now. Trump has sent his own Sturmabteilung into several Democrat cities (despite some Republican ones having much higher numbers of immigrants) to round up so-called "illegals" to send them to internment camps in inhumane conditions "for processing". These Sturmabteilung are masked, hot headed, and have in the past month murdered two citizens simply for getting in the way. They don't care about the constitution or people's rights, they'll happily shoot to kill knowing that the administration is quite willing to hold a press conference and blatantly lie about what happened despite video recordings showing what actually happened. And, note, the latest trick, arrest journalists trying to cover events. All this while pushing more and Christian fundamentalist propaganda and stripping away the rights of women in a way that is incompatible with the 21st century. Oh, and in case you haven't noticed, it looks like the Supremes will gather to debate whether or not people born in the US have a birth right to be American citizens, despite the Constitution (14th Amendment) being pretty clear on this point, something that has been upheld for a hundred and fifty or so years - back in 1898 the Supremes ruled that a person of Chinese ancestry born in the US was in fact a US citizen despite their parents being "subjects of the Emperor of China" and this unable to legally immigrate to the US. Let's not even talk about the horrific state of medical care (the leading cause of bankruptcies) or the fact that this government was heartless enough to withhold people's food benefits (the "SNAP" thing) while they were arguing over the budget.
So I don't think the US, in its current state, is in any position to point at China and say "very dangerous".

Maybe he's just a bit butthurt that the world starting to work around the damage? I believe the acronym used online is "FAFO". He did the FA part, and caused a huge amount of reputational harm to his country. What's happening now is the FO part.

 

PS: Speaking of Trump and the US, the DoJ has just released three million pages, 180,000 images and 2,000 videos on Epstein, and that's supposed to be about half of what they have. How evil does a person need to be to rack up six million pages? JFC...

 

Yearly review

I recently had my yearly review with my boss. I wore my "Daily Shitstorm Survivor's Club" pin badge quite prominently, and outlined a list of concerns - because I was not happy. But I didn't shout or scream at her or ask for a salary increase (apparently this sort of thing has happened?) because that's not the point of the review. I was, however, a lot snarkier than normal.

I won't go into detail of problems because confidentiality, suffice to say that staffing absences and people's changing attitudes (I'll talk about this a little more below) are two of the main concerns that I identified, and one way or another it is largely possible to track my other concerns back to one of those two as an underlying cause.

I had some printouts that I took with me, written in English. I explained that I sat at my computer to make a few notes of things that I wanted to cover, and before I knew it I had four pages. So I translated on-the-fly, and didn't edit out the snarkiness.

At one point when pointing out a machine that is breaking down far too often, she did mention that it gets used a lot and it's over seven years old. I immediately replied that the average age of aircraft flying over her head is twice that and major failures would tend to lead to them falling out of the sky, unless it's a Boeing in which case you're just rolling dice when you get on one. [see what I mean about snarkiness?]

At the end my boss summarised my many detailed paragraphs into a few salient points on my review form. And then she summarised me as "an important worker" in my sector, and that my "good humour is refreshing".

😄

 

Now, about the attitudes. This isn't anything to do with the company, it's more something that I have observed as a general shift in people's behaviour. I don't know if it is because of Covid, social media, the economy, or what... but it seems to me that people's mentalities have changed. Not so much that they're selfish or rude (although it could easily be mistaken for that) but more that they just don't care.
The worst part about this is that it would be very easy to point the finger at millennials or gen-alpha or whatever, and while the younger ones do seem to be more afflicted by this (not to mention barely-hidden contempt because they didn't make it as a hairdresser/masseuse/influencer (yes, really)), some of people older than me are also starting to behave like this.
Now I want to be clear and say this isn't everybody - some people are lovely - but others are now doing the bare minimum because they just don't care. I can't help but think that something is changing in France within the social structure and people's attitudes, and it doesn't bode well.

 

New phone

I've just ordered a new phone online. Every two years I can benefit from a price reduction on a new phone. And I might as well take it because the mobile tariff doesn't change if I don't.

I discounted all of the reconditioned phones, and the iPhone (as I have no Apple infrastructure here). I briefly looked at Google's Pixel 9, but it seemed... underwhelming.

I immediately discounted Samsung on account of their increasing tendency to stuff AppCloud into their phones and hide it and make it unremovable. AppCloud, in case you didn't know, is an app that discretely collects a lot of user data (without permission first) and - worse - is able to silently install "recommended apps" on your phone (but if it can install stuff you're profiled as liable to enjoy, it can install anything it likes). Depending on whether or not you believe the Internet, it may also have links to Mossad. Google for "appcloud malware mossad" and you'll see plenty of stories calling our Samsung for falling for this crap.

While I haven't been a fan of Xiaomi stuffing advertising into some of the system apps (none in the Mi10T, some in the Note 12 Pro), it hasn't been especially in-your-face about it, more a small annoyance. And, to be honest, I have been quite impressed by Xiaomi's quirky trick of cutting corners to deliver a reasonably decent phone at a low price. For instance, there is no wireless charging but there is an AMOLED screen. It's not a flagship processor but there's a huge 6500mAh silicon-carbon battery...which can HyperCharge at 100W (though my power brick only goes up to 67W, I might turn fast charging off to help extend battery life). They have also ditched the useless macro camera and improved the main camera. After all, I still traipse around with my aging Samsung S9 and it's half-dead battery, these later phones are for photography, videos, and Netflix.

What is it? It's a (deep breath) Xiaomi Redmi Note 15 Pro Plus 5G (FFS, just call it "Steve" or something). Lacking a 3.5mm jack (boo!), it does at least offer decent (IP65/IP66/IP69(K)) water resistance, special "wet touch" handling so the thing shouldn't lose its marbles if you use it with wet fingers, a 2772×1280 12 bit 6.83" 120Hz display. The one I picked is black like all the others, and it has 256GB storage onboard (there's no SD card). The Orange site doesn't say, but I'm guessing 8GB of RAM. The storage uses UFS2.2 which isn't overly fast these days. The camera claims 200mpix, but I think it's more likely to be useful at lower resolutions using pixel binning for better details and colours - especially at night. It has a 1/1.4" sensor (so I'm guessing about 10mm×7mm(ish) - not far off a 16mm film frame in size) with an f/1.7 aperture. The ISOCELL S5KHP3 features 0.56µm pixels, with a maximum image size of 16,320×12,288, a 10 bit ADC, and Tetra²pixel RGB Bayer. This means that the rather than having individual rows of pixels being alternating red/green or blue/green (there is always twice as much green), the cells are grouped into quads. So you could imagine that the camera is really 4,080×3,072 with each pixel actually being four individual pixels; I'll talk more about this below. As with the other Xiaomis there's no telephoto. Just a fairly decent wide lens and an "acceptable-but-not-great" extra wide. Because the sensor is stupidly high resolution, the digital zoom now goes up to 30×, but note that this is fake - it's magnifying central portions of the image.
Also, its connectivity is USB 2 - another cost cutting measure.

Special Orange price of €99 with a €20 reduction, so I paid €79 with free postage to my local supermarket. Xiaomi themselves are also offering a €50 rebate if I cut out the barcode and take a photo of it, plus the receipt, plus the IMEI...

So, in essence, it looks like I'll get a new phone (and 24 month engagement with Orange, but I have no plans to change) for €29 in the end.
Can't argue that, can you?

 

Oh, and of that €29, there is €14 of it as a levy for private copying (details here in French),

 

Private copying levy?

Yes, in France (and much of the EU), blank media and devices capable of recording have a levy applied. I think the €14 for a phone is a bit steep, I wonder if it's like 5½ centimes per GB or something?

Some outtakes from the above site:

When you buy a CD or DVD in a store, buy a file on a legal download platform, listen to or watch works on a legal online service, or listen to or watch works broadcast by radio or television, the authors, artists and producers are paid accordingly, either from the price you paid or from the revenue of the television stations, radio stations or online services.
Then devices allow you to copy all or part of these works onto media as varied as blank CDs, USB keys, digital music players, external hard drives... without having to obtain new authorisation from the rights holders or pay again.
...
While technical protection measures have been implemented on some commercially available media and by certain legal online services to limit, or even sometimes prohibit, private copying, in accordance with copyright law, related rights, and principles concerning the protection of personal data, in practice these measures generally do not prevent private copying. Commercially sold CDs do not contain technical protection measures, and it is possible to copy music files downloaded from iTunes and other legal online music services onto various media.
...
Finally, a ruling by the Court of Justice of the European Union on June 27, 2013 clarified that the application of technical protection measures must preserve the private copying exception and its remuneration when a Member State has introduced such an exception in its domestic legislation, which is the case, among others, of France.

Unfortunately this sort of thing doesn't apply to the likes of Netflix or Prime Video because you aren't "buying" anything, you're sort of renting it...though Prime does claim to sell you videos, so I wonder how it would go then?
From my experiences with Prime Music, it is possible to download MP3s of songs you've purchased, but they seem to want to make it as awkward as possible to actually do so. In complete contradiction to BandCamp that took my money and was like "here's a bunch of formats, pick whatever you like".
To put this into context, Amazon offers 256kbit MP3 (and only that, going by my two purchases), while looking at BandCamp, my "Walking With Strangers" (The Birthday Massacre) that I purchased as an actual CD, came with several digital download options: MP3 V0 101MB, MP3 320kbit 117MB, FLAC 369MB, AAC 58MB, Ogg Vorbis 69MB, ALAC 376MB, WAV 504MB, AIFF 506MB.
The first two are for general use, the last two are for burning CDs, the rest are for audio nerds - argue amongst yourselves over which format is the best. And, no, Tree Rodent, this isn't an invitation for a comment longer than this blog entry. 😂 I listen on my phone in my car and to streaming radio through a cheap Chinese amplifier, MP3 or AAC at a good enough bitrate that it doesn't sound like a speaker in a big metal bucket is good enough for me.

Anyway, long story short, if I buy a CD then I can rip it to MP3 and put it on my phone. If I buy a DVD, I can rip it to MP4 and put it on my phone. This is all completely legal regardless of what the "You won't kill a cop and poop in his helmet and send it to his grieving wife and then steal it again" notices may say, because this levy has been paid.

 

Quad Bayer Filter

The sad truth about digital camera sensors is that they cannot distinguish colours. They can only respond to how much "light" they see. The way this becomes a colour camera is often by putting red, green, or blue filters over each of the pixels.

Some expensive cameras can stack pixels in order to provide individual red, green, and blue values. Other ones may do it optically, splitting the incoming light into red, green, and blue channels which are then sent to three individual imagers. Due to the size, this is in the realms of television/movie camera equipment.

Mobile phones and inexpensive digital cameras simply stick tiny colour filters over each pixel in a pattern known as a Bayer filter.

Typically these might be arranged like this:

R G R G R G R G
G B G B G B G B
R G R G R G R G
G B G B G B G B
R G R G R G R G
G B G B G B G B
R G R G R G R G
G B G B G B G B

I say "typically" because there is a huge amount of science behind making the best filter with all sorts of variations in pattern and pixel shape. And yes there is twice as much green due to how our eyes work.

Looking from the point of view of the image sensor, here's a quick AI diagram showing how this works from the side.

An AI generated diagram of how camera pixels work.
How the pixels work (the photodiodes aren't actually coloured, it's only done here for clarity).

The Quad sensor in this camera is laid out more like this:

R R R R G G G G
R R R R G G G G
R R R R G G G G
R R R R G G G G
G G G G B B B B
G G G G B B B B
G G G G B B B B
G G G G B B B B

The benefits are to do with light responsiveness in a wide range of conditions, as it can - for instance - combine a group of four pixels into one for low light shots. It also allows manufacturers to claim stupid resolutions which are technically correct, but...

But. But what's the catch?

The catch is down to how the Bayer filter works. Each individual pixel can only see one colour, yet we have full colour photos from the camera.
This works by a process called demosaicing, where each pixel provides the amount of its own colour, and the other colours are merged in by interpolating from neighbouring pixels. If each pixel is a different colour, then you have a good amount of data to work with. Typically your logical resolution will be half the physical with each group of four pixels being all that is necessary to obtain a full red, green, and blue value for that part of the image.

With Quad Bayer, it requires a much larger group of sixteen pixels in order to have full colour information for any part of the image. When you're taking pictures at, say, 12 or 16 megapixels, this is not a problem as it'll be using "pixel binning" and treating each group of four as a single pixel. But if you want to switch to the full hundred, two hundred, whatever resolution, it will now instead be using each pixel individually - which might sound good until you realise that the demosaicing now has a lot more work to do to make a useful colour picture. In effect, your luminance (brightness) is the full two hundred megapixels (16,320×12,288), but the chrominance (colour) is a mere sixteenth of that (only 4,080×3,072). It will produce full colour stupidly high resolution pictures, but just be aware that a lot of the colour information is interpolated. In other words, made up, by looking to see what colours are nearby. Due to how our eyes work, and the quality of the algorithm used, that may be "good enough". The brightness will be good across the image, but the colour details will be just a little bit fuzzy. There won't really be that much improvement between a 200Mpix image and a 12Mpix one created with the same camera because of this. This is why access to the stupidly high resolution modes is often hidden behind some sort of toggle. On my Redmi Note 12, I need to drag out the tab and tap the "50" button to go to 50Mpix mode.

Here is an example. I took a photo of the above diagram in Gimp using my camera at the normal setting (top), and then from the same position with the 50Mpix setting.

Example of high resolution images.
A rough'n'ready comparison.

The top photo is the native one, and it is ever so slightly fuzzy looking because it was zoomed up to match the size of the bottom one, then scaled down to fit my blog's 680 pixel standard width. Even so, it doesn't look that bad. The text is sharper in the real photo (that hasn't been messed with so much), the colours are better, and the overall colour balance came out more accurate. Now, you might not be thinking there's much in it, but remember one image was 12Mpix, the other 50. I'd expect a much greater difference than can be seen here.

So why do this Quad Bayer thing at all? The first is for better noise rejection. Every pixel will suffer noise to some degree. If a "pixel" is comprised of four actual pixels, then chances are that they won't all suffer the same noise in the same way, so this can be used to cancel out a lot of noise - which can make for some pretty decent low light/night shots (so-called "pixel binning"). In better light, this can be used for HDR by splitting the four pixels into two pairs and running each pair with a different exposure, and then merging the results. This is why modern smartphones can take a quick HDR photograph. In the early days of HDR it actually needed to take multiple photos so was susceptible to motion changes between the photos.

The camera in my new phone looks like it may be only slightly lower useful resolution than the one I use at the moment. My Note 12 Pro's camera is 4,096×3,072 (12.5M), but I use it in 18:9 (or 2:1) mode, 4,096×1,840 (7.5M). For me, low light/night, flexibility (like long exposure and focusing on specific things) and decent colour overall reproduction are the things of importance.

In a few days, I guess we'll see how it is. But... oh god... I'm not looking forward to setting up a new phone. Such a PITA getting everything set up just right, installing all the necessary apps, putting the icons in the right places, copying the music library, blah blah blah. So. Much. Bother.

 

I was thinking about linguine, but doing this took way longer than I had anticipated. That dive into the inner workings of the heated blanket controller wasn't planned, but it seemed remiss to not cover it. So, yeah, apart from walking around with Anna, the day has gone and... um... oops. Well, it's cold and on-and-off rainy so I wasn't missing much. But I'm starting to get tired now, so I think I'll do some chicken tenders and a generous plate of chips.

AI generated image of food.
AI generated, but exactly what I'm aiming for...

 

 

Your comments:

Please note that while I check this page every so often, I am not able to control what users write; therefore I disclaim all liability for unpleasant and/or infringing and/or defamatory material. Undesired content will be removed as soon as it is noticed. By leaving a comment, you agree not to post material that is illegal or in bad taste, and you should be aware that the time and your IP address are both recorded, should it be necessary to find out who you are. Oh, and don't bother trying to inline HTML. I'm not that stupid! ☺
As of February 2025, commenting is no longer available to UK residents, following the implementation of the vague and overly broad Online Safety Act. You must tick the box below to verify that you are not a UK resident, and you expressly agree if you are in fact a UK resident that you will indemnify me (Richard Murray), as well as the person maintaining my site (Rob O'Donnell), the hosting providers, and so on. It's a shitty law, complain to your MP.
It's not that I don't want to hear from my British friends, it's because your country makes stupid laws.

 
You can now follow comment additions with the comment RSS feed. This is distinct from the b.log RSS feed, so you can subscribe to one or both as you wish.

David Pilling, 1st February 2026, 02:27
Amused me, TV advert promising a new phone every year - complete with video of punter enjoying his new phone. Probably I belong to the age group who does not like change or does not equate new with better. 
 
TRIACs - triggering at the same time in the positive and negative cycles of the mains, 100 times a second, in sync with the mains waveform. 
jgh, 1st February 2026, 15:12
The highest radiator in my place has air in it. The bleed valve has rusted so I can't bleed the air out. It feels like the entire radiator is full of air. This means that when the water is circulating it is pushing air through the system. 
 
Which, when the water stops circulating, this air accumulates in the boiler. Which, every morning, it detects when it tries to start pushing water through the pipe and finds it's pushing air, and goes into fault standby. 
 
So, every morning I have to take the cover off the boiler and bleed the pump to get the heating started. :( 
 
The annoying thing is the bleed valve on the radiator is on the back, so I can't get alternative tools at it. I'm saving up time, energy, and money to try taking it off the wall to see if I can grip the bleed valve and rip it open, with the backup of having to replace the radiator, and the additional backup of booking a plumber to replace it. My knees aren't what they were when I installed it 20+ years ago. :( 
jgh, 1st February 2026, 15:14
Yes, we "played" with triac-based clock circuits at college. One of the reasons the grid is compelled to keep within a very tight frequency range, as in "the old days" lots of wall clocks kept time from the grid frequency and so the frequency had to ensure it added up to 24hours*50Hz every day.
David Pilling, 1st February 2026, 16:18
Two things sbout the grid - WW2 chain home radar was sync'd to it. Veracity of videos can be determined by extracting 50Hz noise - there are records of frequency. Thing about triacs and thyristors is they switch off when zero volts is across them. So they have to wait in an off state, trigger on, then wait again for the zero-crossing of the mains turning them off, whence they wait again.
jgh, 1st February 2026, 17:07
"Not so much that they're selfish or rude ... but more that they just don't care." 
This is what annoys me about job adverts. "We are looking for a passionate...." Sod that. It's a job. Just ****ing pay me and I'll ****ing do the job. 

Add a comment (v0.12) [help?] . . . try the comment feed!
Your name
Your email (optional)
Validation Are you real? Please type 10070 backwards.
UK resident
Your comment
French flagSpanish flagJapanese flag
Calendar
«   January 2026   »
MonTueWedThuFriSatSun
   23
79
13141517
19202223
282930 

(Felicity? Marte? Find out!)

Last 5 entries

List all b.log entries

Return to the site index

Geekery
 
Alphabetical:

Search

Search Rick's b.log!

PS: Don't try to be clever.
It's a simple substring match.

Etc...

Last read at 06:48 on 2026/02/07.

QR code


Valid HTML 4.01 Transitional
Valid CSS
Valid RSS 2.0

 

© 2026 Rick Murray
This web page is licenced for your personal, private, non-commercial use only. No automated processing by advertising systems is permitted.
RIPA notice: No consent is given for interception of page transmission.

 

Have you noticed the watermarks on pictures?
Next entry - 2026/02/01
Return to top of page