hansrune / HeatPumpControl

ESP32c3 board with IR blaster and serial ports for heat pump control over local WiFi with ESPHome or ESPEasy firmwares

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generic ESP32c3 board with IR blaster, IR receiver, serial port, i2c and more

A small DYI generic mini IO based on ESP32c3. This one has an IR blaster, IR receiver, and serial port with a simple 5V - 3.3V level shifter suitable for Mitsubishi CN105 port, and similar for any RS-232 interfaces . Other ESP32c3 pins are available with pin headers for I2C, 1-wire, and other general purposes

This board is tested with ESPhome and ESPEasy firmware (build instructions below), and is easily used with home automation systems that support MQTT auto discovery, the native Home Assistant API, and the many controllers that ESPEasy supports

A 3D printed box STL files and the FreeCAD design is also available

PLEASE NOTE: Use at your own risk. The ESPhome firmwares are unofficial and reverse-engineered Mitsubishi protocol based on the Swicago library. The authors and contributors have extensively tested this firmware. Please note that not all units support every feature. If you need an officially supported method to remotely control your Mitsubishi device via WiFi, a commercial solution is available here

Introduction

This small IO board was made to easily fit inside a small DYI box, a heat pump or other.

For Mitsubushi heat pumps, the CN105 connector is used for serial port communications and for power supply.

Some of the main features and benefits

  • Serial port with simple level shifter for 5V serial ports
    • The CN105 port of Mitsubishi ports can be used - and will then also provide the power supply for the board
  • An IR blaster circuit
    • Some features / command packets are easier to find from a native IR receiver
  • An IR receiver
    • Available to use - but not tested with any firmwares yet. IR protocol decodes from a native remote control is probably easier to do from a Raspberry Pi or similar
  • I2C and/or 1-wire
  • Other GPIO ports
  • WiFi based
    • This is almost a must have for most home automation systems
    • OTA support
    • Configuration backup, restore and bulk updates.
  • Firmware of your choise
    • ESPEasy with Domoticz over http. Device creation uses virtual sensors
    • ESPEasy with Domotics and Home Assistant via MQTT. Device creation uses a MQTT configuration text file.
    • ESPHome to Home Assistant via MQTT and auto discovery
    • ESPHome to Domoticz via MQTT and auto discovery
    • ... and as the hardware supports using both Arduino and ESP-IF development kits, almost any other firmware can be created.
  • 3D printed enclosure
  • Seed Studio XIAO ESP32C3
    • This device is well shielded and comes with an externam IPX antenna connector
    • FCC and CE regulations approved

Setup and mounting

The version 2.0 PCB needs an extra grounding wire if you use the IR receiver ground pin:

Heat pump wiring

The wiring for a Mistubishi heat pump:

A visible LED can be used in series with the IR LED - just in case you want to see the activity

The serial port - CN105 - on our Mitsubishi heat pumps:

The IR sender led fits inside the receiver housing:

And the device including enclosure is tiny, i.e. easy to find room for inside the heat pump:

Wiring for other purposes

The same PCB can be used for many other purposes. Here is for a firmware build test with CO2 sensor, I2C temp/humid and light, PIR sensor and a 1-wire temp sensor

Implementation and design

The schematic diagram is available here. The KiCad EDA project is in the same folder

GPIO pin usage

PIN Capabilty Function
GPIO2 Pulled up N/A
GPIO3/A1 Generic IO On IR receiver pin header
GPIO4 Actice high out IR sender
GPIO5 Generic IO Pull-up possible
GPIO6 I2C SDA
GPIO7 I2C SCL
GPIO9 Active low out Internal status LED
GPIO10 Generic IO Pull-up possible
GPIO20 RX Serial to heatpump TX
GPIO21 TX Serial to heatpump RX

Hardware - getting started

This project uses my KiCad-lib-ESP32 repository as a git submodule. To check this out, use the following:

git clone --recurse-submodules https://github.com/hansrune/HeatPumpControl.git 

Materials used

This project uses the Seed Studio XIAO ESP32C3 RISC-V module. This tiny device has proven to be more reliable than most ESP8266 modules. This module also comes with an IPX connector for an external antenna, and is delivered with a simple external antenna for good range.

5V power can be supplied over USB-C or the serial port pin headers

For more information, use this KiCad BOM

Hardware assembly

Soldering a prototype by hand is possible if you have a steady hand and a small solder iron tip. A microscope is recommended to propely inspect the solder joints.

Recommend to do the SMD parts first, then other components.

3D printed enclosure

An enclosure made in FreeCAD is available in this folder. You may also just use the .stl files for your 3D printer slicer.

Firmwares

ESPHome

ESPHome firmware can be set up from this ESPHome configuration repository using the test_mitsubishi_hp.yaml as a template

Follow the README for instruction on what you will likely want to change.

By default, both the serial CN105 interface as well as the IR sender is set up in this firmware. You likely want just one of them.

In Home Assistant, there is this serial port / CN105 connected control

The IR blaster control:

And the diagnostics / device details:

No 1-wire and lux sensor connected in this case

ESPEasy

ESPEasy can be used with a number of different controllers / home automation systms. A custom firmware build description is available here

ESPEasy requires many settings. For configuration settings and rule files, you can upload the files from this page as a starting point. Please make sure to change name, unit number, controller IP addresses, NTP, syslog host and latitude/longitude. This configuration uses both a MQTT controller and a Domoticz controller. Change to what you need.

Alternatve firmware

You may be interested in looking at alternative firmwares such as this one

Known bugs

The version 2.0 PCB has some flaws that fairly easy to work around:

  • The NPN-tranistor need to be mounted upside down
  • The copper fill grounding is missing for the IR receiver GND pin. An added wire is needed if you use it

License

This project is licensed under the GNU General Public License v3.0 for the software, CERN-OHL-W for the hardware, and CC BY-SA for the documentation and ideas.

About

ESP32c3 board with IR blaster and serial ports for heat pump control over local WiFi with ESPHome or ESPEasy firmwares


Languages

Language:Shell 100.0%