5584

Controller with ESP32-S3 for demand controlled ventilation system with 12 valves and 16 sensors and LCD display

This project is intended as a replacement of the Itho demandflow controller. The reason that this project was started because my controller at home was behaving strange, the transformer and fuse failed and it is expensive to replace. With modern microcontrollers it should be relatively easy to make a controller for such a system. This project is inspired by the orignal Itho controller but not intended to be an exact copy of the Itho controller.

The basis for this design is:

  • Speed of Itho fan can be controlled by either MQTT or HTTP API with settings Low, Medium and High
  • The controller has 12 channels for 12 Itho valves of type DemandFlow Klep (545-7100). The interface is identical.
  • This controller can be a 1:1 replacement
  • The system must be modular, e.g. it is not required to add the display, a different RTC could be used, the number of sensors can be
  • The software must be open source
  • The hardware must be open source
The hardware design is based on common electronic parts. The basis of the design:

  • Microcontroller ESP32-S3 or ESP32. The design is with the ESP32-S3 soldered on the board but one could also choose to install an ESP32 microcontroller through the 30-pin interface
  • 74HC595 for multiplication of processor I/O. Each valve has 4 coils to control and therefore 4 outputs are required per valve. In total 48 outputs are required. The 74HC595 are divided in two groups enabling scaling down to 6 valves for smaller houses
  • I2C interface for: 
    • up to 16 sensors
    • Display (4x20 characters LCD with I2C backpack)
    • Realtime Clock
  • Use of two I2C busses, Wire and Wire1: 
    • Wire: Bus 0 sensors and LCD
    • Wire1: Bus1 sensors and RTC
  • Connection to sensors through I2C multiplexer (TCA...) enabling the use of I2C sensors with fixed I2C addresses
  • Addressable RGB LEDs for status
  • Accurate RTC with battery backup because most actions are time based
  • Single 15V power supply with on-board 3.3V and 5V convertors (1A capacity each)
  • Operation of sensors on 5V or 3.3V. Data communication always on 3.3V
  • MOSFET output drivers for low on state resistance. Alternatively ULN2803 could used as well (pin compatible)

Software design

The software is written in PlatformIO with the standard Arduino framework for ESP32 and ESP32-S3. Few additional libraries are required for web interface, MQTT, InfluxDB, sensors, RGB LEDS, displays and RTC. Software can be found on Github: https://github.com/PeterLourens/DemandControlVentilation

The software uses FreeRTOS functions availabe in the arduino framework. The software is modular because most functions are written as individual tasks. It should be possible to run the software without WiFi connection but with reduced functionality.

The software has the following tasks:

  • Task_web - Async webserver for configuration and monitoring of the system
  • Task statemach - Statemachine to control different operating mode based on sensor readings or time
  • Task influxdb - InfluxDB client for storing sensor data, system operating states and system/debug information
  • Task MQTT - MQTT Client to publish sensor data, system operating states and system/debug information and fan control (option)
  • Task Neopixel - Control of 2 RGB LEDs for system status and fan speed
  • Task valve control - Control of position of the 12 valves
  • Task Wifi - Wifi manager. In the initial setup the ESP32(-S3) will be the access point. Once the Wifi has been configure it will connect to an access point with DHCP or manually configured
  • Task I2C - Task to control all I2C devices
The following external libraries are required:

  • ESP32Async/ESPAsyncWebServer
  • ESP32Async/AsyncTCP
  • ArduinoJson
  • DHT20
  • adafruit/Adafruit BusIO
  • sensirion/Sensirion Core
  • sensirion/Sensirion I2C SCD4x
  • RTClib
  • Ethernet
  • HttpClient
  • tobiasschuerg/ESP8266 Influxdb
  • yiannisbourkelis/Uptime Library
  • adafruit/Adafruit NeoPixel
There are two libraries included in the source:

  • PubSubClient
  • LiquidChristal_I2C
The library LiquidChristal_I2C is fixed to Wire interface. The display is connected to Wire1 and therefore a moficiation to the source file was required and included in the source. The PubSubClient is the original MQTT client written by Nick O'Leary (http://knolleary.net).