Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to integrate zigbee Wireless Communication Module with Arduino

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report