#12 Energy Management and Control Systems

I've held off on writing this entry since I was afraid it might get too technical, and become either too long or just boring and useless with lack of detail. Hopefully I found some middle ground now, and I can show you how I manage and control all the energy related systems. In addition, this entry allows me to write about some of the smaller items such as a battery charger and sensors that complete the whole set-up. Please note that what I built is not something that is necessary for everyone - it's just what I did. 

Perhaps the first questions to answer: what do I mean with energy management and control systems, and why do I need it? In its simplest form, energy management means monitoring the state of charge on the battery, the incoming energy from the solar panels, and perhaps some sensors for the temperature in the buffer tank. Expanding on that, we can include automation aspects: turn on the heat pump when the battery is full to use the excess solar energy, schedule heavy loads based on incoming energy, time of day, and state of charge, etc. In the end, the management and control systems helps you to optimally use your energy, and make sure you don't end up with a depleted battery in the middle of a dark winter day. Doing this manually is possible, but having a hands-off system means more comfort, peace of mind, and the rest of the family doesn't need to learn the systems in place. 

There are several off-the-shelf systems available that allow you to easily monitor incoming solar and battery state (for example Solar Assistant) and to automate a home (for example Home Assistant). Victron also has energy monitoring readily and seamlessly available with their products. While these are great, I did not use them. I wanted something more tuned to my goals, something more custom. A lot of the equipment I have is also not directly supported by these existing platforms, so I would have to add the support myself anyway. My background is in embedded systems and software development, so building this from scratch tailored to my needs is also more fun :)

Monitoring Equipment and Sensors

Let's first go over the various devices and sensors that I want to monitor and control. There are the charge controllers for the solar panels (three of them, all MUST PC1800F), and the inverters (the MUST EP 3000 and the Victron Multiplus II). For the batteries (4 for now, but soon 6) we have the JK BMS. I’ve written extensively about those components in #5.

Something I have not mentioned before: there is a battery charger coupled to the generator. While this could be done with the inverters, I prefer a dedicated device for this. The charger I use is a repurposed 3000W telecom rectifier, an Emerson/Vertiv R48-3000e3 which are available cheaply. If you have ever heard of the 'Chargeverter' sold by Signature Solar: that device is made using rectifiers as well. 

Then, I have three Ruuvi tags for monitoring temperature and humidity in the house, outside, and in the tech building. Finally, there is the heat pump, the wood gasifier, and buffer tank sensors - and related to this, the floor heating controls.

This part will be a bit technical, but I thought it would be useful in case someone else has one of these devices and wants to see the driver code. The the visualization dashboard for all of this is made with Grafana. I've written an entire set-up guide for this here: https://diysolarforum.com/ewr-carta/data_communication/

All the devices and sensors have their own data communication protocol and medium. Some are wireless, others use Modbus over RS485/UART, or CAN. Others have their own protocol, and something like the gasifier can only be remotely controlled through VNC. I have written drivers for all of these and have them on my Github page:

The heat pump is a Tuya compatible device, so it can be monitored and controlled locally (without relying on their cloud) with tinytuya. As mentioned, the gasifier is only able to be controlled remotely over VNC, so I integrated it in Grafana with noVNC. The water tank sensors are just PT1000 resistance thermometer. While I could have made separate read-outs for these, one of them is part of the heat-pump so I just its data. Maybe in the future I will add all of them (there's three, top, middle and bottom of the tank due to stratification). 

For additional controls for the floor heating and some other remote switches, I rely on Shelly devices - specifically the Shelly Plus 1 and Shelly 1PM Gen3 - and use the shelly-smart-device project to control these over Bluetooth (you normally control them over Wifi, but I didn't want to do that). 

The core system this all runs on is an old Dell WYSE 3040 thin client. I could have used a Raspberry Pi or something similar, but I had one of these around and I personally like the stability of the device, and looks pretty good - and you don't have to deal with SD cards. You can still find them used on eBay and the like.

Controls

Now that we can talk to all the devices and sensors, I can implement a control mechanism for optimal energy use. I will describe some scenarios that I have implemented. There are no fancy screenshots I can share because all of this is implemented in code and just runs as a program in the background on the WYSE unit. Yes, there are some switches in the Grafana dashboard to turn things like the heat pump and underfloor heating circulation pump on and off, but I really did not want to have to constantly use these controls manually. 

Weather API's such as Open-Meteo and OpenWeather provide the main source of data for energy generation predictions: I can find out what to expect by taking into account forecasts on precipitation, cloud coverage, or just in general when to expect the most amount of sunshine. Coupled with temperature predictions, I can schedule an amount of energy to be diverted to the heat pump for hot water. This is where having a 3000L buffer adds an advantage compared to just a heat pump: I can store the energy to heat the house in advance. Let's use a practical example based on the above pictured forecast.

We're September. In the forecast we can see that Wednesday (KE - Finnish abbreviation for the Finnish word for Wednesday: keskiviikko) is very sunny, with daytime temperatures over 15C. The amount of heating needed is pretty minimal: at 15C average outside temperature and desired 22C inside, we need about 25kWh of energy. I've made extensive calculations on heating requirements and losses in the #6 Heating Systems entry.

The days after it gets progressively more cloudy, which means diminishing generation and dropping temperatures in the weekend, increasing our energy needs for heating. Let's assume an average of 10C during that period, which increases our daily energy needs for heating to almost 40kWh. Let's go back to Wednesday: because of the amount of sun we have, the batteries are full. We can store the excess we generate in the 3000L buffer tank. My heat pump can produce 60C outgoing water and can fill the entire tank to 60C in a few hours. At a floor heating flow temperature of about 30C (high enough for these outside temperatures) we can store about 100kWh. In other words, that's enough to keep the house warm the whole weekend without having to tap into the battery. Because of the heat pump, even with a CoP of only 3 (it's higher, but let's assume worst case), we'd only need 30kWh of electricity to generate that 100kWh of  heat energy. Something that is easily achieved during that sunny Wednesday, and you'd still have excess from what could be generated on Thursday that week (call it a safety margin).

If we assume that it stays cloudy for another couple of days after Sunday, but then the forecast shows the weather clears up, the system can decide to take another 30kWh out of the battery to run the heat pump in order to store another 100kWh in the tank to keep the house warm. Should the weather continue to be overcast with minimal generation, I would have to fall back on filling the tank with the wood burner. The system will in that case notify me. This process continues until we hit winter, at which time even if there is sun in the forecast, there will be no diversion of electricity to heating due to there not being enough generation even on a sunny day and I fall back to the wood burner. The cycle starts again once Spring comes along.

Conclusion

That's just one one scenario I used, but it has the biggest impact and is the most complex one. Others include scheduling heavy loads, automatically running the generator for the least amount of time needed, load shedding and prioritization, etc. This entry is already quite long as it is, so I will refrain from the details. Suffice to say, this hands-off approach increases comfort and  efficiency quite a bit. Right now I'm working on expanding some aspects of the control system, the big one being making use of historical data and power usage patterns to create better predictions. 

Comments

Popular posts from this blog

#0 The Goals

#2 The House: Core Design Decisions

And in the beginning...