An unexpected cold shower made it clear that I need a new controller for our solar warm water heating system ("split architecture" which is typical for installation in middle and northern Europe - thanks @Saabman for helping me understand that I had no idea how solar heating works in other parts of the world).
Of course this is a prime opportunity for applying the notorious STM8 eForth!
Our house is in Germany, in winter a (fossil fuel) heater is required for heating the top of the storage. The controller responsible for that is independent of the solar heating control, and it starts heating when the temperature at the top of the storage is below a certain threshold (typically in the morning on a sunny February day). An advantage of connectivity is that the weather forecast information can be used to change that behavior. A fail safe design is required but the usage of NTC sensors should make that easier. A second sensor for the storage will be required as a overheating protection: a failing storage sensor can lead to 400l of boiling water!
The old controller used a PIC16C84 and the code was borrowed from Microchip AN512 (plus LPF, serial interface etc). The temperature sensors I used then were KTY10 (2K type), the field-and-garden-variety sensors those days, and they're still good.For a quick fix I reused the 5V power supply and the SSR pump control from the old PIC based solution. For now I use a $0.80 STM8S103F3P6 "Mindev" breakout board on a small "solderless breadboard" and some patch wires.
The solar collector and hot water storage have a KTY10 sensor each. Both sensors are in a voltage divider with a 2000R 1% "reference resistor" :
(3.3V) | 2000R | *------*---(PC4) | | KTY10 KTY10 COL STO | | (PA1) (PA2)
The collector sensor is selected by PA1, the storage sensor (middle sensor in the picture) by PA2. A 3rd sensor, storage top, will be selected by PB4.
The first hack "solar.fs" had the following features:
- linearisation and low pass filer for both sensors
- robust measurement in a background task
- safety limit for the storage temperature
- 820 bytes code size (> 2500 bytes free!)
My prototype solar controller and the receiver are connected to an 8-pin nRF24L01+ module (more likely a clone) as follows:
|Pin nRF24L01||Signal nRF24L01||STM8S103F3|
For connectivity I see two cheap standard options:
- ESP8266 (e.g. ESP-01) connected to the serial interface
- nRF24L01+ connectivity developed here
I plan to design a PCB that offers both options