Welcome to ned Productions

by . Last updated .

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.

Latest entries: Feed icon

Wednesday 16 October 2024: 08:37. Over all these posts on my house build, I have been making slow forward progress on the automation side of things, or at least the parts of it I ideally needed to know before wiring the house. I had thought I was going to run out of time to complete the prototypes and end up having to figure stuff out during the build itself, but it’s now looking very likely that I’m going to complete the prototyping well in advance. On the one hand, that is good as it will reduce figuring stuff out after the frames go up. On the other hand, kinda annoying all this has taken so long.

My remaining prototype projects are:

  1. 3D printing extensions to an IKEA Fridans blind to avoid the expense of IKEA Fytur blinds.

  2. Dimming RGBW LED strips with my ‘new’ IRF540N MOSFET boards.

  3. 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:

  1. 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.
  2. 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) unmodifiedPoE (52.6v) with R42 resistor removed
Deep sleep (two LEDs shining)2 mW579 mWswitch cuts power, so must be < 500 mW
Idle in ESPHome no ethernet (two LEDs shining)386 mWn/an/a
As above with ESPHome trying to get ethernet454 mWn/an/a
Idle in ESPHome with ethernet (four LEDs shining)553 mW1525 mW947 mW
Idle as above with all peripherals for a bedroom600 mW1736 mW1158 mW (estimated)
Deep sleep + ESP32-C3 pulse generator to keep PoE alive
(three LEDs shining plus one pulsing)
46 mW170 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:

ESP32-C3 Super Mini based pulse generator keeping PoE going during main board 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):

CurrentIRF520N wattsIRF520N tempIRF540N wattsIRF540N temp
0.63 A0.08 W+5.0 C0.02 W+1.3 C
1.00 A0.20 W+12 C0.05 W+3.2 C
2.00 A0.80 W+50 C0.2 W+13 C
2.50 A1.25 W+78 C
(needs cooling)
0.33 W+20 C
4.00 A3.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.

ESPHome controlling the RGBWW LED strip

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.

#house #esp32-poe #esp32-c3




Saturday 5 October 2024: 11:46. In my last post on my house build, I expressed frustration that everything had ground to a halt because everybody takes staggered holidays during August, effectively wiping it out as anybody not on holiday gets blocked by somebody else on holiday. One month later, there has been no further progress still. This got me rather annoyed, my house was clearly getting back burnered behind other people’s projects while we here keep renting – so I had to go make some noise as the squeaky wheel is what gets the oil. But all very annoying, Ireland is now building more houses per capita than anywhere else in Europe and it’s very noticeable how everybody is pegged out. There is no ‘spare slack’ which I’m sure is frustrating for everybody, but well to be blunt I don’t care about other people – where’s my house???

Anyway here’s hoping that by this time next month we’ll be out of structural engineering. Three months for SE is a long time.

As we all sit around waiting, I have been pushing onwards with the future house projects. Last post I mentioned:

  1. Implementing the ventilation boost fan per inlet and outlet in the house.

  2. 3D printing extensions to an IKEA Fridans blind to avoid the expense of IKEA Fytur blinds.

  3. Dimming RGBW LED strips with my ‘new’ IRF540N MOSFET boards.

I haven’t got to item (3), but I’ve made significant progress with (1) and (2). (1) is what I’ll be writing about today.

Ventilation boost fans

Last post I said:

I shall be testing a €4 inc VAT driver based on what Aliexpress claims is a BTS7960 H-bridge. It claims it can handle 43 amps, the reviews are clear it cannot, but it should handle the max 3 amps we’ll ever demand from it. The BTS7960 can take a max 30v, so I’m a little concerned that back EMF from the 24v bilge pump fan might spike over that. However it would seem that these bilge pumps respond very well to lower voltages, they turn well at 5v and have more than plenty flow in my opinion at 12v (and at 24v, they’re insane) so chances are very high I’ll run them at 12v and make everything easier on myself.

And here it is wired up:

The BTS7960 H-bridge is by far the cheapest ‘not small’ motor driver on Aliexpress. I had been a little worried about it, but having tested it myself and watched plenty of YouTube videos of other people testing it (including to destruction), I’m feeling much happier with it. The BTS7960 ICs themselves (assuming they aren’t fake clones) claim a max 43 amps, but they’ll throw out an enormous amount of heat for that and besides the cheap module these are mounted on doesn’t have thick enough traces to handle such current. YouTube reviews reckon the safe maximum without active cooling is about 15 amps, and moving the heatsink from the ‘wrong’ side to the front also helps.

There isn’t much to the ESPHome scripting for this – you put a PWM onto the forward and backwards pins, and a digital output onto the forwards and backwards enable. Enabling both backwards and forwards shorts the windings, which equals braking now as the back EMF from the motor stops the turn quicker than preventing the back EMF flowing. The BTS7960 is happy with 3.3v TTL and at the currents that the ESP32 outputs, so it ‘just works’:

Ventilation fan driven by a BTS7960 and an external 12v DC power supply

The first thing you may notice in the video is coil whine – for some reason I don’t remember now, I had configured the PWM for these to 3662 Hz so unsurprisingly, there is a clear 3662 Hz tone in the video. I think I might have done that to reduce the impact of voltage spikes from back EMF on the electronics, but if I’m now running at 12v which I think I am (as you can see, they still go like the clappers despite being 24v motors), then something much higher frequency would make sense. The ESP32 has a 80 Mhz base frequency for its PWM, so the obvious choice would be 625 kHz to give 128 steps. However the datasheet for the BTS7960 says 25 kHz is the maximum, so 2048 or 4096 steps seem like reasonable choices and nobody will be hearing 20 kHz whine.

The second thing you may notice if you have a HDR display is that the above video ‘glows’ brightly compared to the rest of the page. This is because it is in HDR10+! What won’t be so obvious is that it’s the first ever AV1 encoded video on this website, and I encoded it at 1080p Full HD in ten bit HDR with stereo AAC audio with a capped bitrate of 500 Kb/sec. That entire minute long video is only 3.8 Mb long! Two hours of it would be 456 Mb.

I think you’ll agree that it came out very well for such a low bitrate, so I expect to be mounting all future videos directly on this website instead of having YouTube host them. I only have seven videos on YouTube, so there’s even an argument of converting the lot down to be direct. I had only ever mounted two videos directly to this site before, both reduced severely in resolution to keep the file small, but if AV1 can encode 1080p Full HD in HDR10+ at that kind of quality for that low file size I think that’s the future. What I’m still wrapping my head around a little is that twenty five years ago, ninety minute movies came in a 700 Mb file to fit on a CD. For that you might have gotten 720 x 340 resolution encoded in MPEG-4 with MP3 encoded audio. Here we are in 2024 with 8.5x more resolution and Rec.2020 colour gamut in half the bitrate. It’s impressive.

My phone which took the video remains the venerable Samsung Galaxy S10 from 2019. I’ve never owned a phone past two years until this phone, and here it is still going strong into its fifth year (batteries clearly took a huge leap forwards around then). Mine runs Android 11, mainly because I keep thinking it isn’t worth upgrading to Android 12 as surely at some point ‘soon’ I’ll be replacing it. Amazingly, you need Android 14 to take photos which retain the HDR information in the file – despite that as early as Android 10 you could happily take HDR video if the hardware was capable. It’s one of those things you’d have thought very easy to implement much sooner, but apparently not.

Anyway I think that’s the first half of the ventilation boost fan problem solved – it goes forwards and backwards at any speed you like under ESP32 control. There is more though: how do we decide by how much to reverse the fan to stop the flow i.e. how do we detect air flow direction and dynamically adjust the fan reverse to keep air flow stopped?

Detecting ventilation air flow (cheaply!)

I’ve sized the ventilation ducts in the house for a linear pressure loss of 0.5 - 1 Pa per metre, so if we want to cut off air in one part of the house (by turning its boost fans into reverse) to boost heating or cooling in another part of the house (by turning its boost fans forwards), we have some slack in the ducts to drive boosted flow in that direction. The Zehnder ComfoAir Q600 data sheet says it should not have more than 200 Pa pressure at the unit for a long service life, so we will need to balance the speed of the fans to ensure no excessive loads anywhere in the system. For this, ideally speaking, you’d fit air velocity meters at every ventilation inlet and outlet.

The FS3000 sensor is exactly what one would prefer – it has two models, one can measure up to 7.23 metres/sec and the other up to 15 metres/sec. The worst case air velocity in this system is the 180 mm diameter connection at the MVHR unit which is 6.52 metres/sec, so the first model would be the right one. Unfortunately, the FS3000 sensor it is expensive – cheapest I can find it is €55 inc VAT delivered each. I have seven boosted stale air outlets and eight boosted fresh air inlets, so that would cost me €825 inc VAT which is a bit much. Can I do it cheaper?

A Mass Air Flow Sensor like cars use are much cheaper, but as they work by measuring the resistance of a heated wire in the airflow, they are non-linear temperature sensitive and my fresh air outlets will have varying temperatures, so that won’t work. What I really need is something solid state, and temperature insensitive.

I had a few spare BME280 temp + press + humidity sensors, so I tried sellotaping one onto the fan and see what readings it gets:

Ventilation fan with BME280 sensor sellotaped on

In the video I ran the fan both forwards and backwards (you might have noticed I fixed the audible coil whine since) and I found these readings:

Backwards 100%Backwards 50%Stopped 1Stopped 2Forwards 50%Forwards 100%
100048.599 Pa100044.02 Pa100032.2068 Pa100038.2385 Pa100032.901 Pa100016.3545 Pa
0.0164%0.0058%0%0%-0.0053%-0.0158%

The difference between the two stopped values is 0.006%, and that especially clarifies the problem here – yes the BME280 can tell if there is air flow or not (+/- 16 Pa for 100% speed), but due to the drift in the absolute reading over even short periods of time, it won’t be useful for this application.

What I actually need here is a differential pressure sensor which returns the difference between two inputs (here: inside the duct and outside the duct), but the cheapest one of those I can find is €45 inc VAT so not much better than the FS3000 air velocity sensor. So let’s see if there are better barometic sensors for a reasonable price:

NoiseRelative accuracyAbsolute accuracyCost incl delivery
BMP2803 Pa+/- 12 Pa+/- 100 Pa€0.56
BMP3902 Pa+/- 3 Pa+/- 50 Pa€4
BMP5810.1 Pa+/- 6 Pa+/- 50 Pa€53

The improvement in relative accuracy of the BMP390 would be a large help, but that +/- 50 Pa in absolute accuracy is a problem. In atmospheric pressure terms, it’s the difference between 1000 hPa and 1000.5 hPa, so very accurate on that scale which is what it was designed for. But not ideal for my purposes where my max pressure difference will be around 16 Pa.

In any case, I reckon it’s worth a punt on getting some of the BMP390s and seeing what they’re like, so I ordered three. Should arrive within a month.

Olimex ESP32-PoE detailed power consumption

Believe it or not, it’s almost exactly two years ago I first mentioned my Olimex ESP32-PoE boards where I described what was known at the time about its power consumption gleaned off datasheets and the internet:

The ESP32 running full belt minus wifi at 240 Mhz will consume about 50 mA, peripherals can’t draw more than 250 mA if on PoE, and perhaps less than that if on battery. An idling ESP32 might draw 4 mA, therefore a 3000 mAh battery could run the device for between 30 and 750 hours (one month) assuming board power overhead of 20-50 mA. If you can put the device into deep sleep, that draws only 0.1 mA, which could be up to 30,000 hours (or over three years)!

and:

Thanks to this being an open source hardware design, I discovered that the DC-DC stepdown chip is the TX4138 whose datasheet can be found at https://datasheet.lcsc.com/lcsc/1811141153_XDS-TX4138_C329267.pdf. It claims an 84% efficiency. Assuming it’s a linear regulator taking the 5v to 3.3v and therefore burns as heat 33% of the current the ESP32 uses, a 100 mA draw by the ESP32 at 3.3v (one third of a watt) would be 133 mA of 5v, or two thirds of a watt. That turns into a minimum of 0.8 watts of PoE power, which is a best case efficiency of 41%.

By the way, that test board measuring CO2, humidity etc shown in that post two years ago has been running continuously since then with zero issue. Its OLED display now suffers from burn-in, but it’s still going and I have two years of sensor measurements in the database.

Anyway, in the past two years more information has appeared on the internet about these boards, and there is a suggestion that the PoE power consumption can be greatly reduced by removing a resistor on the board. I also needed detailed empirical power consumption metrics in order to figure out whether these boards could drive the blind motor directly without additional power i.e. how powerful a blind motor can I fit without browning out the board when powered off PoE?

You can get a USB power meter easily enough, though the cheaper ones return inaccurate values so shop carefully. Mine is a bit more expensive, but it’s accurate. Finding a PoE power meter turns out to be rather harder – they exist, but cost over €100. And you can get a managed PoE switch for that money, and if you choose the right model it will publish in SNMP the PoE power drawn per port. So I splurged on a TP-Link TL-SG2210P which is the cheapest modern (i.e. 54v based not 48v based) PoE managed switch I could find on the market and I finally have empirical PoE power consumption measurements for the Olimex ESP32-PoE:

USB (5.2v)PoE (52.6v) unmodifiedPoE (52.6v) with R42 resistor removed
Deep sleep (two LEDs shining)2 mW579 mWswitch cuts power, so must be < 500 mW
Idle in ESPHome no ethernet (two LEDs shining)386 mWn/an/a
As above with ESPHome trying to get ethernet454 mWn/an/a
Idle in ESPHome with ethernet (four LEDs shining)553 mW1525 mW947 mW
Idle as above with all peripherals for a bedroom600 mW1736 mW1158 mW (estimated)

One of the first things you notice is how power expensive an active Ethernet connection is. It was designed in the days before low power unfortunately, and a 100 Mbit connection will gladly consume ~110 mW with gigabit and higher sucking down ~400 mW upwards just for idle. It goes even higher if data is moving, but these boards will mostly be silent.

In terms of thermal camera heating after being left in free air for twenty minutes:

Back and front of board when in deep sleep powered by PoE with R42 resistor present. Note that hottest spot (54.5 C) is the R42 resistor on the back

Back and front of board when running powered by PoE with R42 resistor present. Note that hottest spot (70.7 C) is still the R42 resistor on the back, and the overall board is 52 C

Back and front of board when running powered by PoE with R42 resistor removed. Note that the overall board has dropped to 38 C now the 0.5 watts of additional heating has been removed

To be honest, I was a little shocked at how high both the thermal heating and the PoE power consumption is. I had been assuming ~1 watt for an empty board off PoE. I was out by 50%, which adds up if you fit lots of boards. Add some peripherals – in this case, 2x 5v <=> 3.3v level shifters, a BME280 temperature, humidity and pressure sensor, and the rotary encoder on the GA12-N20 motor – and you’re burning ~1.75 watts per board. If I fit thirty of these boards, that’s 52 watts of heat being pumped into the house. To put that into context, my entire 3000 litre thermal store in summer leaks ~60 watts into the house. Adding another fifty watts of background heating puts into jeopardy no overheating of this house in summer!

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.

My first instinct was a 555 pulse timer circuit which are cheap and plentiful at €0.58 inc VAT delivered each, however it turns out when they’re off they consume ~425 mW which seems like we could do better. 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. 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. Which is better than 52 watts!

In case you’re wondering why not use the existing ESP32 for this, one could theoretically modify ESPHome to do this for you. However, it would be a lot of work – the ESP32 has a bootloader stage and a main stage, and it takes 100 milliseconds to reach the main stage. So to get the timings we need, the firmware must exclusively operate within the bootloader stage. That’s deep customisation of ESPHome, and to be honest for €1.50 I can make the problem go away so a second ESP32 it is.

The ESP32-C3 boards are on their way from Aliexpress and when they arrive they surely will be written about here. Watch this space!

If I were starting all this again – and it wasn’t obvious at all at the beginning nor was it available until recently – Olimex now have a v2 of the ESP32-POE which can draw 25 watts instead of 12.5 watts from PoE, and has a built-in 12v 1.5 amp supply. That bilge fan if running off 12v should consume less than that though it would need a slow start implementing to prevent brown out. I’ve already bought the PoE switches etc and they were all sized for max 12.5 watts per port, so that ship has sailed. Still, if you’re reading this thinking about replicating what I’ve done, it’s worth bearing in mind.

Next post I might – or might not – cover the blind automation or the LED strips or the ESP32-C3 boards. We shall see how things go. I kinda do want a video of a real blind going upwards and downwards on command and demonstrating that when it gets to the top, it stops on its own. I have some 3D printing between now and then to reach that, not least because my initial 3D print of the blind spool ended up losing its grip on the motor because the motor’s torque is so strong and its burred the plastic, despite that being ABS. So I had to go get little metal cogs for the end of the motor and I’ll need to redesign the blind spool to fit the metal cog.

Still, what else do I have to be doing? At least this advances the house build in its own way.

#house #esp32-poe




Saturday 24 August 2024: 11:54. Two months since the last post on my house build. Obviously last post when I said:

I expect getting the GA and Structural Engineering (SE) drawings to final sign off will consume a great deal of my free time next few weeks. I also will need to start various balls rolling in terms of getting workers and supplies and indeed the mortgage in place by the various due dates. A long eighteen months beckons before us.

I jinxed myself. Silly Niall.

What the first draft of the GA drawings did enable in the past two months is a first draft of the SE drawings, and then everything went on pause because obviously everybody goes on summer holidays apart from us. I expect nothing further to happen until at least September.

This pushes back the likely erection of the timber frame to Spring 2025. This is disappointing. Anyway, here are the draft GA and SE floor plans for your entertainment:

There isn’t a huge amount to say about these, they are pretty much what the architect’s drawings had, and what deviations there have been I’ve since had undone in feedback. I suppose it is interesting that the most pressing weight in the entire building will be between his and hers bathroom sinks in the master bedroom ensuite.

Despite the further slippage to the build date, I suppose there is at least forward progress. Got to look at the sunny side I suppose.

Before I do my usual show and tell of projects I’ve been working on this past two months, I suppose I ought to mention that an epoch has come to a close. Approximately twenty-four years ago while I was living in Madrid, Spain I subscribed to my first Boost C++ libraries mailing list. That was the first step in what became a long road culminating in me digging real deep to get Boost.Outcome past peer review and into the Boost C++ Libraries in 2019. That, in turn, approximately doubled my earning power for my next role and doubled it again for my following role. Without getting that library past peer review and into Boost, I think it safe to say that I could never have afforded to leave renting and get my own home.

However, I think it’s now time to move on from the Boost C++ Libraries so I won’t be participating there going forth apart from continuing to sustain Outcome i.e. I’ve unsubscribed from everything there, and I no longer consider myself having anything to do with Boost going forth.

Casting to a wider picture, I’m also winding down my C++ participation in general. Serving at WG21 has broken me to be honest, it’s increasingly ‘anything but C++’ for me which is a shame, as it isn’t the language’s fault. I expect that the Sofia meeting in Summer 2025 will be my last face to face meeting, thereafter I’ll attend virtually only. I have ceased progressing all my WG21 papers apart from P1030 std::filesystem::path_view, and assuming that makes it in before the C++ 26 IS major feature deadline (yes, you guessed it, Summer 2025), that will be the only evidence of seven years of my service at WG21.

I am not remotely alone in moving on – WG21 broke a whole generation of us with our ideas about getting good engineering achieved. A good portion of my generation of C++ programmer at Boost and at WG21 will in fact be moving on like me. It’s funny you know, wind me back twelve years ago and I couldn’t really understand why people moved on as a whole bunch just had after C++ 11 had shipped, but now that C++ 26 will ship soon yeah I totally get it now. The standards process just chews you up if you try to change anything which matters. And then you find yourself asking why am I bothering with all this if it isn’t pleasant, doesn’t benefit me, and I don’t get paid for it?

As you might gather, I’m on the hunt for a new programming language to dig into, one without the baggage and dysfunctionality of C++. I haven’t seen one yet, but I’m hoping a true C++ successor might turn up soon (and no, Rust isn’t that). To preempt people emailing me with their pet languages, this is what I seek from a true C++ successor:

  1. SIMD orientated, not scalar orientated.
  2. Stack unwinding resource release.
  3. Functions default to doing only static memory allocation like for embedded toolchains (i.e. where the linker can precalculate all allocations and reserve space for them at link time), otherwise you are required to supply memory from outside. A function can opt out of this so it can use unbounded dynamic memory allocations, but then only ‘non-deterministic’ functions like it may call it.
  4. Same as the above, but for thread synchronisation.
  5. Borrow checker, but not annoying and productivity damaging like Rust’s.
  6. Superb compatibility with at least two existing major language ecosystems so it isn’t a pain to bridge in existing codebases.

The closest that I am currently aware of is Mojo, but the syntax is too scalar and Python-like for me personally. What I’d really prefer is a syntax which encourages you to write in SIMD friendly terms to the maximum extent possible.

Until my shining knight in systems programming language armour turns up, I intend to move over to WG14 the C programming language where I hope to get modernised signal handling into C, and thence into absolutely everything else. It should keep me busy for a good few more years yet. And I probably will do a circuit of the global C++ conferences as a good bye swan song, say good bye to lots of people, tie everything up nicely.

Taught myself further how to design 3D printable things

As I was looking after my children during my mornings before work throughout these past two months, my productivity has been quite impaired compared to normal. Still, I bit the bullet and invested several more very late evenings these past two months into learning how to design things which can be 3D printed, building on my experience gained in designing the picture frame shown in the last post. I went at things again in MeshMixer and I yielded this by early July:

This is my ‘midi’ case for my Olimex ESP32-POE boards which I’ll be fitting throughout my house (you can find its Thingiverse page here). The midi case can take up to a 3400 mAh battery and an additional breakout board which almost certainly will be an Olimex UEXT extender for my use cases. This is the first thing I ever printed in ABS on my Anycubic Kobra Go 3D printer, and I can testify getting a successful print is indeed a black art on this printer, which isn’t really designed for ABS printing. My printer has a Bowden drive, which pushes and pulls the filament far from the hotend. This introduces ‘bounce’ into retraction cycle, which means filament is left in the hot end, and ABS it tends to singe which then means it clogs and then flow stops. Or if the hotend is too close to the print surface, it can’t extrude quickly enough so it singes and it clogs. Or if the wind is blowing slightly wrong, it singes and blocks. Painful.

As we saw in the commercial print of the house model with a Prusa XL, a direct drive hotend has no such troubles with ABS. But that’s a far more expensive printer than mine, and maybe by varying ABS filament I might find one less finickety than my current ABS filament in my cheap printer.

After the midi case, there was an obvious ‘mini’ case waiting to be extracted:

And then a maxi case, though it has design quirks I’d like to change about it so I haven’t uploaded it to Thingiverse yet:

My maxi case is currently wired up as a prototype for a bedroom in the future house. All available i/o bar one input is fully loaded:

  • GPI34 (PINS) is unused (is always pulled up)
  • GPI35 (PINS) is wall dimmer switch level shifted down to TTL
  • GPI39 (PINS) is external power supply voltage (analogue)

  • GPIO13 (UEXT) is I2C-SDA for sensors
  • GPIO16 (UEXT) is I2C-SCL for sensors

  • GPIO4 (PINS) is blind motor sensor A
  • GPI36 (UEXT) is blind motor sensor B
  • GPIO0 (PINS) is blind motor PWM forwards
  • GPIO1 (PINS) is blind motor PWM backwards

  • GPIO2 (UEXT) is LED strip colour R
  • GPIO5 (UEXT) is LED strip colour G
  • GPIO14 (UEXT) is LED strip colour B
  • GPIO15 (PINS) is LED strip colour WW

  • GPIO3 (PINS) is ventilation fan driver enable
  • GPIO32 (PINS) is ventilation fan forwards
  • GPIO33 (PINS) is ventilation fan backwards

Chances are high that LED strip pins R, G and B won’t be wired in in most rooms as those only have warm white downlighters. In fact, chances are high that initially I won’t wire the lighting into the ESP32 boards at all, as it’ll save me time.

The ventilation fan drive I haven’t tested yet, but I shall be testing a €4 inc VAT driver based on what Aliexpress claims is a BTS7960 H-bridge. It claims it can handle 43 amps, the reviews are clear it cannot, but it should handle the max 3 amps we’ll ever demand from it. The BTS7960 can take a max 30v, so I’m a little concerned that back EMF from the 24v bilge pump fan might spike over that. However it would seem that these bilge pumps respond very well to lower voltages, they turn well at 5v and have more than plenty flow in my opinion at 12v (and at 24v, they’re insane) so chances are very high I’ll run them at 12v and make everything easier on myself.

Something a bit mad to consider is that my fresh air ventilation pipes will need 50 mm of insulation each side, so a 100 mm diameter pipe will become 200 mm. The above bilge pump takes a 100 mm pipe, it itself is 135 mm, so it’ll be entirely encased within the insulation and apart from some wires sticking out you’ll never know it was in there. I’m hoping that the motor will tolerate the ~60 C air temperatures, as a bilge pump it should. The plastic is ABS, so should be absolutely fine at 60 C.

You’re likely going to be very curious about the blind motor. This is my solution to paying a lot of money for IKEA Fytur blinds, instead I’m going to motorise a very cheap IKEA Fridans blind using ABS printed parts and a carefully chosen GA12 N20 geared motor with rotation encoder costing €7 inc VAT which is small enough to fit inside the blind’s roller. I won’t say much more about it this post other than I’ve successfully got it to turn from the ESP32 using only the available 5v amperage from the PoE supply without seeing power brownouts, and I can testify it has quite considerable torque and should be able to lift quite a lot of blind. What I haven’t got working yet is getting ESPHome to detect when the motor has stopped turning, and to turn off the power. Free time will fix that, as always.

House model display case

The custom made cases for the commercially printed house model arrived and for the money, they are excellent:

The acrylic upper is fully bonded and forms a single surface. The base of the large model has mahogony laminate strips, while the base of the small model is black acrylic. Including delivery, for under £200 inc VAT. The supplier’s name is LasAcryl Ltd, they’re actually French but of course their English website thinks the only possible currency is Sterling.

The extra height of the case will be used by standing each layer of the house on stilts, with little LED panels inside lighting the house. You’ll thus be able to see all around the inside of the model house whilst standing instead the actual finished house. It may well be a decade before I get to assemble all the parts to create the final display case, or if this build takes even longer I might just get it done before the build starts. We’ll see.

House dashboards, revisited

Last post I mentioned that I didn’t like the e-Ink displays for the future house dashboards, and for £115 inc VAT you could get a portable touchscreen monitor off Amazon. Well, I went ahead and bought one for £98 inc VAT instead:

Apologies for the stock image, it’s because the actual device is already out at the site configured as the TV for the children to watch when we’re out there using the old TV box, old TV remote control and some very old computer speakers (y’see, this is why one should never ever throw anything out!).

And well, for the money, I am impressed! The PoE powered Raspberry Pi Zero 2 described last post will power it without issue (albeit with a bit of tweaking to overdrive the HDMI signals on the Pi). The touchscreen works great and the Pi recognises it. I can display interactive graphs which respond to touch – it ain’t quick because the Pi chugs a bit when rendering 1080p, but it is absolutely functional.

In terms of the device itself, it is surprisingly good for the money. The display isn’t bright, but given that it works from USB power alone and illuminates 15.6 inches, I think it’s as good as is feasible for the five watts available to it or so. As it’s an IPS panel, colour reproduction is very good apart from magenta tending to pink. The 1080p resolution is plenty for this size. Using this display indoors if it’s bright sunshine outside is just about okay, if it’s cloudy outside then it’s plenty bright enough indoors. Its speakers are absolute crap, barely any volume out of them, but I have my old computer speakers for that and it does have a headphone jack. It has half a 75 mm VESA mount on the back, and I’ve already affixed that to a cheap monitor arm, later it will get mounted on the wall in the kitchen.

Oh and there’s one more kicker – yes it responds to VESA brightness commands, so you can dim it and brighten it arbitrarily. If combined with a Time of Flight sensor to detect local motion, you can wake the display if somebody goes near it. Very nice.

What comes next

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.

I’d like to get that BTS7960 driver tested with my bilge fan at 12v to make sure it definitely works as expected.

And finally, I’d like to get a reference house bedroom ESPHome firmware written and debugged, which includes window blind control.

If I get all those done, I’m sure a further post will appear here. And god help us if the GA and SE designs get finalised as I might actually finally have to pay for some timber frames!

#house




Sunday 30 June 2024: 22:05. On Friday afternoon the first draft of General Arrangement (GA) drawings arrived from our Timber Frame Supplier. This finally means forward progression in my house build! This starts the clock at long last, and the Gantt chart for all the pieces of the puzzle can finally be shown with some expectation of accuracy:

You will need to click and zoom in on that to make it readable, however upshot is that assuming no unpleasant surprises and that there is sufficient cash flow to maximally parallelise jobs, the outer walls should be up by the start of February 2025 and it would be complete enough to move in before April 2025. The former I think possibly achievable, the latter I do not as I think cash flow will become a serious issue around then especially as we cannot connect sewerage until the outhouse foundations and walls are erected as a minimum. The building will be weather proof, so it now becomes a question of time. We shall cross that bridge when we come to it.

I expect getting the GA and Structural Engineering (SE) drawings to final sign off will consume a great deal of my free time next few weeks. I also will need to start various balls rolling in terms of getting workers and supplies and indeed the mortgage in place by the various due dates. A long eighteen months beckons before us.

Anyway, on a lighter note, the last four weeks saw me continue to horse through backlogged todo items. All sorts of things the parts for which had been bought, tested to make sure they worked and then shelved until more free time appeared have seen completion. Some of these backlogged items were as much as two years old!

9.5v DC power supply fan fix

The first thing I got done wasn’t actually backlogged, but it did take six months to complete as my first approach to doing it didn’t work out, so I had to wait for a second round of parts from Aliexpress. You may remember from last year that the downlights in the house will run from a 9.5v DC power supply, as that had been empirically tested to produce far less heat which will greatly lengthen the lifetime of those very cheap bulbs. It made no sense to downconvert that from the 54v DC mains, it isn’t as efficient as a dedicated three phase to DC power converter. As I only needed a few hundred watts, you can’t actually get three phase AC input supplies for such a low wattage, but you can get two phase supplies. This is one such also from Aliexpress:

As you can see, I have attached an additional board using twine . I’ve been generally impressed with the power supplies I’ve received off Aliexpress, for one quarter the cost of a European made power supply they’re worth buying two of them as a backup and you still save half the cost overall. The build quality isn’t quite to European levels, but at one half the cost with a redundancy, that’s very acceptable. And it’s not like the build quality is bad, not at all, it’s just they cut corners on little things to get the cost down such as in this case, the cooling fan which goes at 100% all the time. To fix this, I added via twine a PWM fan controller and replaced the fan with a variable speed one, total cost under €20 including delivery. And it works a treat, the fan spins slowly at low loads and spins up nicely as the power supply’s heatsink passes 40 C. The conversion efficiency on this one appears to be not as good as the big 54v power supply, I make it around 80-85%, whereas the big supply definitely hits 90% efficient despite me loading it by only five percent. I assume the two phase input is naturally less power efficient than three phase. Still, for the money and given my electricity will always be free of cost, I don’t really care.

(I originally thought that the fan controller could PWM a dumb fan, but it turns out it doesn’t have the resolution nor the smarts, which the Chinglish item description did not make clear. In the end, there was no rush on this and I could afford to wait six more weeks for the right kind of replacement fan).

100w vaulted ceiling floodlights

In the lighting plan, we need to provide a baseline lighting of the ceiling, which is a large volume of space. Said plan envisaged two 100w 3000K industrial flood lights and two 100w 4000K industrial flood lights, each individually switchable. You could thus have daylight, warm white, middle road between the two in four possible brightnesses.

The 4000K colour temperature of the 100w floodlight is rarely in stock, so when it came into stock I snapped up two as they are hard to find otherwise. The 200w model gets up to 67 C which had worried me for indoor use, thankfully the 100w models are much tamer despite having much smaller heatsinks:

56 C I think will do just fine. These flood lights have a double duty, they will be put onto long extension cables so they are highly mobile around the inside of the house after the frames are erected. You can thus position them wherever you need them to be which will be a real boon for working inside the house during winter. Once the inside wiring gets done, they’ll get mounted into their final places.

Commercially printed house model

Last month I mentioned that I had sent off my house model to be printed commercially by a Prusa XL in ABS at 1:62 scale. There was a problem – the roof printed poorly on my printer, but disasterously on their much higher resolution printer. They very kindly allowed me to manually remesh the roof and send the fixed top part. The results came out lovely:

This was printed to the maximum that the Prusa XL can do, 320 mm width using ivory coloured ASA plastic. It came out really nice, the added detail is amazing. I have yet to remove the supports using a sharp knife, I am somewhat not in a hurry because I need to retain the removed plastic to create a ‘plastic slurry’ by dissolving it in acetone. It’s certainly a weekend of work, and I think I’d prefer to do that all at once in a single shot.

I have ordered from Aliexpress LED panels so the inside can be illuminated, and I intend to mount the three parts vertically separated using transparent cake stands. The entire lot will go inside a custom made display case, which I have ordered after much humming and hawing about which online vendor to choose. I expect to mount it in the house where I will be mounting the plans, the history of the evolution of the design, and so on.

When all the bits arrive, if a weekend of time appears, I’ll get it all cut out, slurry paste applied where it is needed, wired up and mounted and then put away into storage. Or, I might kick it into the long touch as well and not get back to it for two years. Depends on what the next eighteen months will be like.

Network connected 3D printer

I keep mentioned the two years ago thing because when I bought my Anycubic Kobra Go 3D printer two years ago, my original intent was to connect it to Wifi via a dedicated Raspberry Pi so it could be operated and monitored remotely using my phone rather than me having to physically go check it every few hours to make sure nothing has gone wrong. I bought all the parts at the time including the then very scarce Raspberry Pi Model 3A+, but never got back to it.

Well now not only did I get back to it, but I completed it! Here is my new setup:

As 3D printers can catch fire and they produce fumes and this one is living in the garage which is full of dirt and insects and cold, I placed the printer inside a fireproof enclosure from the beginning. I had bought an oversized one to fit a filament heater, as southern Ireland is a very damp place and without heating the filament to dry it out first you will not get much printing done successfully. Between the filament heater and the printer, if the lid is closed it gets quite toasty in there, which is a very good thing to avoid curling and bed and layer separation in your prints. Print results, as you have seen, have been very good for such a cheap printer.

For PLA and PETG, by the time upper layers get printed where the enclosure temperature matters for those materials, it will have warmed up. For ABS and ASA you need the enclosure to be fully warmed before printing begins, otherwise your print will not go well. This creates a chicken and egg problem – you can’t start the print without opening the enclosure and letting out the heat. Unless you network it so it can be operated remotely.

The 3D printing hobby community have had for many years a solution to this, it is a dedicated custom edition of Raspbian for Raspberry Pis called Octoprint. You 3D print a case with integrated camera mount using a cheap and nasty IR cut camera, and you need to wire a special USB cable with the 5v line disabled otherwise it won’t be reliable due to bad power supply interactions between the Pi and the printer electronics. You may also notice the BME280 temperature and humidity sensor hanging out the top of the Pi to measure the enclosure’s environment:

2.4 Ghz Wifi reaches into my garage sufficient for the Pi’s embedded antenna just fine, so this works very well. You can remotely watch the camera in pitch dark thanks to the IR lighting, send it stuff to print remotely, and otherwise command and control and monitor all its sensors and progress. I printed its case in PETG, this made snapping it together a bit of a pain, but PETG doesn’t get soft with temperature as easily as PLA so it had to be done. If the enclosure gets up past 40 C, with the camera and Pi adding maybe 15 C to that next to the plastic, PLA I think would sag.

I haven’t tried an ABS print yet using the new setup. I do know what I intend to print, but until the other parts of that arrive from Aliexpress it can wait. In any case, I now can theoretically actually print ABS parts at long last, which was a showstopper for another house related project I’ll describe in a later post if it works out.

House dashboards

As you will remember from past posts which decided this, the house’s automations are based on the Olimex PoE ESP32 board of which I bought fifty. These are great and have proven very reliable, I have one in continuous service as a test and it has been faithfully capturing CO2, temperature, humidity, pressure and air quality every ten minutes and logging them to a network database and showing the numbers on an attached OLED panel. It’s been doing that without break for two years, and has been utterly trouble free. Well, the OLED panel is losing brightness, so I won’t be using more of those in the future, but the board and sensors have been working very well.

As much as the ESP32 is great, it has limited capabilities to drive a display, especially my older ‘WROOM’ edition which unlike the ‘WROVER’ edition it lacks external PSRAM. Due to its slow onboard RAM and that its fastest interface its SPI bus can’t be driven much past 50 Mhz, any attached display maxes out at around 320 x 240. That’s fine for small local displays, but not useful for dashboards you’d want to notice from afar if something is going wrong e.g. thermal store is low on hot water.

I happened to come across on HackerNews that you can now get six colour e-paper for a reasonable price. These displays have the big advantage of costing zero power if they are not being changed, and I was curious to see if they might be suitable for my dashboards as the black and white ones traditionally available didn’t have any way to signal ‘attention’ via colour. I thus bought from Waveshare a 7.3 inch six colour e-paper display for €86 inc VAT, which was as much as I was willing to punt on a test. They have much bigger displays, but those cost a lot more.

While I was on the Waveshare website I noticed that (a) they would sell me multiple Raspberry Pi Zero 2’s in a single order, as many as I would like and (b) they had a reasonably priced PoE hat and case for the Zero. So I ordered four of those, taking advantage of the volume discount and once assembled they look like this:

The sellotape is to keep the lid on, as it isn’t tightly fitting. But yeah, all the ports of the Pi Zero 2 exposed, with four additional USB ports, and a 100 Mbit PoE ethernet, with case for €57.50 inc VAT each. This isn’t exactly cheap, about double my cost estimates from three years ago for a Pi based PoE powered solution. However (i) this is a Pi Zero 2 not a Pi Zero (ii) Pis don’t cost €5 anymore from anywhere, these were in fact €26 inc VAT each (iii) the PoE circuitry here is ‘proper’ and not cheap and based on an inefficient linear converter like the Olimex boards (iv) there has been a good +25% price inflation in general terms since that post three years ago. This explains the doubling of cost, as much as none of us will like it.

They definitely have a switching power converter in their PoE circuits:

46 C is as hot as I could make the overall assembly – the Pi Zero 2 going full belt draws maybe 3.3 watts according to https://www.cnx-software.com/2021/12/09/raspberry-pi-zero-2-w-power-consumption/. I probably didn’t have it drawing that much from the SoC, but I did add a bit of load on USB. Waveshare claim their PoE circuit can sustain 12.5 watts which is the bottom grade of PoE, and I didn’t test more than maybe 5 watts. But I would be surprised if the temperature got much past 65 C even at full load. Unlike the Olimex board’s cheap linear converter, this one appears to be switched, with three hefty large capacitors to smooth out the buck converter. I guess you get what you pay for in this stuff, though not always as my review of PoE ESP32 boards a few years ago showed – boards costing more than this still had crap PoE circuits, so it’s nice to see Waveshare didn’t skimp here.

As much as this is qualitatively better it is obviously still four times more than the €15 inc VAT per PoE ESP32 board (and I exclude the sdcard, which takes it up to just over €60 inc VAT per Pi), however I don’t expect to need many of these in the house, in fact I think three is likely plenty with the fourth as the spare. And unlike the ESP32s, these can drive big displays, up to 1440p over HDMI albeit at a reduced refresh rate. You do need to keep resolutions below 2048 if you want hardware graphics acceleration to work however.

Waveshare supply a convenient HAT for the PI to drive their e-paper displays. The displays themselves are very delicate, in fact I managed to fatally crack my one trying to get it into the predecessor of this frame which is my first ever 100% designed by me 3D printed item:

This is the second edition, the one which doesn’t crack the panel . I chose black PETG for this to get a shiny piano black effect, unfortunately I didn’t use a high enough temperature as it’s been two years since I last printed in PETG and I’d forgotten. So it came out a bit rough … but it certainly does the job and I’ve uploaded the design to Thingiverse for others to reuse.

The crack in the panel produces display corruption which is very annoying as it’s €86 down the drain, however looking past that I found myself unimpressed with these displays as a dashboard. They don’t ‘pop’ enough due to needing ambient light. If they were trying to attract attention, I don’t think even if emblazoned in red with ‘DANGER’ all over anybody would notice them. The contrast ratio just isn’t there, and you’d need a spotlight shining on them to notice them which kinda defeats the purpose.

Most of my tests work out thanks to plenty of research beforehand. Some do not, and this was one of them. And that’s okay, better to have lost €86 than hundreds of euro had I chosen a bigger edition of this type of display. And I did score a bunch of Pi Zero 2 which albeit expensive, come in a useful PoE package and will be very useful down the line.

I may well be getting another order from Waveshare however. I don’t want to waste my lovely frame, so I might order a black and white e-paper display, something cheap while I also purchase something else I noticed there last time: a USB powered monitor.

Waveshare have a set of curated portable monitors tested to work with the Raspberry Pi’s USB supply. You just need to connect USB and HDMI and voilà, it works, nothing else needed. The portable monitor has a touchscreen, so you can even prod around. I went through all the portable monitors they have, and I believe this is their biggest which can be powered solely by USB:

https://www.waveshare.com/product/raspberry-pi/displays/lcd-oled/10.4hp-capqled.htm?sku=24647

This is a 10.4 inch IPS display 1600 x 720 resolution with 94% of sRGB for around €125 inc VAT. That is expensive, you could get a 15.6 inch touchscreen 1080p portable monitor off Amazon UK for €115 inc VAT. However that would need an additional power supply, and the display would be undoubtedly much less bright.

Anyway all those are decisions for later this week. It has just passed 3am, so definitely time for bed for me.

#house




Sunday 2 June 2024: 22:32. Here is the annual update to my periodic comparison of storage bytes per inflation adjusted dollar for magnetic hard drives, flash SSDs, and Intel Optane XPoint devices (you can find all the past posts here), which I have done every June since 2012:

Raw data: http://www.nedprod.com/studystuff/SSDsVsHardDrives.xlsx

This time last year I predicted:

This time last year I thought a recession would be upon us by now, as interest rates rose above inflation in order to bring it down. I still think that will happen, it just hasn’t happened yet – interest rates are indeed many times higher than last year, but inflation hasn’t really dropped by much. So either there will be recession sooner rather than later, or interest rates will have to rise some more. In any case, a recession.

It looks like the storage manufacturers were thinking similarly to me: there has been this year a hefty increase in the prices of hard drives and especially flash storage (and remember the above are inflation adjusted, so these are large price increases in real terms). I would assume this is because they curtailed production last year under the assumption that higher interest rates would reduce demand, and then demand didn’t reduce as much as expected so prices have gone up.

Unusually, this year saw a large increase in the price of both spinning rust and SSDs simultaneously. I think this is unprecedented. In previous years, either hard drives or SSDs individually saw large swings in price, but seeing both swing together in the same direction is new. By my reckoning, capacity per inflation adjusted dollar drops (i.e. large price rises) occurred in 2021 (hard drives), 2016 (flash), and 2011 (hard drives). For the hard drives, that was the covid pandemic/Thai floods and the financial crisis respectively; for the 2016 flash price rises, there was a sustained flash shortage for reasons google isn’t finding for me right now, but certainly to build a new fab takes a minimum of two years at best.

Optane’s 960Gb drive saw a hefty price decrease while the largest drive saw a hefty price increase. The 960Gb drive is now affordable – indeed, I bought one myself, and yeah it’s a latency monster. Sticking a few of those in RAID0 makes for some very fast storage, though it would need to drop in price a bit more still to justify say a 4x RAID0 array of them. CXL is supposed to be the long term replacement for Optane, and there are CXL memory expansion devices for sale right now, but they are very much enterprise priced and likely to remain a niche use case. I suppose that makes sense – my Threadripper Pro plus its very expensive motherboard can take a maximum of 1Tb of RAM (8x 128Gb), and its BIOS supports CXL memory expansion. 8x 128Gb Samsung ECC RAM currently costs around €4,600 inc VAT, so if you need more RAM than 1Tb you’re probably into a fairly rarified and enterprisey customer set. I currently have 128Gb fitted which actually comes from the Threadripper before the current board, and while occasionally it’s been constraining it hasn’t been frequent enough to make me consider an upgrade. I’m not that customer set, in other words.

Obviously Optane’s inventory and stock is being run down, so I’m hoping to pick up another three of those 960Gb drives at a very good price at some point. We’ll see how it goes. After that stock is exhausted, I suspend we will be waiting on SSD vendors to expose zoned storage to consumer level drives to see Optane-like i/o latencies – frustratingly, this is currently 100% a firmware choice by the vendors, they could flip it on tomorrow for recent SSDs if they wanted. Chances are it’ll only take one to do it to force everybody else to follow, so here’s hoping!

#ssdsvsharddrives




Click here to see older entries


Contact the webmaster: Niall Douglas @ webmaster2<at symbol>nedprod.com (Last updated: 2019-03-20 20:35:06 +0000 UTC)