====== Expandable DIN module ====== [[din-module|<- Back to comparison]] \\ \\ {{https://remoteqth.com/img/wiki-din-module-21.jpg?535}} {{https://remoteqth.com/img/wiki-din-module-27.jpg?140}} \\ ===== Main features ===== * **Ethernet** conectivity * **RS-485** or USB-C interface (share same serial and baudrate speed) * **Direct connection of TWO 1-wire thermistor DS18B20** * **11** GPIOs * Mounting on **DIN rail** * **Expandable** * **Arduino** firmware \\ \\ * Block diagram \\ \\ {{https://remoteqth.com/img/din-module-blok.png?600}} \\ \\ \\ {{https://remoteqth.com/img/wiki-din-module-29.jpg?600}} ---- ====== Quick start guide ====== - Connect to the [[din-wifi#power]] or USB-C - Connect a serial console (115200 baud) to USB-C where you ask to IP address assigned from DHCP with **press ? and enter**. \\ {{https://remoteqth.com/img/wiki-din-module-36.png?300}} - Now you can configure the device via the web interface. \\ {{https://remoteqth.com/img/wiki-din-module-18.png?300}} ---- ====== Arduino firmware ====== ===== Precompiled .bin ===== - is available on [[https://github.com/ok1hra/eth-din-dev-kit/releases|GitHub release]] page (**without** label ESPhome). ===== Compile ===== **The code is created for Arduino IDE and is compilable with these fixed settings** - **[[https://academy.arduino.cc/pages/download-software|Arduino IDE version 1.8.19]]** - Libraries according to the [[https://github.com/ok1hra/eth-din-dev-kit/blob/main/eth-din-dev-kit.ino#L55|list]], which are available for download on [[https://github.com/ok1hra/Arduino-libraries-backup|GitHub]], **commit b60a8cb** - just copy it to your **/Arduino/libraries** directory - Specifically commit [[https://github.com/espressif/arduino-esp32|Arduino ESP32 libraries]] cd ~/Arduino/hardware/espressif/esp32 git clone https://github.com/espressif/arduino-esp32.git cd git checkout c2c8d189928386c872aa6cd7ba7a87c8019c5663 - Firmware source available on [[https://github.com/ok1hra/eth-din-dev-kit|GitHub]] ===== Upload ===== - At the top of the web page there is a link "**__Upload FW__**" under which the form for uploading the firmware is available \\ {{https://remoteqth.com/img/wiki-din-module-37.png?350}} - or via USB-C using, for example, the web tool https://web.esphome.io/ ===== Implemented functions ===== The firmware currently makes peripherals accessible to MQTT, but it can be used as a basis for programming your own functionalities, or using your own code. * Connectors (T1 and T2) for **connecting two [[https://www.laskakit.cz/en/dallas-ds18b20-orig--digitalni-vodotesne-cidlo-teploty-1m/|DS18B20 digital thermistors]]** with automatic detection. Reading temperature every 20 seconds and sending to MQTT with topic /T1-Celsius * **Ethernet connection** using RJ45 connector with IP address retrieval from DHCP server. Static IP address setting is not implemented * http web server publishing two pages * **[[https://github.com/bastlirna/mqtt-wall|mqtt-wall]]**, which is a web MQTT client, for displaying messages that the device has sent to the MQTT broker {{https://remoteqth.com/img/wiki-din-module-18.png}} * **SETUP page** for configuring the device contains settings \\ {{https://remoteqth.com/img/wiki-din-module-19.png?400}} * MQTT topic * Device ID * RS485 (USB-C) BAUDRATE * MQTT broker IP * MQTT broker PORT * websocet MQTT PORT * MQTT Login * MQTT Password * Saving device settings to internal eeprom * **OTA update -** allows you to update the device firmware via Ethernet via the web interface. Available at [IP]:82/update, or from the link on the main page of mqtt-wall * **MQTT client** for sending and receiving messages from the broker * **Measuring POE voltage** and sending the value to MQTT when it changes * **Watchdog timer,** triggers a device restart if the firmware stops for longer than 60s * detect USB-C plug and publish to MQTT with topic /USBdetect * **RS485-MQTT proxy -** received RS485 data forward to MQTT with topic /RS485_RX ---- ====== How to connect ====== ===== Power ===== * The modul can be powered in the range of **9-14V DC** with a maximum consumption of **0,5A** * The power supply can be connected in two ways - **pluggable DC jack directly. \\ Attention to polarity!** \\ {{https://remoteqth.com/img/wiki-din-module-22.png?500}} \\ This input is **protected by a 1A fuse.** \\ \\ - **Ethernet passive POE with external POE injector** \\ {{https://remoteqth.com/img/wiki-din-module-23.png?500}} \\ The POE injector is **protected with also 0.5A fuse**. ===== Interfaces pinout ===== | Functionality | Front view | pinout | | **Power** | {{https://remoteqth.com/img/wiki-din-module-SB-15.png}} | 1 - **11-13.8V / 1A max** DC PWR input \\ 2 - GND | | **2x 1-wire thermistor** | {{https://remoteqth.com/img/wiki-din-module-SB-04.png}} | 2x JST 1-wire for DS18B20 thesrnistor \\ **1 -** +3,3V / max 500mA \\ **2 -** 1-wire bus (Gpio15) \\ **3 -** GND| | **RS-485** | {{https://remoteqth.com/img/wiki-din-module-SB-02.png}} | **2 - RS485-A \\ 1 - RS485-B** | | **Four LEDs** | | RED -** fail fuse** \\ GRN -** ETH 100M** \\ GRN -** ETH ACT** \\ GRN -** Power** | | **USB-C** | {{https://remoteqth.com/img/wiki-din-module-SB-06.png}} | **USB-C serial** \\ +5V VBUS \\ **SBU1 -** 3V3 Gpio33 (I2C SDA) \\ **SBU2 -** 3V3 Gpio32 (I2C SCL) | | **Ethernet** | {{https://remoteqth.com/img/wiki-din-module-SB-05.png}} | **1,2,3,6 -** Ethernet \\ **4+5 -** POE DC power input 12-24V/max 1A, any polarity \\ **7+8 -** POE DC power input 12-24V/max 1A, any polarity \\ Green LED - 100M \\ Yelow LED - ACT | | **11 GPIO \\ expandable slot** | {{https://remoteqth.com/img/wiki-din-module-SB-17.png}} | \\ **GPIO** \\ \\ 1 - **+12V** from DC jack or POE \\ 2 - **+12V** from DC jack or POE \\ 3 - **GND**\\ 4 - **GND**\\ 5 - **GPIO5**\\ 6 - **+3,3V** from internal step down\\ 7 - **GPIO33**\\ 8 - **GPIO15**\\ 9 - **GPIO12**\\ 10 - **GPIO14**\\ 11 - **GPIO02**\\ 12 - **GPIO13**\\ 13 - **GPIO04**\\ 14 - **GPIO0**\\ 15 - **GPIO39**\\ 16 - **GPIO16**\\ 17 - **GPIO32**\\ 18 - **GPIO36**\\ 19 - **GND**\\ 20 - **GND** | ====== Source ====== ===== Firmware ===== * [[https://github.com/ok1hra/eth-din-dev-kit|GitHub]] **Arduino** sample code \\ * [[https://github.com/ok1hra/eth-din-dev-kit/releases|Releases on GitHub]] sign **without ESPhome** label\\ ===== Hardware ===== * [[https://remoteqth.com/download-count.php?Down=hw/Expandable-DIN-module-03.pdf|.PDF]] schematics rev 0.3 ---- ====== BOM ====== | 1x | {{https://remoteqth.com/img/wiki-din-module-SB-16.png?100}} \\ **DC Power connector 5,5/2,1mm** | [[https://www.tme.eu/cz/details/pc-2.1_5.5-14/konektory-dc/changzhou-dahua-imp-and-exp-group-co/vg18013a/]] | | 2x | {{https://remoteqth.com/img/wiki-din-module-SB-10.png?100}} \\ **DS18B20 with JST conector** | [[https://www.laskakit.cz/en/dallas-ds18b20-digitalni-vodotesne-cidlo-teploty-3m/]] | | 1x | {{https://remoteqth.com/img/wiki-din-module-SB-09.png?100}} **RS485 connector** | [[https://www.tme.eu/cz/details/tj0231530000g/rozpojitelne-svorkovnice/amphenol-anytek/]] | | 2x | {{https://remoteqth.com/img/wiki-din-module-SB-12.png?100}} **M3x10mm** | [[https://www.tme.eu/cz/details/b3x10_bn2844/srouby/bossard/1489380/]] | | 1x | {{https://remoteqth.com/img/wiki-din-module-SB-13.png?100}} **1A fuse** | [[https://www.tme.eu/cz/details/0218001.txp/pojistky-5x20mm-zpozdene/littelfuse/]] | | 30g | {{https://remoteqth.com/img/wiki-din-module-SB-14.png?100}} **fillament PETG-V0** \\ [[https://iq.ul.com/ul/cert.aspx?ULID=104636411|UL94-V0 UL certificate IEC 60695-11-10]] | [[https://www.prusa3d.com/cs/produkt/prusament-petg-v0-natural-1kg/]] | | 1x | 3D print model | [[https://www.printables.com/model/1386414-arduino-esp32-ethernet-din-module]] |