Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to integrate zigbee Wireless Communication Module with Arduino

Shulou Source: shulou.com Published: 2022-06-01 09:19:44 10月22日 Update

This article mainly shows you "Arduino how to integrate zigbee wireless communication module", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "how Arduino integrates zigbee wireless communication module" this article.

1. Hardware inventory:

Arduino 101one

Dfrobot IO sensor expansion board V7.1

Zigbee module (Shenlian Innovation DL-LN33) two pieces

CP2102 module USB to TTL one

One LED lamp.

Some DuPont lines

two。 Experimental purpose:

Use arduino 101to connect the zigbee module through the serial port (pin0-1 Magi RX Murtx). Arduino uses the usb serial port line and PC connection, which is used as the A terminal. The other end is B, which uses the CP2102 module to connect the zigbee module directly to the PC. FE 0591 9053 0D 01 FF is sent on the B-side PC using LN33's own serial port debugging tool. The A-side zigbee module receives the signal and transmits the data to the arduino through the serial port, triggers the LED light on the arduino to flicker, and then outputs the received data to the USB serial port.

3. Group Network Diagram:

4.

Code:

Unsigned char sendCmd [8] = {0xfe, 0x05, 0x91, 0x90, 0x14, 0x10, 0x02, 0xff}; / / LN33 to int ledPin = 13 void setup () {/ / Open serial communications and wait for port to open: Serial.begin (9600); / / USB serial port Serial1.begin (115200); / / RX TX serial port pinMode (ledPin, OUTPUT);} void loop () {if (Serial1.available ()) {digitalWrite (ledPin, HIGH); Serial1.write (sendCmd, 8) / Serial.println (Serial1.read (), HEX); myPtHex ((char) Serial1.read ()); while (Serial1.available ()) {myPtHex ((char) Serial1.read ());} delay (100); digitalWrite (ledPin, LOW); delay (100);} void myPtHex (int g) {/ / print g rightmost byte as Hex bit int a = g & 0xf0 / / left 4 bits a = a > 4; / / right 4 bits int b = g & 0x0f; / / right 4 bits char c = a < 10? A +'0': a +'A'-10; Serial.print (c); c = b < 10? B +'0': B +'A'-10; Serial.print (c);} these are all the contents of the article "how Arduino integrates zigbee Wireless Communication Module". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Module serial port wireless wireless communication communication content article learning help one end code sensor signal tool data easy to understand more organization list purpose Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Microsoft Huawei OPPO Reno Docker