▼Click the card below to follow our official account for more exciting content▼
Welcome to follow the official account “Mastering Microcontrollers and Embedded Systems”, reply with keywords to get more free videos and materials
Reply with 【Add Group】, 【Microcontroller】, 【STM32】, 【Hardware Knowledge】, 【Hardware Design】, 【Classic Circuits】, 【Thesis】, 【Graduation Project】, 【3D Packaging Library】, 【PCB】, 【Capacitor】, 【TVS】, 【Impedance Matching】, 【Data】, 【Termination Resistor】, 【Keil】, 【485】, 【CAN】, 【Oscillator】, 【USBCAN】, 【PCB】, 【Smart Bracelet】, 【Smart Home】, 【Smart Car】, 【555】, 【I2C】, 【Huawei】, 【ZTE】, and more…
This article introduces some common embedded and IoT communication protocols, which have different performances, communication rates, coverage, power consumption, and memory, and each protocol has its own advantages and disadvantages.
Some of these communication protocols are suitable for small household appliances, while others can be used for large smart city projects. IoT communication protocols are divided into two main categories:
-
One type is access protocols: generally responsible for networking and communication between devices within a subnet
-
The other type is communication protocols: mainly device communication protocols that run on traditional Internet TCP/IP protocols, responsible for data exchange and communication between devices over the Internet.
Physical Layer and Data Link Layer Protocols
1. Long-Distance Cellular Communication
(1) 2G/3G/4G Communication Protocols, referring to the protocols for the second, third, and fourth generation mobile communication systems.
Narrowband Internet of Things (NB-IoT) has become an important branch of the Internet of Everything network. NB-IoT is built on cellular networks and consumes approximately 180kHz of bandwidth, can be directly deployed on GSM, UMTS, or LTE networks to reduce deployment costs and achieve smooth upgrades. NB-IoT focuses on the low-power wide-area (LPWA) IoT market and is an emerging technology that can be widely applied globally. It features wide coverage, multiple connections, fast rates, low costs, low power consumption, and excellent architecture.
Application scenarios: NB-IoT network applications include smart parking, smart firefighting, smart water management, smart street lighting, shared bicycles, and smart home appliances.
The fifth generation mobile communication technology is the latest generation of cellular mobile communication technology. The performance goals of 5G are high data rates, reduced latency, energy savings, cost reduction, increased system capacity, and massive device connections.
Application scenarios: AR/VR, Internet of Vehicles, smart manufacturing, smart energy, wireless medical, wireless home entertainment, connected drones, ultra-high-definition/panoramic live streaming, personal AI assistance, smart cities.
2. Long-Distance Non-Cellular Communication
Due to the rapid popularization of household WiFi routers and smartphones in recent years, the WiFi protocol has also been widely used in the smart home field. The biggest advantage of the WiFi protocol is its direct access to the Internet. Compared to ZigBee, smart home solutions using the WiFi protocol eliminate the need for an additional gateway, and compared to Bluetooth, eliminate the reliance on mobile terminals such as smartphones.
Commercial WiFi coverage in public transportation, shopping malls, and other public places undoubtedly reveals the application potential of commercial WiFi.
ZigBee is a low-speed short-distance wireless communication protocol, characterized by low speed, low power consumption, low cost, support for a large number of online nodes, various online topologies, low complexity, speed, reliability, and security. ZigBee technology is a new technology that has recently emerged, mainly relying on wireless networks for transmission, enabling short-range wireless connections, belonging to wireless network communication technology.
The inherent advantages of ZigBee technology have gradually made it a mainstream technology in the IoT industry, with large-scale applications in industrial, agricultural, and smart home fields.
LoRa™ (Long Range) is a modulation technology that provides longer communication distances compared to similar technologies. LoRa gateways, smoke detectors, water monitoring, infrared detection, positioning, and power strips are widely used IoT products. As a narrowband wireless technology, LoRa uses time-of-arrival differences to achieve geographical positioning. LoRa positioning application scenarios include smart cities and traffic monitoring, metering and logistics, and agricultural positioning monitoring.
3. Short-Distance Communication
Radio Frequency Identification (RFID) is the abbreviation for Radio Frequency Identification. Its principle is non-contact data communication between the reader and the tag, achieving the purpose of identifying the target. RFID has very wide applications, with typical applications including animal chips, automotive chip anti-theft devices, access control, parking control, production line automation, and material management. A complete RFID system consists of three parts: a reader, an electronic tag, and a data management system.
NFC stands for Near Field Communication technology. NFC is developed based on non-contact radio frequency identification (RFID) technology, combined with wireless interconnection technology, providing a very secure and convenient communication method for various electronic products increasingly popular in our daily lives. The “near field” in the Chinese name of NFC refers to the radio waves in the nearby electromagnetic field.
Application scenarios: Used in access control, attendance, visitor management, conference sign-in, patrolling, and other fields. NFC has functions such as human-machine interaction and machine-to-machine interaction.
Bluetooth technology is a global standard for wireless data and voice communication, based on low-cost short-range wireless connections, establishing a communication environment for fixed and mobile devices.
Bluetooth enables wireless information exchange between numerous devices, including mobile phones, PDAs, wireless headsets, laptops, and related peripherals. By utilizing Bluetooth technology, communication between mobile communication terminal devices can be effectively simplified, and communication between devices and the Internet can also be successfully simplified, making data transmission faster and more efficient, thus broadening the path for wireless communication.
USB, short for Universal Serial Bus, is an external bus standard used to specify connections and communications between computers and external devices. It is an interface technology applied in the PC field.
(2) Serial Communication Protocol
The serial communication protocol specifies the content of data packets, which includes the start bit, main data, check bit, and stop bit. Both parties need to agree on a consistent data packet format to transmit data normally. In serial communication, commonly used protocols include RS-232, RS-422, and RS-485.
Serial communication refers to a communication method where data is transmitted bit by bit between peripherals and computers through data lines. This method uses fewer data lines and can save communication costs in long-distance communication, but its transmission speed is lower than parallel transmission. Most computers (excluding laptops) contain two RS-232 serial ports. Serial communication is also a commonly used communication protocol for instruments and equipment.
Ethernet is a computer local area network technology. The IEEE organization established the technical standards for Ethernet in the IEEE 802.3 standard, which specifies the content of the physical layer wiring, electronic signals, and medium access layer protocols.
The MBus remote meter reading system (symphonic mbus) is a two-wire bus standard in Europe, mainly used for measuring instruments such as heat meters and water meters.
Network Layer and Transport Protocols
Internet Protocol version 4 is the fourth revision in the development process of the Internet protocol and is the first widely deployed version of this protocol. IPv4 is the core of the Internet and the most widely used version of the Internet protocol.
Internet Protocol version 6 is used to address the major issue of IPv4, which is the limited availability of network address resources, severely restricting the application and development of the Internet. The use of IPv6 not only solves the problem of the number of network address resources but also addresses the barriers to connecting various access devices to the Internet.
Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. TCP is designed to adapt to the hierarchical protocol architecture that supports multiple network applications. It provides reliable communication services between paired processes in main computers connected to different but interconnected computer communication networks. TCP assumes it can obtain simple, possibly unreliable datagram services from lower-level protocols.
6LoWPAN is a low-power wireless personal area network standard based on IPv6, i.e., IPv6 over IEEE 802.15.4.
Application Layer Protocols
MQTT (Message Queue Telemetry Transport) is a lightweight messaging protocol that provides two messaging modes: publish/subscribe, making it simpler and easier to use, especially suitable for message distribution in constrained environments (low bandwidth, high network latency, unstable network communication), and is a standard transmission protocol for the Internet of Things (IoT).
In many cases, including in constrained environments, such as machine-to-machine (M2M) communication and the Internet of Things (IoT). It has been widely used in satellite link communication sensors, occasionally dialed medical devices, smart homes, and some miniaturized devices.
CoAP (Constrained Application Protocol) is a web-like protocol in the IoT world, suitable for small low-power sensors, switches, valves, and similar components that need to be remotely controlled or monitored via standard Internet networks. Servers can choose not to respond to unsupported types.
RESTful is a resource-based software architectural style. A resource is an entity on the network or specific information on the network. An image or a song is a resource. RESTful API is an implementation based on the HTTP protocol (HTTP is an application layer protocol characterized by simplicity and speed).
Applications or designs that meet REST specifications are called RESTful, and APIs designed according to REST specifications are called RESTful APIs.
DDS (Data Distribution Service) is a middleware protocol for distributed real-time data distribution service, which is the “TCP/IP” in distributed real-time networks, used to solve interconnection of network protocols in real-time networks, serving as a “bus on the bus”.
AMQP, or Advanced Message Queuing Protocol, is an open standard for application layer messaging services, designed for message-oriented middleware. Clients based on this protocol can exchange messages with message middleware without being restricted by different products, different development languages, etc. Implementations in Erlang include RabbitMQ and others.
XMPP is a protocol based on a subset of XML, a standard generalized markup language, inheriting the flexible development in XML environments. Therefore, applications based on XMPP have strong scalability. After extension, XMPP can handle user needs by sending extended information and establish applications such as content publishing systems and address-based services on top of XMPP.
Comparison of Communication Protocols
1. Comparison of NB-IoT Protocol and LoRa Protocol
First, frequency band. LoRa operates in the unlicensed frequency band below 1GHz, and does not require additional payment for use, while NB-IoT and cellular communication use the authorized frequency band below 1GHz, which requires payment.
Second, battery life. LoRa modules have unique characteristics in handling interference, network overlap, scalability, etc., but cannot provide service quality like cellular protocols. NB-IoT, considering service quality, cannot provide battery life similar to LoRa.
Third, device cost. For terminal nodes, LoRa protocol is simpler than NB-IoT, easier to develop, and has better applicability and compatibility for microprocessors. Meanwhile, low-cost and relatively mature LoRa modules can already be found on the market, with upgraded versions also being released.
Fourth, network coverage and deployment timeline. The NB-IoT standard was announced in 2016, and besides network deployment, the corresponding commercialization and establishment of the industrial chain will require more time and effort to explore. The entire industrial chain of LoRa is relatively mature, and products are in a state of “ready to launch”, with many countries around the world conducting or completing national network deployments.
2. Comparison of Bluetooth, WiFi, and ZigBee Protocols
Currently, WiFi’s advantage is its widespread application, having penetrated thousands of households; ZigBee’s advantage is low power consumption and self-organizing; the advantage of UWB non-carrier wireless communication technology is transmission speed; and Bluetooth’s advantage is simple networking. However, these three technologies also have their own shortcomings, and no single technology can fully meet all the requirements of smart homes.
The emergence of Bluetooth technology has made short-distance wireless communication possible, but its protocol is relatively complex, has high power consumption, and high costs, making it less suitable for industrial control and home networks that require low costs and low power consumption. Especially, the biggest obstacle for Bluetooth is its limited transmission range, generally effective within about 10 meters, and issues such as weak anti-interference capability and information security are also major factors restricting its further development and large-scale application.
WiFi is also a short-distance wireless transmission technology that can access wireless signals at any time, with strong mobility, making it more suitable for use in office and home environments. Of course, WiFi also has a fatal flaw. Since WiFi uses radio frequency technology to send and receive data through the air, it is relatively easy to be interfered with by external factors.
ZigBee, on the other hand, is an internationally recognized wireless communication technology, with each network port able to connect to more than 65,000 ports, suitable for use in various fields such as home, industry, and agriculture, while Bluetooth and WiFi can only connect to 10 ports, which clearly cannot meet household needs. ZigBee also has advantages in low power consumption and low cost.
3. Comparison of MQTT Protocol and CoAP Protocol
MQTT is a many-to-many communication protocol used to transmit messages between different clients through an intermediary broker, decoupling producers and consumers, allowing clients to publish messages and letting the broker decide the routing and copy messages. Although MQTT supports some persistence, it is still best suited as a real-time data communication bus.
CoAP is primarily a point-to-point protocol used for transmitting state information between clients and servers. Although it supports resource observation, CoAP is best suited for state transfer models, not entirely event-based.
MQTT clients establish long TCP connections, which usually indicate no problem, while CoAP clients and servers send and receive UDP packets. In NAT environments, tunneling or port forwarding can be used to allow CoAP, or like LWM2M, devices may need to initialize front-end connections first.
MQTT does not provide support for message typing or other metadata to help clients understand; MQTT messages can be used for any purpose, but all clients must know the upward data format to allow communication. In contrast, CoAP provides built-in support for content negotiation and discovery, allowing devices to discover each other to find ways to exchange data.
Both protocols have their advantages and disadvantages, and the choice depends on your application.
Reply 【IoT】 within the official account to get more IoT-related materials.
Disclaimer: The content of this article is sourced from the internet, and the copyright belongs to the original author. If there are any copyright issues, please contact me for removal.
Welcome to follow my official account, reply 【Add Group】 or scan to add me as a friend, limited-time free entry into the technical exchange group, and you can also join my knowledge planet for free.
Recommended Reading
[Album] Component Selection
[Album] Experience Sharing
[Album] Open Source Projects
[Album] Career Development
Thank you for reading. If you like it,
please like and “see it” or share to your circle of friends.
Click to jump to the original text, limited-time discount to join our knowledge planet (add friends to get free coupons)