ohahaha

IoT gateway

 
Overview

This solution connects sensors (electric energy meters, water meters, pressure gauges, etc.) through RS485 or RS232 interfaces, and the collected real-time data is uploaded to the cloud IoT platform through Ethernet or WIFI. The hardware uses ESP32 + LAN8720 to realize Ethernet + WIFI access to the Internet. The main advantages are high performance and low cost. ESP32 is a highly integrated Wi-Fi + Bluetooth chip with a built-in dual-core processor with a computing power of up to 600 MIPS. WIFI supports 802.11 b/g/n speeds up to 150 Mbps. It integrates a 100 Mbps Ethernet MAC and has an operating temperature range of –40°C. to +125°C, fully suitable for use in industrial environments. LAN8720 is an Ethernet PHY chip, mainly used for physical layer access to Ethernet. A USB to serial port chip (CH340C) is also added to the board, which is used to download programs to the ESP32 for operation. It has an automatic download circuit and does not require manual intervention. Provides a TF card holder, which can greatly expand storage space. The board also has a JTAG interface for program debugging, which is very efficient and convenient for development, debugging and bug finding. In addition, RS485 and RS232 interfaces are provided for connecting sensors.

This project is divided into several steps: hardware design, prototype production and program writing. The following is a step-by-step introduction.

1. Hardware design

The first version is mainly in the research and development stage, so the relevant interfaces for program downloading and debugging are retained on the board. It can be discarded during actual mass production to reduce BOM cost.

2. Sample production

I would like to thank Lichuang for providing this activity to the majority of makers and issuing component and PCB coupons to us, which greatly reduced our sampling costs. I sincerely hope that more electronics enthusiasts and makers will join this ecosystem and bring more ideas and vitality.

First of all, I praise Lichuang's delivery speed. It took only two days from order placement to receipt.

Blank boards and components are available

IMG_20191030_213125.jpg

IMG_20191030_212437.jpgIMG_20191031_202223.jpg

Now get on the soldering station and get ready to start drying

IMG_20191031_205021.jpg

First we soldered the LAN8720 Ethernet phy which is the most difficult to solder. The only thing that requires the cooperation of a hot air gun is the GND pad at the bottom of the chip. The hot air gun must blow the solder and then stick it on.

IMG_20191031_224523.jpg

Soldering other components is very simple and can be done with a soldering iron.

IMG_20191101_002255.jpg

IMG_20191101_023353.jpg

There is still a lot of rosin left, so clean it with washing water.

IMG_20191101_124314.jpg

Here is a close-up of the Ethernet chip

IMG_20191101_124417_.jpg After soldering, use a meter to check whether there is a short circuit in each part, especially the power supply part.

2. Program writing and debugging

1. Write a test program to verify whether all parts of the board are working normally, including Ethernet, WIFI, 485 interface and 232 interface, and verify whether the automatic download circuit part (CH340C) and JTAG are normal.

Here are some pictures of running the test program

IMG_20191101_205631.jpg

USB download and JTAG debugging test

IMG_20191102_214549.jpg

485 and 232 communication test

IMG_20191102_160618.jpg

At present, the gateway has implemented transparent transmission between 485/232 and mqtt. Online applications can issue instructions to the gateway through mqtt and finally transparently transmit them to the terminal device. At the same time, the terminal device can also transmit data back to the online application.

The following is a demonstration video

https://v.youku.com/v_show/id_XNDQyMzY3NTUxMg==.html?x&sharefrom=android&sharekey=926d604aacfc8e5df08f22b184ad6e8c9

or

https://www.bilibili.com/video/av74474047

Note: For the full version of the video, please click the link above

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-21 08:07:04

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号