STM32 Ethernet-RS485 IoT Gateway

Hello, Habr!


This post is about DIY development of an Ethernet-RS485 gateway. The goal of this gateway is to provide centralized management of Mysensors nodes by the smart home controller.


imageRecently, I still got wires, dupons, soldering, etc. and a long drawn-out decision was made - to make our boards from scratch, i.e. all serious. :)
It is said - done!


The first step was to develop and draw a schematic diagram of the gateway, in which I tried to take into account all my Wishlist and wishes. Next, the layout and fitting of the board to the required dimensions (50x50mm) was made. And the last stage is the order of boards in production. I ordered at the factory JLCPCB, 5 boards - $ 2 + shipping.


This gateway is based on the STM32F103CB (8) T6 MK . As an Ethernet chip acts as a well-known chip from WIZnet - W5500 . The transport of this gateway in the Mysensors network is the wired RS485 interface. The chip MAX13488EESA + T was chosen as the RS485 driver , including due to the presence of the automatic selection of the direction of reception / transmission in it.


So let’s take a closer look at the main parts of the gateway.


STM32F103CBT6 48LQFN. Cortex-M3, 128 20 . β€” 72, USB , 128, . 3.3. , 8 32.768. SWD. STM32F103C8T6, .


Ethernet W5500. Cortex M0, SPI ( 80 ). 100Mbps Full Link 132. Wake on LAN, 4 4 (SPD / DUP / ACT / Link). 32 RAM TCP/IP , 8 TCP/UDP ( ). TCP/IP : TCP, UDP, MAC, ICMP, IPv4, ARP, IGMP, PPPoE. -40...85Β°C. β€” 3.3.


RS485 β€” MAX13488EESA+T. SOIC-8 150mil. 16 Mb/s. β€” 5, β€” 4.5 A. 128 RS485. /, .. UART ! .


:


RS485 .



.



Ethernet.



.. Mysensors , . RS485. β€” TEXAS INSTRUMENTS β€” ISO7321CDR. DC/DC Traco Power – TME0505S. RS485 . , ( ) VD1.


, .


.



.



3D β€” .



3D β€” .



. , USART SPI. STM32F103CBT6 3 USART 4.5Mbits/s. SPI . ( ), RS485 USART1 ( PB6, PB7 ). W5500 β€” SPI1 ( PA4-7).


Ethernet W5500 . , , , . lcsc.com . Ethernet β€” HR911105A, .


, 48- lqfp . , . .


, , , ( RGB). , I2C EEPROM / HDC1080. , , , .


RS485 , DB2EV-5.08-3P, 5.08. , . microUSB β€” 1.25 JST, .






5, microUSB, Power. 5 RS485, DC/DC . .. STM32 Ethernet 3.3, LDO β€” LDL1117S33R. 5 3.3 . β€” 0603.


.. ,
. RS485, DC/DC β€” D1, β€” D3. "" .




R31, R32 R2, VD3.


, , 30 , . , RS485 β€” 0.5-1Mbit. 1Mbit, 0.5Mbit. , , , . RS485, R31 R32 . , . , , .. RS485, . , . 120 RS485, .


, . . , - .


β€” ! :)


β€” , Ethernet-RS485 . , , .



.


Mysensor β€” https://t.me/mysensors_rus β€” mysensors.ru.


image PS β€” Mysensors RS485. . , .


P.P.S. , . !


P.P.P.S. , , . :)


PPPPS 02/20/2020 - updated the board (third revision). Added galvanic gaps, Conders at 0.1uF (where they were not). The ability to install a pull-up resistor on the leg RO MAX13488 (its nominal value is selected locally) and combine the GND_isolate ground with RS485_ground.


All Articles