When our home was built in 1972, people had fewer electrical devices. But more importantly, they heated and cooked with gas, which at that time was not only a cheap energy source but also one which few people in the Netherlands seemed to have realized could eventually run out, or cause earthquakes, or cause sea level to rise which could make much of our country uninhabitable, or that it could warm the planet and make many places uninhabitable.
Anyway, when our home was built the need for electricity wasn't so great and a 25 A connection was considered to be enough for average homes. That's what we have. 25 A * 220 V = 5500 VA (which is not exactly the same as 5500 W). We can therefore only draw a maximum of 5500 VA from the mains before we risk blowing the fuse. It also of course means that we can't send more than that much electricity back to the grid from our solar panels without risking blowing the fuse.
These days many people upgrade their fuse boxes, often switching to a three phase connection (often referred to as "krachtstroom") at the same time. Many newer homes are built with 35 A fuses on all three phases, allowing them to consume more than four times as much energy from the grid as we can take. This is the case even when those homes still use gas for heating. If everyone actually started using so much electricity at once, we'd be in trouble: it would require the grid itself to be upgraded and more power stations to be available to supply the demand.
We've not gone down the path of increasing the supply. Instead, we're trying to limit the energy usage of our home and keep our consumption within 25 A, even though we no longer have a gas connection so all our heating and cooking demands are now met with electricity. To do this we need to match our energy production with our solar panels so closely as we can, and to make sure that heavy users of electricity don't all switch on at the same time.
Balancing supply with demand
The wholesale price of electricity varies per hour depending on the consumption vs. production. The shape of the graph varies per month, with solar panels producing electricity in daytime in sunny months greatly reducing the value of electricity generated during those hours compared with the value at the same time in winter.
![]() |
Graph of average wholesale prices of electricity per hour (source). Just trying to match this is a good start, but I ended up doing more as you can read below. |
The price of electricity is directly related to the demand vs. supply. During the night most people are asleep and inactive thus energy demand is lower. During the day the peak demand is at breakfast time and dinner time, while peak solar production is in the middle of the day.
13 years ago when we first installed our solar panels, we would generally try to wait until the sun was shining before switching on large energy users like our washing machine, but nothing in our home automatically responded to the demand curve. At that time not many homes had solar panels so any electricity that we exported was always useful to someone. Our energy company gave us the same credit for every kWh that we produced as each kWh that we consumed, regardless of the time of day or the season. The situation is quite different now because 35% of homes now have solar panels and there are a great many solar farms in the countryside. That is why the price of electricity now drops so obviously during bright days. There are also many wind turbines now and on windy days the price also drops.
Automatically matching demand to supply
When I first installed our electric water heater it ran on a simple and inexpensive mechanical timer which switched it on at about 10:00 and switched off at 18:00 (it would actually stop much earlier when it reached the set temperature, unless we took a shower in the afternoon).
A now retired simple mechanical timer which used to switch our water heater on and off. I still recommend this as a good first step. It's easily affordable and very easy to use. |
The timer was my first attempt at matching demand to supply, and if you can do nothing else I recommend it as it works quite well on average. The timer roughly matched the consumption of our water heater to when the electricity was flowing from our solar panels. However it didn't respond to other appliances using electricity at the same time (e.g. dishwasher, electric water heater in the kitchen, cooker, boiling a kettle) so we would quite often see our total consumption rise above what our solar panels were generating even on sunny days, while later on the same day we'd see the sun shining enthusiastically on our solar panels but the water heater would have stopped ages ago on reaching it set temperature, and we'd be exporting instead. A simple timer is much better doing nothing at all, but we can do better than that.
Reading from the meter
Dutch smart meters have a P1 port from which it's possible to obtain real time readings of the amount of electricity flowing in and out of your home. This provides electrically isolated serial data which it's safe and perfectly legal to use with a DIY project.
The first device that I attached to the P1 port was an Arduino programmed to display energy consumption on a set of LEDs so that we could see at a glance whether we were sending electricity to the grid (green LEDs) or consuming energy from it (red LEDs). It also included an alarm which would go off if we were approaching the 5.5 kW limit for consuming energy from the grid and automatically switched on underfloor electrical heating at any time that the temperature in the entrance hall was too low, or at any time that we were exporting a lot of electricity if the temperature was lower than we'd like it to be.
My intention at the beginning was to completely avoid wireless connections. The air filtration system uses a serial link between two Arduinos on the ground floor and the top floor (there was an existing conduit which made this easy). But for this project I realised quite quickly that it would require me to run a lot of cables. I was also going to need to know the time of day and the date. For those reasons I switched to using ESP32 controllers.
The ESP32C3
The ESP32C3 embedded boards that I'm using are very inexpensive, they contain a fast and powerful 32 bit processor, plenty of memory and even built in wifi. They're also smaller than my thumb.
An ESP32C3 controller board resting on my thumb. |
The first, master, ESP32 is built into the same case as the Arduino, receiving the P1 data over serial from the Arduino. It couldn't replace the Arduino in that location because it doesn't have enough GPIO pins, but the two devices complement each other nicely. This first ESP32 works as a server and the other ESP32 powered device controllers connect to it to find out what they should do. I can see the status of all the devices on a simple web page at a static IP address hosted by the ESP32:
The connected secondary devices all have a mains lead, two sockets (one switched with a relay) and use old phone chargers for their 5 V supply. Some of them use Dallas DS18B20 compatible temperature sensors. Some also have an override button which can be pressed to switch on the heater for a short period when it would otherwise not switch itself on.
The master ESP32 downloads the day ahead electricity prices at midnight and calculates a
ranking of when the cheapest time is for any devices to operate (that's
dayrank and nightrank on the status page above). Secondary devices can then
decide on which hours they can best consume electricity in order to reduce the price, and because these things are intrinsically related, best balance the demand on the grid.
For instance, we know that our main water heater heats its contents at a rate of about 7 C per hour. As a result, the controller can calculate ahead of switching on time how many hours it will need to raise the temperature from the currently measured temperature to the target temperature and it can optimise by only switching on for the daytime hours which rank below that value. At times of the year when our solar power can't cover all our demand it also automatically uses the cheapest nighttime hours using the same mechanism and the nightrank. This means in practice that in the morning when it has some value we allow our electricity to be exported to the grid, while around lunchtime when the price is at the lowest for the day the heater then uses the electricity rather than adding to the excess on the grid.
Note that these controllers also continuously monitor how much electricity is available either by importing from the grid or our exporting to it. Thus if we are producing just a little more electricity than the water heater needs and we put on the kettle to make a cup of tea, the water heater controller responds by switching off until the kettle is boiled, before switching itself back on. This means we humans get priority. The kettle, or anything else that we humans switch on and off, automatically gets whatever solar energy we are generating and we never have to manually switch off any of the automatically controlled devices so that we don't exceed the maximum available from our supply on a dull day. The water heater also automatically responds to such things as fluctuations due to clouds coming and going over our panels, and tries to optimise so that to the greatest extend possible we only consume electricity from our panels when we are generating it.
Whenever the energy price goes negative (which it did for three hours around lunchtime today), all the heaters are told they can go on and consume as much electricity as they want, pursuing a higher than usual target temperature. The extra solar panels on our garage are also switched off by another secondary ESP32 device when there are negative prices.
Does it work ?
This system really does seem to do what I designed it to do. But as I've only just "finished" it (what hobby project is actually ever really "finished") I don't have any substantial data yet. When I do, it'll be added here as an update.
![]() |
Screenshot from my energy supplier's app showing yesterday's electricity price and our consumption per hour (including taxes etc.). Nearly all the system worked yesterday. It should be better than this from now onward. The peak at just before 4 am is from the kitchen boiler, which comes on as a convenience for us during whichever is the cheapest hour at night in order to make sure we have some hot water in the kitchen in the morning. The peak at 12:00 is for an hour when we had negative electricity price, and the hours in the evening are still a bit of a problem even though most of our panels face South West, because when the sun goes down we don't have our own electricity. |
Downloading ?
Once I know that this thing really works, and if people turn out to be interested, I'll make the code available to download somewhere. It's probably easier than starting from scratch. There's nothing amazing or patent-able about any of this - I'm not expecting to make money out of it. Mine is just a small contribution built on the shoulders of giants, including those who wrote the library code for TCP/IP, temperature sensors etc. I used to make a living out of writing code like that, but in the Arduino environment all the low level code for pretty much any device you want already exists. The work of others has made everything really easy to do.
Changing energy supplier
We've changed energy supplier from Pure Energy to Tibber. For the last few years Pure Energy have been paying us about €200 per year more for our exported energy than we paid them. I'm expecting a payment of about €280 shortly to cover the last year + one month that we were with them. Unfortunately, this happy situation wasn't going to continue: Pure's renewal agreement stated that they wanted to start to charge a fine ("terugleverbijdrage") of 14 cents per kWh exported to the grid, regardless of our trying to optimise our exports to be of the most use to them. This would total more than €400 per year. I tried to get a quote from them for a dynamic tariff (with prices per hour) and couldn't seem to get any sense at all from their salespeople.
I'm not expecting to be paid for dumping unusable electricity on the grid at midday in summer when it has no value. I've actually put quite a lot of work into trying to make sure that we don't do that, and to ensure that we use as much of our own electricity as we can, but I couldn't get any sense from Pure. Instead I've had to cancel their contract, which resulted in a snotty email in which they said they were sad to hear that we were no longer interested in using green electricity and gas ("We vinden het erg jammer dat je geen gebruik meer zal maken van onze groene stroom en/of gas!"). There's such a thing as "green gas" ? I don't think so.
Tibber, on the other hand seem to offer a straightforward easy to use dynamic tariff. I'm expecting that our total energy bill for the year will still be negative this year, especially given the recent optimisations detailed above. If you switch to Tibber and use the uitnodigingscode "dyd4ick5" then both you and I will receive €50 in credit for use in their online store - not that I've yet seen anything there which I think I would actually want.
Footnote 1: The ludicrous power of cheap embedded computers in 2025
I've often heard people say things like "this mobile phone has more power than the computers that took Apollo to the moon", but many people have no idea just how much more powerful those things are.
The little ESP32C3 microcontroller boards that I've been using have 160 MHz 32 bit RISC-V processors (including hardware floating point) which execute between 40 and 160 million instructions per second. They have 400 kB of RAM, 4 MB of flash, and include WiFi on chip as well as lots of other neat features. They consume less energy than I can reliably measure and they cost me $1.60 each.
The Apollo Guidance Computer was a truly amazing device given it's design in the mid 1960s. But while the performance was amazing then, it's not so amazing now: The AGC processor was clocked at just 1 MHz, used words 15 bits wide, executed "50000 to 100000 instructions per second" there was just 70 kB of (hand woven) ROM and 4 kB of RAM. They consumed 55 W and cost the equivalent of about $2 M each in 2025 dollars.
So the boards that I'm using execute instructions roughly 1000 times as fast as the AGC, they have about 100 times as much RAM and 60 times as much ROM (flash). And as my code doesn't achieve anything remotely as interesting as landing on the moon, these processors spend most of their time twiddling their thumbs in standby mode waiting for something to happen. By 1960s, 70s, 80s or even 90s standards this is a horrible waste of computing power.
Footnote 2: The ludicrous inefficiency of electric cars
I recently cycled past a garage and saw them advertising "175 kW charging". Yes, while we maintain our entire home on 5.5 kW, charging a single car can pull 175 kW from the grid. That's enough to blow the fuse of 30 homes like ours all at the same time !
