
Wired smart home solutions
PROWired smart home solutions
License
:CC BY-NC-SA 3.0
Description
1. Project Description
Common wired communication protocols in smart homes include RS485, RS232, CAN, Ethernet, PLC, KNX, etc. Ethernet is a commonly used wired communication protocol and is suitable for data transmission and Internet connections in smart homes. Through Ethernet, smart home devices can be connected to routers or gateways for remote control and Internet access.
This project mainly demonstrates the application scenarios of Ethernet in POE power supply, device networking, and control in smart home systems.
2. Open Source Agreement
This project adopts the CC-BY-NC-SA 3.0 protocol , please follow the protocol specifications!
Protocol name |
CC-BY-NC-SA 3.0 |
Creative Commons License-Attribution-NonCommercial-ShareAlike |
Introduction |
The above agreements are all Creative Commons licenses. The letters in each part mean: CC : Abbreviation for Creative Commons license (English: Creative Commons license) BY : Attribution. You must give appropriate attribution, provide a link to this license, and indicate whether changes were made. SA: Share Alike, if you remix, transform, or create based on this work, you must share and publish your contribution under the same license as the original license. NC : Non-Commercial, you may not use this work for commercial purposes. ND : Derivatives are prohibited. If you remix, transform, or create based on the work, you may not share or publish the modified work. |
3. Project Progress and Module Functions
serial number |
name | schedule | Function | Remark |
1 | W5500+TPS2378 POE module | All verifications completed | Ethernet, POE power supply | Eliminate *¹ |
2 | DC-DC single power supply module | All verifications completed | 7V to 60V input, 5V 5A output | |
3 | Gigabit network cable docking module | All verifications completed | Network cable extension, ordinary network port to POE network port | |
4 | TPS23861 PSE control module | All verifications completed | POE power supply control | |
5 | DC-DC dual power supply module | All verifications completed | 60V input, 5V+12V output | |
6 | ESP32 control module | All verifications completed | Ethernet, POE power supply, device control | Replace ① module |
7 | MCP23017 IO control module | All verifications completed | 8 inputs + 8 outputs control | |
8 |
Note: *¹ W5500 is replaced with LAN8720, and subsequent modules will be upgraded to adopt UM90 rail housing design.
4. Physical Display
Module ①: W5500+TPS2378 POE module
Module ②: DC-DC single-channel power module
Module ③: Gigabit network cable docking module
Module ④: TPS23861 PSE control module
Module ⑤: DC-DC dual-channel power module
Module ⑥: ESP32 control module
Module ⑦: MCP23017 IO control module
Combination 1
Combination 2
whole picture
5. Physical Function Demonstration
W5500-POE module LED power supply test: https://www.bilibili.com/video/BV1PL411r7Pa/
W5500-POE module fan power supply test: https://www.bilibili.com/video/BV1rb411Z76Y/
W5500-POE module get IP address: https://www.bilibili.com/video/BV1uT411D7ks/
ESP32+MCP23017 IO expansion test: https://www.bilibili.com/video/BV1Rb4y1g71c/
System introduction and testing: https://www.bilibili.com/video/BV1nc411r7LJ/
6. Working Principle of Sub-module
(1) PSE power supply module
①POE power supply detection circuit
TPS23861 determines whether to power the device by detecting the current condition of the power supply port. Among them, the three pins GATE, DRAIN, and SEN are used to control the on-off status of the circuit. The SEN pin is used to detect the current status. GATE is used to control the on-off characteristics of the external high-power MOS tube. DRAIN is used to provide the basic drain. Voltage. When the PD device is not connected, GATE realizes the on-off power supply of external devices by turning on and off MOS tubes. When the load does not meet the requirements, the basic current detected by SEN is very small, and GATE will not be in the normally open state at this time. , and when there is a load, the current flowing back into SEN will be very large. At this time, the chip detects the current that meets the requirements and keeps the GATE gate in a long-open state, thus realizing the detection circuit for power supply of POE equipment.
②PoE power supply negotiation process
After the PSE device is powered on and the PD device is connected to the PSE device through the network, the PSE and PD begin power supply negotiation:
Detecting PD: PSE periodically outputs a small voltage with limited current at the port to detect the presence of PD equipment. If a resistor with a specific resistance value is detected, it means that the cable terminal is connected to a powered end device that supports the IEEE 802.3af standard or the IEEE 802.3at standard (a specific resistor with a resistance value between 19kΩ and 26.5kΩ, and the usual small voltage is 2.7V~ 10.1V, detection period is 2 seconds).
Power supply capability negotiation (PD device classification process): PSE classifies PDs and negotiates power supply power. The power supply capability negotiation can not only be realized by analyzing the resistance sent by the PSE and PD, but also through the link layer discovery protocol LLDP (Link Layer Discovery Protocol) protocol to discover and notify the power supply capability for negotiation.
Start power supply: During the startup period (generally less than 15μs), the PSE device starts to supply power to the PD device from low voltage until it provides 48V DC voltage.
Normal power supply: After the voltage reaches 48V, the PSE provides a stable and reliable 48V DC power to the PD device, and the power consumption of the PD device does not exceed the maximum output power of the PSE.
Power outage: During the power supply process, the PSE will continuously monitor the PD current input. When the PD current consumption drops below the minimum value, or the current surges, such as unplugging the device or encountering a PD device power consumption overload, short circuit, or exceeding the power supply load of the PSE, etc. , the PSE will disconnect power and repeat the detection process.
(2) PD powered module
The TPS2378 implements all functions required for an IEEE802.3at Class 2 powered device (PD). The controller has an internal switch resistance as low as 0.5Ω, is packaged in a thermally enhanced PowerPAD package, and is capable of operating at currents up to 0.85A for extended periods of time. The TPS2378 features an auxiliary power detect (APD) input to prioritize external power adapter connections. Also features a 100V pass transistor, 140mA inrush current limit, Class 2 indication, auto-retry fault protection, and open-drain power good output.
①Part of the pin description (the devices marked in red correspond to the schematic devices below)
Pin2:DEN
The DEN ( Detection and Enable ) pin implements two independent functions. Connecting a resistor ( RDEN ) between the DEN pin and VDD generates a detection signature when the voltage difference between VDD and VSS is between approximately 1.4 and 10.9V . Beyond this range, the controller will disconnect this resistor to save power consumption. The IEEE 802.3at standard specifies the detection signature resistance RDEN in the range of 23.75 kΩ to 26.25 kΩ, or 25 kΩ± 5% . TI recommends using a 24.9 kΩ ± 1% resistor for RDEN . If the resistor connected between VDD and DEN is divided into two roughly equal parts, the application circuit can disable the PD ( Powered Device ) by grounding the junction between the two resistors. This operation simultaneously destroys the detection signature, thereby signaling to the power sourcing equipment ( PSE ) that the PD no longer requires power.
Pin3: CLS
An external resistor ( RCLS ) connected between the CLS pin and VSS provides a classification signature to the PSE . When the voltage difference between VDD and VSS is between approximately 10.9V and 22V , the controller applies approximately 2.5V across the external resistor . The current drawn by this resistor, plus the controller's internal current and any leakage current through the internal channel MOSFET , combine to form the classification current. The following table lists the external resistor values required for each PD power range defined by IEEE802.3at . The maximum average power received by the PD , plus the power supplied to the downstream load, should not exceed the maximum power indicated in the table. Holding APD high disables classification signatures. A high-power PSE may perform two classification cycles with Class 4 present in the first cycle .
Pin5: RTN
The RTN pin of the internal channel MOSFET provides a path for the negative supply return. Once VDD exceeds the undervoltage lockout threshold, the internal channel MOSFET pulls RTN to VSS . Inrush limiting prevents RTN current from exceeding approximately 140 mA until the bulk capacitor ( CBULK ) is fully charged. The inrush ends when the RTN current drops below approximately 125 mA . Subsequently, the RTN current is limited to approximately 1 A. CDB is pulled low to signal to the downstream load that the bulk capacitor has been charged. If RTN exceeds approximately 12 V for more than 800 μs , the TPS2378 returns to the inrush-limited state.
Pin6: CDB
CDB is a low output that is pulled to RTN when the device is in inrush current limit . At other times, it remains in a high impedance state. This pin is an open-drain output and may require a pull-up resistor or other interface to the downstream load. If you do not use CDB , you do not need to connect. The CDB pin can disable the startup of downstream converters by holding the soft-start pin low. When CDB is connected to the SS pin of the downstream DC-DC controller , since CDB is an open-drain output, when it is disconnected, it will not affect the charging time of the soft-start capacitor. Another common use for the CDB pin is to enable a converter with an active high enable input. In this case, CDB may require a pull-up resistor to VDD or the bias supply , depending on the controller enable pin requirements .
Pin7: T2P
The TPS2378 pulls T2P to RTN when a Type-2 hardware classification is observed or the APD pin is pulled high . The T2P output will return to a high-impedance state if the chip enters thermal shutdown, the channel MOSFET enters an inrush-limited state, or a Type-2 PSE is not detected and the voltage on the APD falls below its threshold . The circuitry used to observe Type-2 hardware classification will latch its results when the voltage difference between VDD and VSS exceeds the upper classification threshold . This circuit will reset when the voltage difference between VDD and VSS drops below the flag threshold. If the T2P pin is not used, it can be left unconnected. The T2P pin is an active low, open-drain output indicating that a high power source is available. An optocoupler can be used to interface the T2P pin with the secondary side circuitry of the converter. It is recommended to use a high gain optocoupler and a high impedance (e.g. CMOS ) receiver.
Pin8: APD
APD ( Auxiliary Power Detect ) is a pin used to detect auxiliary power. In some applications, the device can draw power from an Ethernet cable or an auxiliary power supply. When the voltage on the APD pin exceeds approximately 1.5V relative to the RTN pin , the internal pass MOSFET will turn off, the CLS output will be disabled, and the T2P output will be enabled, allowing the adapter to prioritize auxiliary power over PoE ( Power over Ethernet) ). The resistor divider ( RAPD1 , RAPD2 ) provides system-level ESD protection to the APD pins, drains the leakage current from the blocking diode ( DA ), and provides input voltage monitoring to ensure that no switching to the auxiliary voltage source occurs during an excessively low voltage . If the APD pin is not used, it can be left unconnected.
(3) DC-DC module
TThe TPS54560 is a 4.5V to 60V input, 5A step-down DC/DC converter with Eco-Mode™. The figure below shows a typical application schematic diagram of 7~60V input and 5V 5A output.
For voltage outputs such as 3.3V, 12V, and 24V, you can use the TPS54360 calculation tool in the attachment to calculate the capacitor and resistance values. The 12V output calculation reference is as follows:
(4) ESP32-Ethernet module
①ESP32-WROOM-32E/UE module
The ESP32-WROOM-32E/UE module uses ESP32-D0WD-V3, which is scalable and adaptive. Both CPU cores can be controlled independently. The CPU clock frequency can be adjusted from 80 MHz to 240MHz. Users can turn off the power of the CPU and use the low-power coprocessor to monitor status changes of peripherals or whether certain analog quantities exceed thresholds. ESP32 also integrates a wealth of peripherals, including capacitive touch sensors, Hall sensors, SD card interfaces, Ethernet interfaces, high-speed SPI, UART, I2S and I2C, etc. The Ethernet interface integrates a 10/100 Mbps Ethernet MAC controller, which can be directly connected to the Ethernet network and supports a transmission rate of up to 150 Mbps, enabling a fast and stable wired network connection.
ESP32-WROOM-32E/UE EMAC is defined as follows:
IO17——EMAC_CLK: Ethernet clock signal.
IO25—— EMAC_RXD0: Ethernet receives data 0.
IO26——EMAC_RXD1: Ethernet receive data 1.
IO27—— EMAC_RX_DV: Ethernet receives valid signal.
IO19——EMAC_TXD0: Ethernet sends data 0.
IO22——EMAC_TXD1: Ethernet sends data 1.
IO21——EMAC_TX_EN: Ethernet sends a valid signal.
IO23——EMAC_MDC: Ethernet management data clock.
IO18——EMAC_MDIO: Ethernet management data input/output.
②LAN8720A
LAN8720A is a small, low-power, all-round 10/100Mbps Ethernet physical layer transceiver designed by SMSC Company (acquired by Microchip). It is designed for consumer electronics and enterprise applications. LAN8720A has only 24Pin in total and only supports RMII interface. The network structure composed of it is shown in the figure below:
The ESP32-WROOM-32E/UE module can provide a clock signal to the LAN8720 through its clock output pin to ensure communication stability and accuracy. LAN8720A is connected to the EMAC of ESP32-WROOM-32E/UE through RMII. A transformer is also needed between the ESP32-WROOM-32E/UE and the LAN8720A. In this project, the HY931147C 100M RJ45 network port Ethernet connector is used, which has a built-in PoE rectification line function, which can effectively reduce the POE peripheral circuit.
LAN8720 PHYADD0 is a bit in its register that sets the PHY address. The value of the PHYADD0 bit can be set to 0 or 1. Different PHY addresses can be configured by setting PHYADD0 to communicate with other devices. This function is usually used when two LAN8720s need to be used.
(5) MCP23017 IO expansion module
MCP23017 is a commonly used I/O expansion chip produced by Microchip. It can communicate with the microcontroller via the I2C bus, providing additional input and output pins. The MCP23017 has 16 configurable GPIO pins that can be used as inputs or outputs. It also has some special features such as interrupt function and external interrupt pin. Using MCP23017 can expand the input and output capabilities of the microcontroller, especially for applications where GPIO pins are insufficient. Through the I2C bus, 8 MCP23017 chips can be connected at the same time, and 128 GPIO pins can be expanded. The IIC address of the MCP23017 can be determined by connecting the A0, A1 and A2 pins of the MCP23017 to ground or VCC. The following table lists these possibilities and their corresponding decimal addresses:
| A2 | A1 | A0 | I2C address |
| 0 | 0 | 0 | 0x20 |
| 0 | 0 | 1 | 0x21 |
| 0 | 1 | 0 | 0x22 |
| 0 | 1 | 1 | 0x23 |
| 1 | 0 | 0 | 0x24 |
| 1 | 0 | 1 | 0x25 |
| 1 | 1 | 0 | 0x26 |
| 1 | 1 | 1 | 0x27 |
7. Project Structure Diagram
8. Partial Procedures
This program is written using ESPHome. It is simple and convenient and suitable for beginners. If you want to learn in depth, I personally do not recommend relying on similar platforms for a long time.
esphome:
name: please enter
friendly_name: please enter
esp32:
board: esp32dev
# Enable logging
logger:
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 1
# Enable Home Assistant API
api:
encryption:
key: "Please enter"
ota:
password: "Please enter"
i2c:
sda: 13
scl: 16
scan: True
frequency: 800kHz
mcp23017:
- id: 'mcp23017_hub1'
address: 0x20
- id: 'mcp23017_hub2'
address: 0x21
binary_sensor:
- platform: gpio
name: "MCP23017 Pin A0"
pin:
mcp23xxx: mcp23017_hub1
number: 0
mode:
input: true
pullup: false
inverted: true
switch:
- platform: gpio
name: "MCP23017 Pin B0"
pin:
mcp23xxx: mcp23017_hub1
number: 8
mode:
output: true
inverted: false
9. Accessory Links
UM90S module rack [Order link] https://m.tb.cn/h.5PdywAD
Electrical installation guide rail [Order link] https://m.tb.cn/h.5Od7FAZ
Ming's 48V rail-type switching power supply is too deep, so I won't recommend it here. It is recommended to buy it directly from LCSC.
10. Diversified Connection Methods
11. Size Definition
In order to facilitate installation and replacement, the length of the PCB is unified to 90mm, and the width is 24, 36, 48, etc. (a multiple of 12, it is easy to get stuck when moving when using a 12mm width)
Designed by 智定义物联网 (from OSHWHub)
Design Drawing


Comment