|
| 1 | +# KM271/KM217 WiFi |
| 2 | + |
| 3 | +The current board as of version 0.0.6 got a bit more complicated than earlier versions. It was extended by many features requested from the community. I will explain the features and their options in the following parts. |
| 4 | + |
| 5 | +First of all, KM271 and KM217 is totally the same. The KM271 is the original RS232 extension from Buderus and it was my fault, having a typo here in the early beginning, when first releasing the module to the public. Now many file names have the KM217 in their name and changing it would simply be a nightmare... So just call it as you like it :-) |
| 6 | + |
| 7 | +## I2C |
| 8 | + |
| 9 | +The I2C bus on the board is divided into two parts. The internal one running on 3.3V and an external one separated by a PCA9306 level shifter. |
| 10 | + |
| 11 | +### Internal I2C |
| 12 | + |
| 13 | +The internal I2C parts are not soldered by default. One part is the EEPROM, another is the I2C-OneWire-Bridge. The GPIOs of the ESP32 used for it are: |
| 14 | + |
| 15 | +| ESP32 Pin | Signal | Description | |
| 16 | +|-----------|------------|-----------------------------------------------------------| |
| 17 | +| IO16 | SCL | I2C Clock Signal | |
| 18 | +| IO13 | SDA | I2C Data Signal | |
| 19 | +| IO14 | nINT | I2C Low-Active Open-Drain Interrupt Signal 3.3V !!! | |
| 20 | +| IO12 | I2C_EXT_EN | Enable (this is the EN input of the PCA9306 level-shifter | |
| 21 | + |
| 22 | +#### I2C EEPROM |
| 23 | + |
| 24 | +The EEPROM is meant to store persistent settings, that shall survive a full erase of the ESP32 flash and to persistently store data that is changed frequently and would damage the flash NVM quickly. Since my ESPhome firmware makes no use of it, I decided to not populate this, but keep other makers the opportunity to easily add one. |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +#### I2C-OneWire Bridge |
| 29 | + |
| 30 | +Since I had a lot of positive experience using the OneWire bridge devices in the past, having more range than a GPIO-based solution, to be able to drive the bus with strong power, sharpening the rising edge with strong pull-up and release the firmware from many burdens (e.g. the search algorithm), I decided to add such a bridge to the board as an option. Unfortunately, ESPhome has not yet a componentto support it. Maybe I'll develop one sooner or later. Feel free to take the challenge :-) |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +### External I2C |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +The PCA9306 can be enabled by IO12 of the ESP32. The output voltage levels can be adjusted to your needs. By default, it is also tied to 3.3V, but moving the 0 Ohm resitance from R59 to R58, it can be set to 5V. In turn, the Pull-Ups R61 and R62 need to be unsoldered and replaced by Pull-Ups to 5V externally (this is a HW bug, I will fix in upcoming releases by tying them to the selectable supply of the PCA9306) |
| 39 | + |
| 40 | +## OneWire |
| 41 | + |
| 42 | +One wire is a very versatile bus, invented by Dallas, aquired by Maxim-IC and now is owned by Analog Devices. Nevertheless, still today new chips are released, extending the functionality of the OneWire bus more and more. The most widely known devices are the temperature sensors, namely the DS18B20. Up to 85°C, they do not even require a power supply and run completely from bus power. You can almost connect as many OneWire devices to the bus, as you want. There also exist switches, that can split you bus into segments and extend the range even further. |
| 43 | + |
| 44 | +To address this wide spread sensors appropriately, I added an extension header to easily connect such devices and I also added a OneWire bus master (also known as I2C-OneWire-Bridge) to make even more use of it. Here are the OneWire relevant Pins: |
| 45 | + |
| 46 | +| ESP32 Pin | Signal | Description | |
| 47 | +|-----------|------------|-----------------------------------------------------------| |
| 48 | +| IO32 | OW_TMP |This is the direct path of the GPIO to OW, when you do not use the I2C-Bridge, if you use a bridge, it controls the bridges sleep mode | |
| 49 | +| IO16 | SCL |the SCL of the I2C to connect the bridge, unused for direct GPIO-OW | |
| 50 | +| IO13 | SDA |the SDA of the I2C to connect the bridge, unused for direct GPIO-OW | |
| 51 | + |
| 52 | +The relevant parts of the OneWire feature are as follows: |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +If you want to use OneWire directly on ESP32 GPIO, you first need to fit in a 0 Ohm R66. With this, you can easily drive OneWire from IO. Additionally you need to populate R49 with an appropriate resistor to serve your needs. Depending on the bus load, the length and the devices in general, you should always try out different values. In my case (with relatively short lines), 1K often serverd well. But I usually tend to supply the devices with a seperate power rail (3.3 or 5V), since the temperature sensors do not work with parasite power above 85°C, which can be quite common in heating applications (oil, gas burners, wood stoves, solar). |
| 58 | + |
| 59 | +To decide for a good value, you should consult the 1-wire applications notes for that: |
| 60 | + |
| 61 | + * [Guidelines for Reliable Long Line 1-Wire Networks](https://www.analog.com/en/technical-articles/guidelines-for-reliable-long-line-1wire-networks.html) |
| 62 | + * [1-Wire Extended Network Standard](https://www.analog.com/en/design-notes/1wirereg-extended-network-standard.html) |
| 63 | + |
| 64 | +## Extension Pin Header |
| 65 | + |
| 66 | +Due to many requests (e.g. to attach a small display), I added an extension pin header to the board, that carries I2C and SPI and two helper signals. This header can be quipped with a simple flat ribbon cable or a custom PCB. Feel free to create extensions and post me your creations (preferred by Pull-Requests to this repo, added here with a link to the project :-). |
| 67 | + |
| 68 | +## Extension Wire Connector |
| 69 | + |
| 70 | +To make it easily possible to add other sensors (as the mentioned OneWire) attachable, I added a push wire connector to the board. The Type is a WAGO 2086-1208 that can be ordered e.g. from [Reichelt](https://www.reichelt.de/thr-leiterplattenklemme-druecker-1-5-mm-8-polig-wago-2086-1208-p327148.html) or any other good sorted electronics shop. |
| 71 | + |
| 72 | +The connector provides +5V, +3.3V and GND. Additionally, the internal circuitry for Pin 2 (ADC1 CH7), 4 (ADC1 CH6) & 6 (ADC1 CH5) is populated by default, to have 1K Pull-Up to +3.3V and a 100 nF to GND. So if you attach a 10K NTC between Pin 1 & 2, you have a simple resistor divider to be measured by ADC1 Channel 7. From that measurement, the Resistance can be easily calculated and from that and the temperature relation of the NTC, the temperature in turn. For more details, see the [section on NTC temperature measurement of ESPhome](https://esphome.io/components/sensor/ntc.html). In ESPhome, you could simply chain the platforms ADC, Resistance and NTC to get a temperature sensor from that. |
| 73 | + |
| 74 | +This connector can also be used to supply power to the board for 5V and 3.3V. |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +| Header | ESP32 Pin | Signal | Description | |
| 79 | +|--------|-------------|-----------|-----------------------------------------------------------| |
| 80 | +| 1 | (ADC1 CH0) | +5V | +5V Supply from USB or Buderus, depending on Power Select | |
| 81 | +| 2 | (VDD) | +3V3 | +3.3V Supply | |
| 82 | +| 3 | IO15 | nCS | SPI Chip Select, active low | |
| 83 | +| 4 | IO16 | SCL (ext) | SCL of the I2C, gated by I2C_EXT_EN (IO12) | |
| 84 | +| 5 | IO19 | MISO | SPI MISO signal | |
| 85 | +| 6 | IO13 | SDA (ext) | SDA of the I2C, gated by I2C_EXT_EN (IO12) | |
| 86 | +| 7 | IO23 | MOSI | SPI MOSI signal | |
| 87 | +| 8 | IO14 | nINT | I2C interrupt signal (attention !!! +3V3 !!!) | |
| 88 | +| 9 | IO18 | SCLK | SPI clock signal | |
| 89 | +| 10 | (GND) | GND | Ground signal of the whole module | |
| 90 | + |
| 91 | +## Power Supply Options |
| 92 | + |
| 93 | +Since some of the Buderus Heating Control units seem to have a weak power supply, some of the users of my extension suffer from, I added a USB power connector [Würth 65100516121](https://www.we-online.com/en/components/products/COM_SMT_MINI_TYPE_B_HORIZONTAL#65100516121) or [Reichelt USB BWM SMD](https://www.reichelt.de/usb-einbaubuchse-b-mini-gew-smd-montage-usb-bwm-smd-p52003.html) and the possibility to cut the supply from the 5V from Buderus. I'm not sure, if this is a problem of certain controllers equipped with a ton of original extensions or just scattering of good and bad supplies, but as soon as you attach other power hungry extensions to my board (like LC displays, many sensors,...), you should make use of this external power option. |
| 94 | + |
| 95 | +For this purpose, I added a power select pin header (J3) with jumpers for the two 5V options (top = USB, bottom = Buderus) and if you want to supply 3.3V, you can cut-off the 3.3.V-LDO from the circuit with the middle Jumper. |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | +By default, when not shipped with the connector assembled, there are two 0 Ohm resistors (R67 and R68) populated, that take over the burden of the two jumpers. If you populate the pin header yourself, do not forget to remove these two resistors. |
| 101 | + |
| 102 | +## DEBUG Connector |
| 103 | + |
| 104 | +The debug connector is a very easy part. It simply breaks out the signals to program the ESP32 over serial interface. The module does not contain the IO0/EN/Reset circuitry, as it is standard to the ESP32dev boards. In turn, you have three options: |
| 105 | + |
| 106 | + * use another ESP32dev board to do the programming (a bit tricky to disconnect the wires to the original ESP) |
| 107 | + * use a ESP32 PROG board as sold for a few EUR almost anywhere (e.g. [Reichelt ESP-PROG](https://www.reichelt.de/programmieradapter-fuer-esp8266-esp32-esp-prog-p314517.html), you can get it also for around 10 EUR e.g. on [aliexpress](https://de.aliexpress.com/item/33048891555.html)) |
| 108 | + * do the signalling manually with BOOT and RESET buttons of my board: When esptool is trying to connect, press BOOT and RESET together, releasing RESET at first |
| 109 | + |
| 110 | +**Have some fun with your oil burner, until it gets retired by a heat pump** :-) |
0 commit comments