Welcome to ned Productions (non-commercial personal website, for commercial company see ned Productions Limited). Please choose an item you are interested in on the left hand side, or continue down for Niall’s virtual diary.
Niall’s virtual diary:
Started all the way back in 1998 when there was no word “blog” yet, hence “virtual diary”.
Original content has undergone multiple conversions Microsoft FrontPage => Microsoft Expression Web, legacy HTML tag soup => XHTML, XHTML => Markdown, and with a ‘various codepages’ => UTF-8 conversion for good measure. Some content, especially the older stuff, may not have entirely survived intact, especially in terms of broken links or images.
- A biography of me is here if you want to get a quick overview of who I am
- An archive of prior virtual diary entries are available here
- For a deep, meaningful moment, watch this dialogue (needs a video player), or for something which plays with your perception, check out this picture. Try moving your eyes around - are those circles rotating???
Latest entries:
What came back to us is this first draft of a joist design:
… which, obviously enough, arranges all the joists left-right. Which, for any normal house would be fine, but in our specific case we have a highly insulated fresh air duct for the ventilation because it carries most of the space heating. Which means it’s fat, especially in the hallway just outside the utility room where it comes from the MVHR. There, the fresh air duct is approx 280 mm in diameter after the insulation, and myself and my architect had solved this by running the joists up-down just for the hallway, and left-right elsewhere.
Normally you should always orientate your joists in the same direction as the ridge of your roof, so if the ridge runs left-right as it does in this house, so must your joists. This is because the roof trusses will be perpendicular to your ridge, and you then want the floor joists to be perpendicular to those again to brace them.
However, due to the vaulted areas in this particular house, we have two steel portal frames either side of the vaulted area with steel beams pinning both of the house ends to those frames, and then two more steel beams pinning both portal frames together (really this is a steel frame house). Because the steel takes on most of the bracing work, you should be more free with the joist orientation. This is why myself and my architect took advantage of that during duct routing.
Unfortunately, my TF supplier was adamant that if we wanted up-down joist runs in the hallway, we’d need to fit steel, and that steel would need to be custom designed by a specialist engineer, and coordinated with the joist design to fit. That sounded (a) expensive, no designer in this current busy market is willing to take on new work unless their fees are at least €5k and steel is hardly cheap either and (b) it would be months more of delay, at best.
So that now meant we needed to get those ducts through a 304 mm tall joist which has an absolute maximum of 300 x 210 mm clearance. Otherwise months more of delay would occur and large unexpected additional sums of money. Wonderful.
High end custom made industrial ducting
Here were the choices before us:
Custom steel joist design. Cost: five figures. Lead time: months.
Increase joist height from 304 mm to 417 mm. Cost: five figures. Lead time: weeks (mainly to redesign all the ceilings). Also: you lose a fair bit of ceiling height.
Instead of insulated circular steel ducting, use high end custom made industrial ducting. Cost: four figures. Lead time: days. Would need a bit of rejigging the duct layout as the 300 x 210 mm pass through limits airflow to an equivalent 160 mm diameter duct.
So option 3 was the obvious one (well, initially I didn’t know how much it would cost, but I asked for quotes got back numbers and now I know it’s four figures of added cost. Painful, but less than the alternatives). Within Europe, there are a number of prefabricated preinsulated duct manufacturers all supplying the standard DIN sizes cheaply, but if you want custom dimensions they get expensive. Indeed, the gap between their cost and the ultra fancy Kingspan Koolduct gets reasonable. That stuff is the second highest end insulated duct on the market, due to it using a special heat resistant and stiffened phenolic foam cut by CNC machine and then hand assembled into the finished form. As the hand assembly is done by western Europeans using foam blown in western European factories, it isn’t cheap. But in terms of performance for the space, it’s very good and much better than can be achieved with conventional fibreglass wool duct insulation:
- @ 10 C, 0.022 W/mK (vs 0.037 W/mK for ductwrap)
- @ 25 C, 0.024 W/mK
- @ 50 C, 0.027 W/mK
- @ 80 C, 0.031 W/mK (vs 0.046 W/mK for ductwrap)
The only better performing duct material is vacuum panel at 0.007 W/mK. It’s superb, but you could buy a fair portion of a whole house with what it costs.
52 mm of this phenolic insulation delivers these u-values:
- @ 10 C, 0.423 W/m2K
- @ 25 C, 0.461 W/m2K
- @ 50 C, 0.519 W/m2K
- @ 80 C, 0.596 W/m2K
I assumed 18.5 m2 of fresh air duct for my calculations (this is pre-recent layout changes). If so, one would leak the following amounts of energy out of the ductwork, thus not delivering it to the outlet if the house is at 21 C:
- @ 10 C, 7.826 W/K, so -86 watts.
- @ 25 C, 8.529 W/K, so 34 watts.
- @ 50 C, 9.602 W/K, so 278 watts.
- @ 80 C, 11.03 W/K, so 651 watts.
Are these losses acceptable? It depends on the rate of ventilation air flow because the losses are fixed to temperature difference, but the amount of energy transported rises with more air flow:
Duct air temperature | 200 m3/hr | 400 m3/hr | 600 m3/hr | |||
---|---|---|---|---|---|---|
Heating | Losses | Heating | Losses | Heating | Losses | |
10 C | -645 W | 11.74% | -1290 W | 5.87% | -1936 W | 3.91% |
25 C | 235 W | 12.814% | 469 W | 6.40% | 704 W | 4.27% |
50 C | 1701 W | 14.41% | 3403 W | 7.20% | 5104 W | 4.80% |
80 C | 3461 W | 16.54% | 6923 W | 8.27% | 10384 W | 5.51% |
I would expect the system to run at no less than 150 m3/hr unless the house is unoccupied, so losses to ductwork of greater than ten percent are distressing. The next Koolduct size up is 60 mm which is 15% better, but now you swap air pressure loss for thermal efficiency. I’ve been a little unreasonable in this design by aiming for a 0.5-0.75 Pa/linear metre pressure loss which is excessively loose (less than 2 Pa/metre overall is what you need to achieve). But it’s for good reason - the boost fans can increase the air flow for a specific outlet or inlet very significantly, and you want enough slack in the ducts to cope. Also, due to me not having the modelling software, I’ve ignored friction, bends and several other factors which cause additional pressure loss over linear metre calculations.
There is also the cost angle: the 52 mm Koolduct costs about €110 ex VAT per metre. The 60mm stuff I would assume would be maybe €126/metre. Given that standard DIN size preinsulated ducts (albeit with EPS instead of phenolic board insulation) cost about €60 ex VAT/metre, one is paying a big enough price premium already to fit these ducts inside the joists.
I think, to be honest, it’ll just have to do.
The new duct routing
So, having digested all of that, I have drawn in to correct scale a potential duct routing with sufficient dimensions for the flows which definitely fit through and between the draft joist layout above:
Unfortunately, that’s not the end of it. Obviously the above are not ‘CAD quality’ drawings despite the fact that they are exactly to scale and indeed of identical resolution to the original CAD file (Inkscape is surprisingly good). And in any case, we shall need a 3D design in order to send the exact order for the Koolducts through, because there is vertical detail omitted on that 2D layout.
Hence I’ve come to an arrangement with my architect to do some additional work to turn this into 3D and adjust the joists (in some places they just don’t make sense). Hopefully he can deliver that next week, and then we can unblock forward progress with the joist design.
Here’s hoping!
Raspberry Pi colocation
You may remember my recent post on upgrading my internet server infrastructure in which I said I was researching whether to replace my rented Intel Atom 220 based public servers with colocated Raspberry Pi 5’s. Well here they are nearly ready to be dispatched to the colocation:
These will be my seventh generation of public internet infrastructure. One will act as primary, the other as failover. Both will be in the same rack so they get a 1 Gbps network connection between them, but external internet will be clamped to 100 Mbit shared with everybody else on that rack. For under €9 ex VAT/month, I can’t complain.
As you are concluding, after quite a few head scratches I got my full public Docker Compose based software stack up and working with offsite ZFS replication running well. They are very noticeably faster than the current Intel Atom 220 infrastructure, plus due to having double of pretty much everything (RAM, SSD, CPU etc) they have room to grow. Barring unpleasant surprise, these should last me until 2028 when the next Ubuntu LTS upgrade would be due, and possibly for a second four year period under whatever the next Ubuntu LTS will be then (28.04?). The aim will be to have one returned, it upgraded, sent back, migrated, then have the second one returned and upgraded. We’ll see how it goes.
I hope to post them on Wednesday – I am waiting for another NVMe
SSD for europe6b
because the one I got off eBay wasn’t compatible
as it turned out (nearly compatible, and it cost me staying up
to 4am one night going WTF? a lot before I realised it wasn’t me
and it isn’t the Pi). So I’ve ordered an official Pi SSD which is
really a rebadged Samsung 991A SSD. Should work very well, and should
arrive on Monday just long enough for me to get the second Pi also
configured and ready for dispatch.
3D printing extensions to an IKEA Fridans blind to avoid the expense of IKEA Fytur blinds.
… which I kept putting off as it would need a lot of work to type it up. Here is finally that post!
This is probably one of the longest running projects I had of them all. It ran for over a year. What I’m about to write out removes all the blind alleys, the ideas which didn’t work out, all not helped by having to usually wait two months for new parts from Aliexpress to arrive in the post. Before you knew it, it was a year later. Mad.
Automating blackout blinds cheaply
One of the signature features in any automated house is motorised blinds which automatically open and close themselves according to sunrise and sunset. They have historcially been very expensive, typically €500 or more per window, so only very rich people would fit them. IKEA shook up this market with battery powered radio controlled blinds called ‘Fytur’ for under €120-160 per blind. These are great and all, but if you have nearly thirty windows, it’s still thousands of euro.
IKEA also sell the Fridans blackout blind which is operated using a stick at its side. This is very considerably cheaper at €22-28 per blind. Their build quality isn’t great, but for the price they’re a good base for a DIY automation which replaces the manual stick at the side with a motor.
This is hardly my own idea. https://www.yeggi.com/q/ikea+fridans/ will show you thousands of 3d printables related to IKEA Fridans blinds. Most involve replacing this part:
This is the manual stick at the side. You push and pull on it to turn the blind – internally there is a cord with plastic beads which can be reexposed if desired by cutting off the plastic handle, and have a motor push and pull on the cord directly. We’ll be going a bit further – 3D printing a complete replacement for the above with identical dimensions, just minus the handle.
I reckon that all in you can do one of these fully automated blinds for under €40 inc VAT for the 200 cm blind, and under €30 inc VAT for smaller blinds. This excludes the 5v power supply only (often an old USB phone charger will do for that), that’s the price for everything else. This turns thousands of euro of cost for me if we chose the IKEA Fytur solution into hundreds of euro instead, and with very little manual work (apart from all the work done to come up with what I’m about to describe now).
Choosing the motor
If you go through the many, many IKEA Fridan blind automation projects, you will find a legion of motor solutions. Some people use 12v, some 9v, some 5v for power. Various microcontroller and driver boards are used, all with different voltages and currents. In my case, I had very specific needs:
- The entire thing had to work within the power budget of an Olimex ESP32-PoE board running off PoE. That as my notes described gives you up to four watts off PoE before it browns out, which includes everything on the board or hanging off it. That means max three watts for peripherals.
- There is a much better v2 Olimex PoE board now for nearly the same price as the original which has a 12v power tap. Mine, being the older ones, has a max 5v supply. So the motor needed to run off 5v, and never consume more watts than the board has spare.
- My longest blind is 1.8 metres in the kitchen. It needs enough torque to turn that from fully extended.
Those requirements it turns out reduce thousands of options down to approximately two. The first I alighted upon is the 28BYJ-48 unipolar motor hacked into a bipolar configuration. As a unipolar motor, its native voltage is 5v approx 0.1 watts in power. Typical torque is 0.3 kgf.cm with stall torque at 0.6 kgf.cm. Hacking it into bipolar doubles the active windings, so you now might get 0.2 watts of power, 0.6 kgf.cm of torque and 1.2 kgf.cm of stall torque. Obviously the motor was not designed for both windings to be concurrently active so it will get hot quickly. The 28BYJ-48 is however cheap for the spec, about €2.50 delivered which includes a ULN2003 driver board.
I then fortunately landed on something not needing every motor housing to be opened and hand modified: https://github.com/AndBu/YAIFM and my customisations of his project can be found at https://github.com/ned14/YAIFM. This uses a GA12-N20 bipolar motor with integrated encoder. These vary in power and spec despite using the same model name, so you need to choose very carefully to get one with the right combination of torque and power consumption when stalled.
The one I chose off Aliexpress claimed these specs:
Motor Specification Table | ||||||||
---|---|---|---|---|---|---|---|---|
Model | GA12-N20 (GA12-B1215) | Rated Voltage | DC12V | |||||
Type | DC Brushed Geared Motor | Test Voltage | DC6V | |||||
No-Load | Rated Load | Stall | Reduction Ratio | |||||
Speed (RPM) | Current (A) | Speed (RPM) | Torque (kgf.cm) | Current (A) | Power (W) | Torque (kgf.cm) | Current (A) | |
15 | 0.02 | 12 | 1.25 | 0.05 | 0.3 | 8 | 0.35 | 1000 |
25 | 0.02 | 20 | 0.8 | 0.04 | 0.24 | 4.9 | 0.29 | 298 |
30 | 0.02 | 24 | 0.85 | 0.04 | 0.24 | 5.85 | 0.31 | 298 |
40 | 0.02 | 32 | 0.95 | 0.04 | 0.3 | 6.8 | 0.35 | 298 |
50 | 0.02 | 40 | 0.95 | 0.05 | 0.3 | 7.75 | 0.35 | 298 |
60 | 0.02 | 48 | 0.8 | 0.05 | 0.3 | 7.3 | 0.35 | 250 |
80 | 0.02 | 56 | 0.34 | 0.05 | 0.3 | 4 | 0.35 | 200 |
100 | 0.02 | 80 | 0.48 | 0.05 | 0.3 | 3.4 | 0.35 | 200 |
120 | 0.02 | 96 | 0.23 | 0.04 | 0.24 | 1.8 | 0.3 | 150 |
150 | 0.02 | 160 | 0.27 | 0.05 | 0.3 | 2.15 | 0.36 | 100 |
200 | 0.02 | 200 | 0.28 | 0.06 | 0.36 | 2.3 | 0.37 | 100 |
300 | 0.02 | 240 | 0.2 | 0.05 | 0.3 | 1.6 | 0.37 | 50 |
400 | 0.02 | 320 | 0.24 | 0.05 | 0.3 | 1.8 | 0.37 | 50 |
500 | 0.02 | 400 | 0.15 | 0.05 | 0.3 | 1.2 | 0.35 | 30 |
600 | 0.02 | 480 | 0.16 | 0.05 | 0.3 | 1.3 | 0.37 | 30 |
700 | 0.02 | 560 | 0.17 | 0.06 | 0.36 | 1.4 | 0.37 | 30 |
800 | 0.02 | 640 | 0.18 | 0.06 | 0.36 | 1.5 | 0.38 | 20 |
1000 | 0.02 | 800 | 0.42 | 0.1 | 0.42 | 1.6 | 0.39 | 20 |
1200 | 0.02 | 960 | 0.1 | 0.05 | 0.3 | 0.5 | 0.33 | 10 |
1500 | 0.02 | 1200 | 0.07 | 0.04 | 0.24 | 0.55 | 0.33 | 10 |
2000 | 0.02 | 1600 | 0.08 | 0.05 | 0.3 | 0.6 | 0.35 | 10 |
Again, I stress that the above table is what the Aliexpress claims for my specific GA12-N20 motor. Other GA12-N20 motors will have very different tables.
The 50 rpm model highlighted (which has the maximum stall torque of all models) at 6v uses 0.3 watts, typical torque is 0.95 kgf.cm with stall torque at 7.75 kgf.cm. Max amps at stall is 0.35 amps (2.1 watts, within my power budget). The motor plus a DRV8833 driver for it is about €6 delivered, so nearly double the cost of the previous option. However, it delivers (i) 58% more turning torque (ii) 650% more stall torque and (iii) I’m fairly sure the chances of coil burnout would be much lower with this choice.
Not all GA12-N20 motors come with a rotary encoder, which you will need as it counts how many turns the motor does, which we will then use in software to wind the blind to exact positions. A six wire cable is usually supplied, and its pinout means:
- Red: Motor forwards.
- White: Motor backwards.
- Blue: Common ground.
- Black: 3.3v - 5v power supply for the encoder.
- Green: Encoder A phase.
- Yellow: Encoder B phase.
You still need a driver for the motor which is the DRV8833 dual H-Bridge. It works the same as any other H-Bridge motor driver, you set a PWM either forwards or backwards as desired and the motor goes. The DRV8833 rather usefully will take a TTL input and output 5v, so you don’t need a level shifter. Just feed its Vin with 5v, also raise its EEP input to 5v, and voila it all just works with the PWM inputs straight off the ESP32 using the 5v supply off the Olimex board.
ESPHome’s rotary encoder driver will read the A and B encoder pulses. Make SURE you connect 3.3v as its power supply, otherwise the encoder outputs will have too much voltage for the ESP32.
Anyway here it is in action, being driven by ESPHome:
I did lots of testing to try to make the solution brown out, but I failed. I found the following power consumptions off PoE:
- No load, just turning: 105 mW.
- Max load, PWM at 50%: 263 mW.
- Max load, PWM at 100%: 315 mW.
These seemed surprisingly low, so I redid them off USB power:
- No load, just turning: 166 mW.
- Max load, PWM at 100%: 600 mW.
The cause of the disparity is that the PoE power conversion circuitry is especially inefficient at low loads, but gets more efficient as load goes up. The effect is to ‘hide’ some of the power consumption of the motor. Obviously, I only care about peak PoE consumption, so 315 mW looks great.
What about stall current? Well, the thing has so much torque you need two hands to stop it turning. I have my software detect jams within 160 milliseconds and cut the power. Perhaps that meant I never saw the stall current for long enough to measure it, but equally the Aliexpress listing could just be increasing all power claims by 50-100% as they sometimes do. 350 mA at 6v should be ~292 mA at 5v, which is 1,460 mW. I didn’t measure even half that including when I stalled the motor.
There is another possibility: the DRV8833 is mounted on a board called ‘HW-627’. There is very little information about that board that I (or anybody else) can find, but it may well configure the overload protection in the DRV8833 to cut off the power in the case of stall at some fairly low limit. I can say I see several capacitors and resistors on the board, so it’s entirely possible they set a lower overload limit.
Making the blind stop turning when open
The original YAIFM project used either a mechanical switch to detect blind fully open, or you had to program it manually with a count every time there is a power loss. The switch is visually intrusive, and manually setting a count for each of thirty blinds isn’t practical. So I wondered if we could have the ESP32 detect when the blind stops turning, and choose that as the new base point for winding the blind down and up until the next power loss?
The first thing I’d need to fix is that the Fridans blinds have nothing to stop them keeping turning once fully open, because the blind bottom will happily wrap round the upper housing. To solve this, I designed so 3D printed inserts to extend the width of the bottom of the blind. This also doubles as an ‘anti-fray’ shield, because the bottom corners of those Fridans blinds are notorious for getting scruffy very quickly:
Strengthening the 3D prints
The next problem I found is that the plastic just can’t take the torque that this motor puts out. I know this from manually putting load onto the motor by hand, it did not take long before the D-shaped hole for the motor in the printed plastic went circular, and now the blind spool wouldn’t turn. This clearly would need to be fixed.
After a great deal of searching I finally found some metal cogs off Aliexpress which fit the motor’s D shaft (I won’t bore you with the cogs tried and found to not fit, that wasted many months. I really wish listings described measurements the same way!). What you’d need is the ‘9 Teeth D Type’ which has an outer diameter of 8 mm and is 7.4 mm long. The key measurement is between the flat part of the D hole rising perpendicularly to the topmost of the rounded part of the D hole – that needs to be 2.4 mm if you want it loose, 2.3 mm if you want it tight. For some reason, these can cost a lot or not at all depending on the listing, so for reference mine cost €0.82 inc VAT each delivered.
I then remeshed the original YAIFM blind spool to take the metal cog instead of the D-shaped shaft of the motor. I also thickened up some of the plastic, as I reckoned it would be getting repeated stress.
Above is the 3D printed blind spool with cog shaped hole, the metal cog, the GA12-N20 motor with rotary encoder, and its cable. I added two metal washers between the metal cog and the motor to ensure horizontal force landed mainly on the motor housing, not on the motor shaft. You do still get the weight of the blind bearing down on the motor shaft, but it’s probably good for a few years.
Putting it all together:
And that’s pretty much it! The great thing about this particular IKEA Fridans blind customisation is that the 3D printed parts exactly replace the originals in dimensions, so as you can see in the rightmost picture above the blind fits exactly identically to before except you now have a wiring connector. From that you take your cable to your MCU.
The motorised blind in action
This won’t have looked like a particularly long post, and it’s not. Where most of the real work went in was preparing all the materials for upload, which meant cleaning them up, writing a single set of coherent truth from all the notes, and then writing it effectively three times once for Thingiverse, once for Github, and once for here. Here are the links:
Thanks for reading and enjoy!
My current public internet node is dedi6.nedprod.com which as you might guess by the number six, it is the sixth iteration of said infrastructure. I have previously talked about the history of my dedicated servers before back in 2018 when I was about to build out my fifth generation server which was based on an eight core Intel Atom box with 8Gb of ECC RAM and a 128Gb SSD for €15/month. That was a good server for the money, it ran replicating offsite ZFS and it sucked less than your usual Atom server due to the eight cores and much faster clock speed. You even got a best effort 1 Gbit network connection, albeit peering was awful.
Alas two years later in July 2020 that server never came back after a reboot, and nedprod.com had a two week outage due to all data being lost. Turns out that particular server hardware is well known to die with a reboot, which put me off getting another. I did at least get to discover if my backup strategies were fit for purpose, and I discovered as that post related at the time that there was room for considerable improvement, which has since been implemented and I think I would never have a two week outage ever again. The sixth generation server infrastructure thus resulted, which consisted originally of two separate dual core Intel Atom servers with 4Gb of RAM and a 128Gb SSD each ZFS replicating to the other and to home every few minutes. They originally cost €10 per month for the two of them, which has since increased to €12 per month. As that post relates, they’re so slow that they can’t use all of a 1Gbit NIC, I reckoned at the time they could use about 80% of it if the file were cached in RAM and about 59% of it if the file had to be loaded in. It didn’t take long for me to drop the two server idea and just have Cloudflare free tier cache the site served from one of the nodes instead. And, for the money and given how very slow those servers are, they’ve done okay.
However, technology marches on, and I have noticed that as the software stack gets fatter over time, that 4Gb of RAM is becoming ever less realistic. It’s happening slowly enough I don’t have to rush a replacement, but it is happening and at some point they’re going to keel over. 4Gb of RAM just isn’t enough for a full Mailcow Docker stack with ZFS any more, and the SATA SSD those nodes have are slow enough that if a spike in memory were to occur, the server would just grind to a halt and I would be out of time to replace it.
The state of cheap dedicated servers in 2024
Prices have definitely risen at the bottom end. I had been hoping for last Black Friday I could snag a cheap deal, but stock was noticeably thin on the ground and I didn’t have the time to be sitting there pulsing refresh until stock appeared. So I missed out. Even then, most Black Friday deals were noticeably not in Europe, which is where I want my server for latency, and the deals weren’t particularly discounted even then.
Writing end of 2024, here is about as cheap as it gets for a genuine dedicated server with min 8Gb of RAM and a SSD in a European datacentre, with an IPv4 address:
- €14.50 ex VAT/month Oneprovider
- Four core Intel Atom 2.4Ghz with 8 Gb of 2133 RAM, 1x 120 Gb SATA SSD, and 1 Gbit NIC ('fair usage unlimited' [1]). Yes, same model as dedi5!
- €17 ex VAT/month OVH Kimsufi
- Four core Intel Xeon 2.2Ghz with 32 Gb of 2133 RAM, 2x 480 Gb SATA SSDs, and 300 Mbit NIC ('fair usage unlimited' [2]).
- €19 ex VAT/month Oneprovider
- Eight core Opteron 2.3Ghz with 16 Gb of 1866 RAM, 2x 120 Gb SATA SSDs, and 1 Gbit NIC ('fair usage unlimited' [1]).
I have scoured the internet for cheaper – only dual core Intel Atoms with 4Gb RAM identical to my current servers are cheaper.
However, during my search I discovered that more than few places offer Raspberry Pi servers. You buy the Pi as a once off setup charge, then you rent space, electricity and bandwidth for as little as a fiver per month. All these places also let you send in your own Raspberry Pi. That gets interesting, because the Raspberry Pi 5 can take a proper M.2 SSD. I wouldn’t dare try running ZFS on a sdcard, it would be dead within weeks. But a proper NVMe SSD would work very well.
[1]: OneProvider will cap your NIC to 100 Mbit quite aggressively. You may get tens of seconds of ~ 1 Gbit, then it goes to 100 Mbit, then possibly lower. It appears to vary according to data centre loads, it’s not based on monthly transfer soft limits etc.
[2]: It is well known that Kimsufi servers have an unofficial soft cap of approx 4 Tb per month, after which they throttle you to 10 Mbit or less.
The Raspberry Pi 5
To be honest, I never have given anything bar the Zero series of the Raspberry Pi much attention. The Zero series are nearly as cheap as you can buy for a full fat Linux computer, and as this virtual diary has shown, I have a whole bunch of them. At €58 inc VAT each to include PoE and a case, they’re still not cheap, but they are as cheap as you can go unless you go embedded microcontroller, but then that’s not a full fat Linux system.
The higher end Raspberry Pi’s are not good value for money. Mine the 8Gb RAM model with PoE, no storage and a case cost €147 inc VAT. I bought Henry’s games PC for similar money, and from the same vendor I can get right now an Intel N97 PC with a four core Alder Lake CPU in a case and power supply with 12Gb of RAM and a 256Gb SATA SSD for €152 inc VAT. That PC has an even smaller footprint than the RaspPi 5 (72 x 72 x 44 vs 63 x 95 x 45), it’s smaller in two dimensions and has proper sized HDMI ports not needing an annoying adapter. It even comes with a genuine licensed Windows 11 for that price. That’s a whole lot of computer for the money, it’ll even do a reasonable attempt at playing Grand Theft Auto V at lowest quality settings. The Raspberry Pi is poor value for money compared to that.
However, cheap monthly colocation costs so long as you supply a Raspberry Pi makes them suddenly interesting. I did a survey of all European places currently offering cheap Raspberry Pi colocation that I could find:
- €4.33 ex VAT/month https://shop.finaltek.com/cart.php?a=confproduct&i=0. Czechia. 100 Mbit NIC ‘unlimited’. Price includes added IPv4 address for extra cost, which you need to explicitly add (it costs nearly €2 extra per month, so if you can make do with IPv6 only, that would save a fair bit of money).
- €5.67 ex VAT/month $6 http://pi-colocation.com/. Germany. 10 Mbit NIC unlimited. Client supplies power supply.
- €6.00 ex VAT/month £5 https://my.quickhost.uk/cart.php?a=confproduct&i=0. UK. 1Gbit NIC 10Tb/month. Max 5 watts.
- €6.81 ex VAT/month https://raspberry-hosting.com/en/order. Czechia. 200 Mbit NIC ‘unlimited’. Also allows BananaPi.
- €14.60 ex VAT/month £12.14 https://my.quickhost.uk/cart.php?a=confproduct&i=0. UK. 1Gbit NIC 10Tb/month. Max 10 watts.
There are many more than this, but they’re all over €20/month and for that I’d just rent a cheap dedicated server and save myself the hassle.
So these questions need to be answered:
- Is a Raspberry Pi 5 sufficiently better than my Intel Atom servers to be worth the hassle?
- What if it needs to run within a ten watt or five watt power budget?
- Can you even get an Ubuntu LTS with ZFS on root onto one?
Testing the Raspberry Pi 5
As you can see in the photo, unfortunately I got the C1 stepping, not the lower power consuming D0 stepping which consumes exactly one watt less of power. The case was a bundle of a full size NVMe SSD M.2 slot with PoE power HAT, official RaspPi 5 heatsink and cooler, and an aluminium case to fit the whole thing. It looks pretty good, and I’m glad it’s metal because the board it runs hot:
This is it idling after many hours, at which it consumes about 5.4 watts of which I reckon about 1.5 watts gets consumed by the PoE circuitry (I have configured the fan to be off if the board is below 70 C, so it consumes nothing. I also don’t have the NVMe SSD yet, so this is minus the SSD). The onboard temperature sensor agrees it idles at about 65 C with the fan off.
After leaving it running stress-ng --cpu 4 --cpu-method fibonacci
for a while the most power I could make it use is 12.2 watts of PoE
with the fan running full belt and keeping the board at about 76 C.
You could add even more load via the GPU, but I won’t be using the
GPU if it’s a server. As with all semiconductors, they use more
power the hotter they get, however I feel this particular board
is particularly like this. It uses only 10.9 watts when cooler, the
additional 1.3 watts comes from the fan and heat. How much of this
is my particular HAT or the Raspberry Pi board itself, I don’t know.
Is a Raspberry Pi 5 sufficiently better than my Intel Atom servers to be worth the hassle?
First impressions were that this board is noticeably quick. That got me curious: just how quick relative to other hardware I own?
Here are SPECINT 2006 per Ghz per core for selected hardware:
- Intel Atom: 77.5 (my existing public server, 2013)
- ARM Cortex A76: 114.7 (the RPI5, CPU first appeared on the market in 2020)
- AMD Zen 3: 167.4 (my Threadripper dev system, 2022)
- Apple M3: 433 (my Macbook Pro, 2024)
Here is the memory bandwidth:
- Existing public server: 4 Gb/sec
- Raspberry Pi 5: 7 Gb/sec
- My Threadripper dev system: 37 Gb/sec
- My Macbook Pro: 93 Gb/sec
(Yeah those Apple silicon systems are just monsters …)
For the same clock speed, the RPI 5 should be 50-75% faster than the Intel Atom. Plus it has twice as many CPU cores, and a NVMe rather than SATA SSD, and possibly 40% more clock speed so it should be up to 2x faster single threaded and 4x faster multithreaded. I’d therefore say the answer to this question is a definitive yes.
(In case you are curious, the RaspPi5 is about equal to an Intel Haswell CPU in SPECINT per Ghz. Some would feel that Haswell was the last time Intel actually made a truly new architecture, and that they’ve been only tweaking Haswell ever since. To match Haswell is therefore impressive)
What if it needs to run within a ten watt or five watt power budget?
I don’t think it’s documented anywhere public that if you tell this board that it’s maximum CPU clock speed is 1.5 Ghz rather than its default 2.4 Ghz, it not only clamps the CPU to this but it also clamps the core and GPU and everything else to 500 Mhz. This results in an Intel Atom type experience, it’s pretty slow, but peak power consumption is restrained to 7.2 watts.
Clamping maximum CPU clock speed to one notch above at 1.6 Ghz appears to enable clocking the core up to 910 Mhz on demand. This results in a noticeably snappier use experience, but now:
- @ max 1.6 Ghz, peak power consumption is 9.1 watts.
- @ max 1.8 Ghz, peak power consumption is 9.4 watts.
- @ max 2.0 Ghz, peak power consumption is 9.6 watts.
The NVMe SSD likely would need half a watt at idle, so 1.8 Ghz is the maximum if you want to fit the whole thing including PoE circuitry into ten watts.
The board idles above five watts, so using the max five watt package listed above is not on the radar at all. So would the Raspberry Pi 4 with a PoE HAT, so you’d need to use no better than an underclocked Raspberry Pi 3 to get under five watts. That uses an ARM Cortex A53, which is considerably slower than an Intel Atom.
Finally, you get about twenty seconds of four cores @ 1.6 Ghz before the temperature exceeds 70 C. As the fan costs watts and a hot board costs watts, it makes more sense to reduce the temperature at which the board throttles to 70 C. Throttling drops the CPU initially to 1.5 Ghz, then it’ll throttle the core to 500 Mhz and the CPU to 1.2 Ghz. It’ll then bounce between that and 1.6 Ghz as temperature drops below and exceeds 70 C. I reckon power consumption at PoE is about 7.2 watts. If you leave it at that long enough (> 30 mins), eventually temperature will exceed 75 C. I have configured the fan to turn on slow at that point, as I reckon the extra watts for the fan is less than extra watts caused by the board getting even hotter.
In any case, I think it is very doable indeed to get this board with NVMe SSD to stay within ten watts. You’ll lose up to one third of CPU performance, but that’s still way faster than my existing Intel Atom public server. So the answer to this question is yes.
Can you get Ubuntu LTS with ZFS on root onto one?
The internet says yes, but until the NVMe drive arrives I cannot confirm it. I bought off eBay a used Samsung 960 Pro generation SSD for €20 including delivery. It’s only PCIe 3.0 and 256 Gb, but the RaspPi 5 can only officially speak single lane PCIe 2.0 though it can be overclocked to PCIe 3.0. So it’ll do.
When it arrives, I’ll try bootstrapping Ubuntu 24.04 LTS with ZFS on root onto it and see what happens. I’ve discovered that Ubuntu 24.04 uses something close to the same kernel and userland to Raspbian, so all the same custom RPI tools and config files and settings work exactly the same between the two. Which is a nice touch, and should simplify getting everything up and working.
Before it goes to the colocation …
I’ve noticed that maybe one quarter of the time rebooting the Pi does not work. I think it’s caused by my specific PoE HAT, other people have also reported the same problem for that HAT. Managed PoE switches can of course cut and restore the power, so it’s not a problem but I’d imagine setting it up and configuring it remotely wouldn’t be worth the pain. It would be better to get it all set up locally, make sure everything works, and go from there.
In any case, I’d like to add load testing, so maybe have some sort of bot fetch random pages continuously to see what kind of load results and whether it can continuously saturate a 1 Gbit ethernet even with the ZFS decompress et al running in the background. I think it’ll more than easily saturate a 1 Gbit ethernet, maybe with half of each of the four cores occupied. We’ll find out!
There is also the question whether my Mailcow software stack would be happy running in Docker on Aarch64 rather than in x64. Only one way to find out. Also, does ZFS synchronisation work fine between ARM and Intel ZFS sets? Also only one way to find out.
Finally, after all that testing is done, I’ll need to take a choice about which colocation to choose. The 10 Mbit capped NIC option I think is definitely out, that’s too low. That means a choice between the 1 Gbps ten watt constrained option, or the 200 Mbit unconstrained option for nearly exactly half the price.
The ten watt constrained option is a bit of a pain. In dialogue with their tech people, they did offer 95% power rating, so they’d ignore up to 5% of power consumption above ten watts. However, that Samsung SSD can consume 4 watts or so if fully loaded. If it happens to go off and do some internal housekeeping when the RaspPi CPU is fully loaded, that’s 13 watts. Depending on how long that lasts (I’d assume not long given how often we’d do any sustained writes), they could cut the power if say we exceeded the ten watt max for more than three minutes within an hour. That feels … risky. Plus, I lose one third of CPU power due to having to underclock the board to stay within the power budget.
Given that there would be no chance of my power getting cut, I think I can live with the 200 Mbit NIC. I wish it were more, but it’s a lot better than a 100 Mbit NIC. How often would I do anything needing more than 20 Mb/sec bandwidth? Mainly uploading diary posts like this, and so long as we’re in the rented accommodation our internet has a max 10 Mbit upload, which is half of that NIC cap. Cloudflare takes care of the public web server, so for HTTP NIC bandwidth doesn’t really matter except for fetching cold content.
Anyway, decision on colocation is a few weeks out yet. Lots more testing beckons first.
To conclude, the Raspberry Pi 5 looks like a great cheap colocated server solution. But only because providers special case a Raspberry Pi with extra low prices. If they only special cased anything under twenty watts with the same price, I’d be sending them an Intel N97 mini PC and avoid all this testing and hassle with the Raspberry Pi.
3D printing extensions to an IKEA Fridans blind to avoid the expense of IKEA Fytur blinds.
Alas, this post won’t be that. I will write that post soon, not least that I need to write down everything I will need to do when I have to go make thirty of them for the house. But writing it out properly will be time consuming to do it correctly, plus all the 3D prints need to be uploaded and blurbs etc written for them too. In short, chances are I’ll write it up during Christmas break, that kind of time consuming long form instructional writing needs more time than a single night after the kids have gone to bed.
So what will I be talking about tonight? Well …
House build actually takes a step forwards …
On the 11th November, Structural Engineering finally completed! They had been working on it since July.
I removed the logos of the firm because I’m going to be mildly critical – I did have to formally complain about how long it was taking. In fairness, they did step up very much after me complaining, they were like a whole new company after in comparison to before me complaining. If I had had the company after my complaint before I complained, I would be falling over with praise for them. Still, I cannot argue that they most definitely did step up, albeit without any admission of having done anything wrong to begin with.
In fact, they were rather critical of me instead! Apparently I had not been driving forward the process sufficiently i.e. I should have been a plague about their houses forcing myself to the front of their work queue, instead of just letting them at it. And okay, fair enough, Ireland is currently the hottest construction market in the OECD and everybody is at capacity. If you don’t make noise, nobody will be prioritising you right now. You need to be a pest to get put ahead of everybody else. Lesson learned.
I am not a Structural Engineer, in fact it is probably my weakest area of skill of all the skills in the building of a house. However from my best understanding, their quality of work looks to be good. I did some spot calculations using my Applied Leaving Cert Maths from more than a quarter century ago and they appear to have built in very significant safety margins everywhere I checked (which was, admittedly the simpler cases because the complex cases are beyond my capabilities). The work appears to be high quality.
If I did have another mild criticism, they were annoyingly narrow in their scope. Lots and lots of stuff they simply hand waved away as ‘this isn’t something we do’, punting it onto somebody (which sometimes felt like anybody) else. And I get they have a lot of business on right now, and they’re focusing on their narrow tunnel of the specific engineering they do. But as I made very clear in my feedback to them, I hired them to help the wider team build this house. From my point of view, that means applying yourself to solving the wider problems up to the point where your expertise ends. It doesn’t mean shunting off everything outside your narrow remit onto anybody else – that, in my opinion, helps cause systemic failure because it opens gaps between expertise which only the client (i.e. me) can fill, sometimes using best guesses from what he can glean off Google. That isn’t - in my opinion - what engineering is about. I certainly wouldn’t tolerate that kind of attitude in my workplace, and if I ever exhibited it myself I would view it as a personal failure for which I would publicly apologise.
All that said, my workplace(s) hire from global talent pools, and the minimum bar is very considerably higher than any national bar. My workplace(s) expect global top tier talent, and anybody who doesn’t perform at a globally competitive skill level quickly gets dismissed. It is unrealistic to expect the same here. I am also mindful that the sums of money involved for my house build are a small fraction of what my workspace(s) spend, and to a certain extent, if somebody is paying big bucks they can expect a level of service not appropriate for somebody like me who isn’t paying big bucks. So I need to arrest my expectations, and I am very sure I’ll need to keep on doing so.
What next?
After my TF supplier received the completed structural engineering designs, they put my house into the queue for the metal webbed joist designer. They apparently have a six week lead time, and they are not expected to even look at my house until the New Year.
After the metal webbed joist design is complete (I’m thinking February at earliest), my TF supplier says we’ll be immediately put into the queue for foundations design which apparently currently has a lead time of three months. They’ll then use those months to do the detailed timber frame design which is the specific bit they do in-house as they manufacture offsite the TF panels. I am told it is highly likely they’ll complete that work before the foundations are done as those are holding up everybody in the Irish construction industry right now, they’re all at capacity and hence the lead times. So we’re looking at an earliest possible build start date of May or so. Which is more likely June.
That is real bad timing for me, as school holidays start then and I’ll be on childcare. I can’t say I’m looking forward one bit to childcare whilst trying to get that house sealed up externally before winter sets in. It’s going to be an absolute bear.
However, I suppose there is a good chance that we will get that house weatherproof by this time next year. We then beaver away at the internals, with a bit of luck we get to move in by Summer 2026. That is many years later than anybody ever expected, but better than no house at all.
Music while we work
With the family having been on austerity for the past two years as our bank accounts have to be absolutely pristine for the mortgage application (they scan every line item, require explanations for anything unusual, and of course they prove your savings and spend rates which says how well you would afford the mortgage), we don’t ever spend anything discretionary except on the house. Black Friday and Singles’ Day 2022 & 2023 we spent many thousands on stuff from China and elsewhere, but for Black Friday 2024 I was kinda at a loss on what more is worth buying now not later? After all, anything bought now ties up cash and this build will be primarily cash flow constrained, however if very large savings are on hand, or I need an item for testing now to make sure it’ll work, I’ve tended to go for it.
You might remember the future house TV I bought this time last year in the Black Friday sales. That was an example of large savings being worth the tying up of cash. That is indeed a superb TV, however one thing I found during testing was that the bass was disappointing, as I described this time last year. So I am in the market for something which can do a far better job with low end frequencies.
My completely unrealistic subwoofer in the wishlist is the Klipsch RP 1600SW which is a 16 inch vented driver with about 800 watts of 16 - 175 Hz audio delivery. This very much would deliver all the low frequency audio you would ever need, but it does cost €2,000 inc VAT which is nearly as much as the TV itself.
Getting into a more realistic price range, the Q Acoustics QB12 has a 12 inch driver, 220 watts of bass power, and delivers 28 - 300 Hz. At €450 inc VAT, still a lot of money for a single purpose item. And, in the end, too much money. I couldn’t justify it for that single use case.
What I could justify is something which can act as the TV subwoofer, but can also act as outdoor music if we were on the patio, and also act as a general portable audio e.g. when working on the inside of the house. Which kinda ticked the box that this is arguably a future house purchase and therefore ‘allowed’. So I ended up buying at a good Black Friday discount the JBL PartyBox 710 for €650 inc VAT. It has 800 watts of total power, and can deliver 35 - 20,000 Hz (but see later about that). It does have serious audiophile chops, rtings reckoned it the best Bluetooth capable speaker available along with similarly high ratings from several audiophile sources including enthusiast forums on Reddit. As you will see shortly, I don’t think it that good personally, especially for €650, but I don’t regret the purchase. Here it is in action (and yes, the light show can be turned off):
The JBL Party Box 710 compared
I’m not a serious audiophile, but I have sought good ‘bang for the buck’ in audio systems. My first set of speakers attempting audio quality was a 2.1 Audio-Technica set. I still have them – in fact, I was only listening to them a few hours ago as they’re out at the site – and despite being a quarter century old, they still work perfectly and still sound great. Funnily enough, I can find zero mention of these on the internet, so I really wish I’d taken a photo of the model number so I could give you some technical details. In any case, they have a reasonably sized subwoofer, and two (later upgraded to three) ‘full range’ satellites (which usually means they struggle at the low mid range, which is exactly true in this case). The reason I added the third optional speaker is because the satellites were a bit overwhelmed in a TV scenario, and the unit is capable of 3.1. The third satellite provided a dedicated centre channel and made them into excellent TV speakers. If used as computer speakers where the satellites are right close to your head, two is plenty, but at a distance you do need more satellite power. In any case, these go real loud, the bass is thumpy enough, for a small fairly inexpensive and certainly very long lasting speakers, they were and remain a great purchase.
I seem to have some luck when picking speakers. After a few years with the AT 2.1 set, I invested in a Logitech 5.1 set. I remember they lasted a while and then blew up, so I then bought a more expensive Logitech 5.1 set which I think was the second most expensive model they had at the time. Those remain working perfectly to this day after nearly two decades of continuous use. As they’re next door, I know the model number this time: they are the Logitech Z-5400 5.1 speaker system released in the year 2006:
- Total 310w RMS
- 1x 6.5” Subwoofer 116w RMS
- 5x 2.5” Satellites 194w RMS
- Claimed 35 - 20,000 Hz (one user reported measured 3 dB from 42 Hz)
- I would say the bass has plenty of power but not much definition i.e. it is muddy.
- Crossover is approx 120 Hz to compensate for the ‘full range’ satellites not having much at the low end, so the muddy subwoofer does much more lifting at the low end than anything hifi would.
I remember ex-girlfriend Johanna didn’t think the audio quality from these were good back when we lived together, but we were using them as room speakers when they were designed specifically to surround a single individual sitting in front of a computer. If you have them arranged like that, well I find them better than the Audio-Technica’s, but I have also heard better again though I must admit not by much. The Z-5400’s got sniffed at by audiophiles, but end users absolutely loved them and I see from the internet that if arranged in their intended position closely surrounding a single seated individual, empirical measurements found audiophile level quality.
Finally, I suppose the other audiophile type audio system is the one in my car which is the maximum trim possible for a Ford Focus. It is made by Sony, and is the only one with proper dedicated tweeters, mid range and subwoofer speakers. Music sounds great within the car, and if you crank it up you get everybody staring at you thanks to the dedicated subwoofer which sits on top of the spare wheel in the boot and is the same diameter. Rock music sounds particularly amazing, indeed you can be singing so loud as you’re driving I’m not entirely sure it’s safe.
So, onto the party box! You may find the rtings review of interest, but my own notes are these:
- Total 800w RMS
- 2x 8” Subwoofers
- 2x 2.75” Tweeters
- Claimed 35 - 20,000 Hz (rtings measured 3 dB between 26.7 - 14,100 Hz).
- SBC and AAC Bluetooth codecs.
- Noticeable volume drop near to 100 Hz during a frequency sweep (rtings found the same). This is surely a firmware glitch.
- Many users report volume past about 66% simply swaps treble for bass i.e. bass is actively reduced in favour of treble. I couldn’t check this because this speaker at that volume in this small rented house is just too much to bear.
All testing was done with a wired cable from a MBP, not over Bluetooth to eliminate Bluetooth codec compression effects.
The party box is on paper the most powerful audio system I now have. Yes it goes loud, yes everything in your house will vibrate, however as with all powerful audio systems, they max out at about 100 dB of noise to prevent damaging human ears. The difference in power is how much air volume gets moved i.e. dB is the amplitude of the wave, but doesn’t say anything about the mass of air moved. More powerful speakers move more air volume. If this is hard to conceptualise, it’s like a light having a maximum point brightness otherwise you get glare, so past a certain power level lights would add brightness by adding surface volume to emit more light from more surface. The party box is really big, easily more than a metre tall, and the large bass vent it has at the back pushes lots and lots of air. Putting a 24 Hz tone through it, I can’t hear anything but given that the house and everything in it is shaking (including me) I can’t fault the power delivery.
Unfortunately, the party box is also the least consistent of any audio system I have. On some material, it is goosebumps good. On other material, it sounds actively crap. I upgraded to the latest firmware as the actively crap tracks are almost certainly due to firmware issues, but in the end I have to call it as I hear it:
- If music has ‘tight’ swooping bass, this speaker very much favours that. Basically it bats you physically around with bass.
- If music has lots of ‘general’ bass e.g. most rock music, this speaker doesn’t favour that. The sound is off-kilter or unbalanced or crowded somehow.
- Most music falls somewhere in between. Most is well rendered, however just because it has a beat or is EDM doesn’t necessarily make it stand out. Rather, it’s ‘competent’ rather than ‘wow’. Whereas on my other sound systems above, the exact same material just sounds better and sometimes a lot better.
To try and nail this down better, here is specific material I tested:
Most improved tracks (like wow! goosebumps good):
- Timeless by Goldie. I had no idea until now how much attention he paid the bass track!
- Porcelein by Moby
- Teardrop by Massive Attack
Disappointing (sound is brash? crowded soundstage? somehow sounds bad)
- Being Everyone by After Forever
- Is Nothing Sacred Anymore? by Meatloaf
- Ironic by Alanis Morissette
Very acceptable:
- Unwritten by Natasha Bedingfield (no crowded sound at all, very spacious)
- Halo by Beyonce
- Talk that Talk by Rihanna
- Here with me by Dido
- Fotografia by Juanes (but getting a bit of that crowded sound issue)
Tested movies (all with 5.1 or better audio with dedicated LFE channel):
- The Matrix. Breathtaking. Bass here is exactly right and clean. Every bullet fired is like a bass punch into the chest. It shows just how good this speaker can be with the right input.
- Sleepy Hollow intro. Amazing, and it’s what I got this speaker for because this exact movie had a sound not commensurate with the picture on that nice TV.
- Starship Troopers. Amazing.
- Ultraviolet intro. Superb.
- Edge of Tomorrow. Almost as if you’re in the battle scenes.
- Deadpool and Wolverine intro. The movie has too much general bass in the intro music, it doesn’t sound good, it’s crowded. Rest of the movie is good.
- The Rock. Very good, but not as good as I think it could be. Where is the bass punch in the chest per bullet fired?
Movies, as you might surmise, suit this speaker far better in general than music.
I will say that almost nobody seemed to find the same as I have above online. You could say it’s low quality source material, and maybe it is, however I deliberately threw on each of those three disappointing tracks on the Audio Technica speakers earlier today. And they sounded great, Being Everyone was spacious almost felt like you were at the concert. Meatloaf had Julia my three year old bopping around. Alanis’ most famous song came through clear, very much not crowded, and there was plenty of midrange even though that isn’t the strength of these speakers. I played all three in my car too, and all three sounded superb there, better than the Audio Technica speakers.
I can’t really explain it nor that none of the reviews online found anything similar. I’m very sure it’s not a hardware defect, Teardrop by Massive Attack would nearly bring you to tears it sounds so good. No, I reckon it’s something misconfigured in the DSP firmware, the fact there is that arbitrary volume drop off around 100 Hz would suggest their firmware is just buggy. It’s a shame.
Now, all the above said, the party box does tick all the boxes it was bought for: it can be wheeled wherever you need sound, it can be safely left outside in the rain, no fiddling with wires is needed thanks to the Bluetooth, and it works very well to add bass to movies as a standin for a dedicated subwoofer. So I’m happy with my purchase. I guess my only temptation now is whether two of them would sound better because you could send left channel to one and right channel to the other, and maybe that might solve the crowded sound problem.
Anyway, not a concern for the next few years. This will do for now.
I guess my next update will probably be during my Christmas break. See you then!
My remaining prototype projects are:
3D printing extensions to an IKEA Fridans blind to avoid the expense of IKEA Fytur blinds.
Dimming RGBW LED strips with my ‘new’ IRF540N MOSFET boards.
Figure out a solution to reducing the power consumption of my cheap ESP32-POE boards.
I’m pretty much done with all three. The blinds have taken the most effort and have been the most frustrating, but I have a video of them in operation and I just need to write it all up. I’ve also completed the other two in full and those are what I’ll be talking about in this post.
One these prototypes are complete, my next goal is to draw into a 3D representation of the house where all the wiring and items will go in detail. I already have done a full set of schematic wiring diagrams, but it would save time onsite if I knew exactly what wire goes where and it may help me save money on wire by optimising routing. So I’ll still be busy doing house build aiding work.
Throwing a whole PC at a pulse generator
Last post I mentioned:
After quite a bit of research I landed on a surprising conclusion: the most cost effective way of implementing a low power pulse generator is actually a second ESP32 chip which does nothing but deep sleep for 340 ms and power on for 60 ms. This seems wasteful for a microcontroller as powerful as an Intel Pentium II from 1997, but the economics are what they are – I can get an ESP32-C3 on a breakout board with USB-C, onboard programmer and 3.3v buck converter delivered for €1.50 inc VAT! Madness! And it doubles as ‘the load’ because you can turn on the Bluetooth and Wifi stacks to consume up to 200 mW @ 3.3v (which should be just enough to consume 500 mW @ PoE), whereas the 555 circuit would need an additional load resistor and wiring.
Those ESP32-C3 “Super Mini” boards arrived from Aliexpress a week ago. According to https://roryhay.es/blog/esp32-c3-super-mini-flaw, mine are the flawed design which puts the Wifi antenna (the red thing on the left) too close to the external 40 Mhz clock (the silver component top left) which impacts reception quite badly:
I never found the Wifi on the Olimex ESP32 board of much use, it has a much better embedded antenna design which I still find nearly useless, especially as it is 2.4Ghz and even a few of these devices in a room quickly overwhelms that spectrum such that it denigrates into unreliable noise. I certainly never would have any use for the Wifi with an even worse embedded antenna, so I don’t care that this is the flawed design for Wifi. Especially for €1.50 inc VAT. These boards do have the ESP32-C3 with the embedded 4Mb flash (amazingly, some do not), and it is the latest ESP32-C3-FH4 revision whereas some boards ship with a retired earlier revision. Build assembly, as you can see, isn’t the cleanest but I’ve also seen a lot worse. I will say that when I asked it to list Wifi APs it could see, it found an identical list to my phone and the signal strengths it reported were only a bit worse, but I didn’t try connecting to any as I won’t ever need that functionality.
Here are the pinouts:
In addition to your twelve very flexible i/o, the ESP32-C3 has 400 Kb of RAM, 4Mb of flash, it runs at up to 160 Mhz and has a 32 bit RISC-V instruction set. It is only single cored so if you do run a Wifi or BLE stack, that will consume a lot of CPU wherea the Xtensa ESP32s throw a whole CPU core at Wifi and BLE and leave the other core entirely for you. It is also missing hardware floating point, but does have hardware crypto acceleration.
For €1.50 inc VAT delivered, that is a whole load of computing for the money. This is a very capable dev board for the money. It’s almost embarrasing the value here.
You can, however, actually get still cheaper on a breakout board with USB connected flash programmer and a 5v to 3.3v buck converter. Yes, even less cost than €1.50 inc VAT delivered:
- A clone of the Waveshare RP2040-Zero dev board for €1.29 inc VAT delivered. This is the same RP2040 microcontroller of Raspberry Pi fame, and the board is generous with nineteen i/o on pins and a further nine i/o if your micro soldering skills are good. It also has a single onboard WS2812 RGB LED if you fancy a very small light show.
- A clone of the ATTiny85 dev board for €0.93 inc VAT delivered. This is an eight bit CPU compatible with Arduino, and it has six i/o pins.
(I deliberately omit the fake STM32 clones which are well known to be sufficiently flaky and weird that they aren’t worth the hassle at this price point. The RP2040 chip on these boards is genuine, as is the ATTiny85, it’s just the dev board which is a clone of a branded (and much more expensive) board. As the chip is genuine and not a bad attempt at a reproduction, you get consistent behaviour and the toolchains will work without issues)
Of those two, the RP2040-Zero looked worth a speculative purchase, and the Aliexpress vendor with both the ESP32-C3 Super Mini boards and the RP2040-Zero boards gave you free shipping if the order was over €37. So, I ordered this bag of both MCU types, mostly the ESP32-C3 with a few of the RP2040-Zero’s thrown in:
I still can’t quite believe that in 2024 I can buy two dozen 1997 era PCs in a bag for under €40 inc VAT delivered. Madness!
The RP2040-Zero boards have more i/o than the ESP32-C3, and have the whole Raspberry Pi ecosystem with them, but otherwise are inferior in almost every way. They have nearly half the RAM, half the flash, slower clock speed and they in fact run far slower again than any ESP32. There is obviously no Wifi nor Bluetooth. For €0.20 inc VAT saved they probably aren’t worth it except for the Raspberry Pi ecosystem and they were also a guarantee that if the ESP32-C3 boards didn’t work out, I’d have a fallback. I’m glad to report that the ESP32-C3 boards did work out, so those RP2040’s are probably going to gather dust until a use case for them turns up.
One of those use cases might be as a MicroPython learning platform. My son occasionally types in Python Turtle programs to a laptop. He doesn’t understand enough to write his own programs yet, but if he sticks with it and gets good enough that he can, certainly one of those RP2040 is ideal for learning. Once you flash MicroPython onto it, you literally plug it in to a PC, connect to the serial port it exposes and voila, you’re in a Python interpreter. You can flash LEDs, poke pins, there is actually a fair fist at an embedded debugger on there. This is stuff Raspberry Pi does well, and to date they’ve had superb support for ancient hardware so I expect latest firmwares will be available for those boards a decade or more from now. And hey, if you just want a quick and dirty MCU try out of something embedded from within an interactive interpreter, that’s more hassle with an ESP32 to set up than a RP2040.
Completing Olimex ESP32-PoE detailed power consumption
Last post I reported disappointing power consumption measurements for the Olimex ESP32-PoE board when powered from PoE, and I speculated that a pulse generator using these cheap ESP32-C3 boards would produce a superior result:
Removing resistor R42 which burns 500 mW to keep the PoE supply going is an obvious step, but I think we can do better than 1.2 watts idling with that resistor removed for not much extra money. PoE doesn’t actually require a constant 500 mW of load to stay active – rather it needs to see 500 mW of load for at least 60 milliseconds every 340 milliseconds. This is a duty cycle of 15% on a tick of 400 milliseconds, reducing amortised load to keep PoE active to 75 mW. If I could get these boards mostly into deep sleep, and have some sort of pulse generator generate load at the right duty cycle, that could reduce heat contributed to the house significantly … Assuming that the 2 mW deep sleep is the same for both, and conversion losses might be 5x at such a low current, it might draw 25 mW from PoE during the off cycle. That should bring total PoE draw to under 100 mW per device amortised, so under three watts for the total.
I can tell you now I didn’t get the power consumption that low as there are inefficiencies in the chain. But I can complete the table now:
USB (5.2v) | PoE (52.6v) unmodified | PoE (52.6v) with R42 resistor removed | |
---|---|---|---|
Deep sleep (two LEDs shining) | 2 mW | 579 mW | switch cuts power, so must be < 500 mW |
Idle in ESPHome no ethernet (two LEDs shining) | 386 mW | n/a | n/a |
As above with ESPHome trying to get ethernet | 454 mW | n/a | n/a |
Idle in ESPHome with ethernet (four LEDs shining) | 553 mW | 1525 mW | 947 mW |
Idle as above with all peripherals for a bedroom | 600 mW | 1736 mW | 1158 mW (estimated) |
Deep sleep + ESP32-C3 pulse generator to keep PoE alive (three LEDs shining plus one pulsing) | 46 mW | 170 mW |
So about twice worse than originally hoped for, most of which I would guess is inefficiency in the buck converters at very low currents. But still a lot better than any of the other alternatives above, so I think we’ll take it.
Here is it in action, I turn on the blue LED when the board is burning power and off when it goes into deep sleep:
And, for reference, here is the snippet of ESP-IDF code which I wrote:
#define US_DEEPSLEEP (400000 - US_BURN)
#define US_BURN (66000) // 60000 plus min 5200 for period before wifi enable
void app_main(void)
{
esp_sleep_wakeup_cause_t wakeup_cause = esp_sleep_get_wakeup_cause();
int64_t since_boot = esp_timer_get_time();
// Turn on the LED to burn a few extra mW
gpio_reset_pin(8);
gpio_set_direction(8, GPIO_MODE_OUTPUT);
gpio_set_level(8, 0);
// Initialize NVS. Apparently required for Wifi.
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
{
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
// Fire up wifi to add an extra ~400 mW power consumption
int64_t before_scan = esp_timer_get_time();
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta();
assert(sta_netif);
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_start());
esp_wifi_scan_start(NULL, false);
// Spin loop the CPU to burn another ~25 mW
while (esp_timer_get_time() < US_BURN)
{
// vTaskDelay(10);
}
int64_t after_scan = esp_timer_get_time();
printf("\nsince boot = %lld us\n", since_boot);
printf("wakeup cause = %d\n", (int)wakeup_cause);
printf("before wifi scan = %lld us\n", before_scan);
printf("after wifi scan = %lld us\n", after_scan);
int64_t before_sleep = esp_timer_get_time();
printf("before deep sleep = %lld us\n", before_sleep);
esp_deep_sleep(US_DEEPSLEEP);
}
I measured this burning 450 mW at peak with my USB power meter and 3 mW during deep sleep. The code which initialises non-volatile storage takes quite a bit, about three milliseconds and it takes two milliseconds to boot. This is why we burn for 66 milliseconds instead of 60 milliseconds to account for the period before burn begins.
I threw the above together with a few hours of work. I was impressed with the ESP-IDF framework, it is very well documented and the APIs are complete and well designed in the bits I looked at. The toolchain has a Visual Studio Code extension that ‘just works’ on Windows, Linux or Mac OS, and it’s full fat C++ 17 as it’s based on the current latest stable GCC 14.
There is an awful lot to like here I must admit. Compared to embedded systems development at this price point even five years ago … exponential improvement remains live and well at this price point. I can see future ESP32 class MCUs on a dev board with USB based flash programmer coming in well below one euro soon enough. Madness!
Dimming RGBW LED strips with my ‘new’ IRF540N MOSFET boards
Last August I wrote:
Many moons ago after testing IRF520N MOSFET based solutions for dimming LED strips, I realise that I had bought poorly and I should have bought IRF540N MOSFETs instead as they should run much cooler. Easily two years ago now I did buy a bunch of four channel IRF540N MOSFET boards, but I’ve never tested them in action. I’d like to get that done, to create peace of mind that this solution will definitely work if asked and they do run cool as the maths had predicted.
This one was a bit bad, I had had that IRF540N board since January 2023. To be honest, I was sufficiently sure it would be fine it wasn’t high priority but as I run down the prototypes to work on, this was an easy one to also clear off the deck.
Back in 2021 when I first started testing prototypes – yes, three years ago now – I put in a prototype cove lighting operated by a Devantech industrial PIC32 board. It used an IRF520N MOSFET to do the dimming, and boy did it get hot with perhaps 2 amps going through it. This is due to maths, here are my estimates from their datasheets of waste heat generation for a control voltage of 10v and the MOSFET’s temperature is 20 C (they leak more heat as they get hotter):
Current | IRF520N watts | IRF520N temp | IRF540N watts | IRF540N temp |
---|---|---|---|---|
0.63 A | 0.08 W | +5.0 C | 0.02 W | +1.3 C |
1.00 A | 0.20 W | +12 C | 0.05 W | +3.2 C |
2.00 A | 0.80 W | +50 C | 0.2 W | +13 C |
2.50 A | 1.25 W | +78 C (needs cooling) | 0.33 W | +20 C |
4.00 A | 3.20 W | +198 C (needs cooling) | 0.82 W | +52 C |
Most MOSFET boards of any kind put a LED in series with the control signal which removes 0.5v, so with a level shifter you end up with a control voltage of about 4.5v after the LED. This is obviously a good bit lower than the 10v most MOSFET datasheets describe, which can result in even more heating than the above as more current will leak due to the weaker clamp.
This particular IRF540N board happens to be wired differently from usual however. To be honest, I knew that when I did the research and I bought it two years, but I had forgotten since and so this testing and wiring is wrong as you’ll shortly see.
There isn’t much to the automation side of things here – ESPHome knows about four channel RGBWW LED strips, and here it applies a 15 kHz PWM to each channel which is more than flicker free. In case you’re wondering why the green stays on, more on that shortly.
To test heating, I left them on 100% for a period. These are my outdoor LED strips for the house soffit and I reckon they consume about 72 watts mainly clamped by the overly thin anode wire which probably pegs current to 3 amps or so. When I fit these to the house, I’ll be running a second anode wire to the other end just to reduce heat wastage.
You can clearly see the hot anode wire standing out – why these Chinese RGBWW LED strip manufacturers insist on fitting identical gauge wire for the common anode I just do not understand. I can’t believe it actually saves much money, maybe a few cents, but it would make far more sense electrically speaking to either fit a slightly thicker wire, or even just double up on the wires.
The strip itself gets up to 75 C, but as these will be living outside up high where there is a breeze I am not worried about them warping the soffit plastic or anything (I also have them standing off slightly using clips). Also, the extra anode line will help a bit I think by not turning the common anode into a heating element.
The ‘MOSFET4 U04’ board which costs about €2 inc VAT delivered shows very little heating by the MOSFETs, maybe +15 C. What is surprising is that the PS2801-4 optocoupler chip gets rather warm, though it remains well inside its datasheet temperature range. There was no PWM as it is fully on, so it’s not rapid switching causing the heating. Its datasheet says it’s happy with 3.3v signalling and it’ll switch outputs of up to 80v.
The heating made me look a bit more into the circuit, which then made me realise that I had wired it wrong by using a 5v level shifter. The optocoupler is powered by the MOSFET power NOT Vin as would be normal in MOSFET breakout boards, so the Vin is completely ignored and the optocoupler detects only the difference between signal and ground. There is a voltage divider for the input which divides the MOSFET voltage by approximately 2.5 to create the input signal for the IRF540N. The MOSFET has a maximum signal voltage of 20v, so the maximum safe voltage for the load is 50v. I’m using 24v for the LED strip, so that yields a 9.6v signal voltage. This is a clever design – it means my 3.3v to 5v level shifter is completely unnecessary, and indeed may be driving too much current through the optocoupler making it get hot. That inspired me to rewire and retest this by removing the level shifter, and this was the result:
Well that is a surprise! This is now the optocoupler driven directly from the ESP32 3.3v output rather than level shifted 5v. What you’d expect is the lower voltage and surely much lower max current would produce less heating, but for some reason it appears to have the opposite effect. I didn’t connect the load in this case, but assuming it wouldn’t cause voltage drop I can’t see any reason why that would affect the heating of the optocoupler.
Looking again at the PS2801-4 optocoupler datasheet, apparently it’ll dissipate up to 200 mW of heat per channel. Four channels is one watt. That might explain things, it is a small chip. I think it’ll need a heatsink when deployed. Good to learn!
Finally, there is a question about why the green is always on? A thermal photo with all signals low explains everything:
That’s clearly a busted MOSFET or it isn’t wired in correctly – either way, it’s always on. I note that the optocoupler is now cool, so I suspect the fault isn’t there, but it can be hard to say. In any case, for €2 inc VAT you just grab another board, and I bought a bag of them.
Northern Lights
About six months ago I was very fortunate to see the Northern Lights come as far south as Cork. We are currently in a solar maximum, I thought I’d give a quick peek assuming it would be clouded out. It was not – once my eyes adapted, I got twenty minutes of reds, greens and blues strobing, pulsing and twisting above me easily visible with the naked eye. Then the clouds came in, so it was over. I didn’t bring my phone with me at the time thinking I wouldn’t see anything, and I could see the clouds coming so I didn’t want to ruin my night adapted vision by getting my phone. So I captured no photos.
I honestly thought that would be the one and only time I’d ever see Northern Lights this far south in my life. However, a coronal mass ejection hit the planet a few days ago, and most unusually it was a clear night. As this was an ejection, the lights were concentrated to the north rather than extending below Ireland like last time, and unfortunately Mallow town is to my north so light pollution rather ruined the view. I did get this:
And that’s very similar to what you could see with the naked eye. You could see the colours just fine, despite the street lamps immediately around and Mallow town spraying light all over it.
Contrast that with the site for my future house which is on the edge of a dark sky reserve:
This was taken at almost the same time by my neighbour Rob with his iPhone. Without doubt Apple have done some postprocessing there, so it wasn’t quite that nice with the naked eye. But it should have been a lot better if you let your eyes adapt than what was possible where I live with all those bright street nights to the north of my house preventing you adapting.
So there you have it – I’ve seen the Northern Lights twice in my life now! And they were awesome.