Jpeg

Multipoint wireless communication between RFBee ( Master and Slave )

This tutorial is to show multipoint wireless communication between RFBee modules, by changing channel, and show the concept Master and Slave using  Arduino and RFBee module.

Node A as Temperature Sensor node A

Node B as Temperature Sensor node B

Node C as Master node

 

Introduction

In this example, master node control the data flow. A slave can only send data if master request it.Again, this is a simple example, you are free and welcome to explore other methods. For my case, a slave node does not change channel, but every slave will have unique channel. Master node will change channel to communicate with particular slave, so master node must be able to enter AT mode and send AT command to change channel. Therefore, the master node will consist of Arduino and XBee shield. I will modify the XBee shield to allow the Arduino to switch between the AT and Transparent mode.

 

Hardware required for this tutorial:

 

Software required:

Concept Explation :

In this demo, we have two slave nodes and one Master node. Two slave node have own different unique channel communicates with master node. Both slaves node is used as Temperature sensor node. The modified master node able to change channel by own to communicate with slave nodes that have unique channel. In previous tutorial, we discussed about interference when using same channel for multipoint communication between RFBee module. In this Tutorial, I will show wireless communication between RFBee modules using different channel to without  interference and how to modify master node.

 

Procedure to build :

A) Temperature Sensor A using channel 007 .

1. Label CT-UNO as A.

Jpeg

2. Stack the Cytron XBee Shield onto CT-UNO.

3. Push the slide switch on RFBee module to AT MODE. If you are new to RFBee module, please check the User’s Manual to get started.

4. Stack the RFBee 433MHz module onto XBee Shield. Make sure RFBee module stack in correct orientation and the mini jumpers should be plugged at the “USB” and “USB” for Tx and Rx on Cytron XBee Shield.

5. Connect the CT-UNO to computer using USB micro-B cable and install the necessary driver. If you are new to CT-UNO, please check the User’s Manual to get started. Open ARDUINO IDE,
go to Tools -> Serial Port -> COM (that connected with CT-UNO). In my case, the COM is 5.

1

6. Change the wireless communication channel of RFBee module to 007 (since default channel is 001 ), optional from 001 to 127. This is just to show the method to change the wireless communication channel of RFBee module, you can ignore this if you want to stick to the default channel ( 001 ).

7. Open Serial Monitor in ARDUINO IDE. Make sure serial monitor’s baud rate is at 9600 baud and No line ending.

Send “AT” to module
Return: “OK”

Send “AT+C007″ to module
Return: “OK+C007”

To obtain all common parameters of module, simply send “AT+RX”to module. Serial monitor will return serial port transparent baud rate, channel, transmitting power and transmission function mode in order.

Send “AT+RX” to module
Return: “ OK+B9600\r\n OK+RC007\r\n OK+RP:+20dBm\r\n OK+FU3\r\n ”

 12

RFBee module of Node A is using Channel 007.

8. Close serial monitor and load this sketch Slave_Node into CT-UNO. *Before uploading sketch into CT-UNO, please remove the mini jumpers on XBee shield to D2 and D3. This is to avoid the bootloading process interfered by RFBee.

3232

DSC00860

9. After loading is done, remove USB micro-B cable and push the slide switch on RFBee to TRANS mode. Make sure RFBEE module stack in correct orientation and the mini jumpers should be plugged at the “D1” and “D0”for Tx and Rx on Cytron XBee Shield.

10. Connect LM35 to XBee shield using male to male jumpers. The connections are very easy. Just connect one end to VDD (RED wire) and the other end to GND(GREEN wire) while the middle pin (WHITE wire) connect to A0. By referring to the CT-UNO there are total 6 analog pins that we can choose. I use A0 as ADC input pin. You even can directly solder LM35 onto XBee Shield.

FFODOLCFVW22FQV.LARGE

     

q w

11. Connect USB micro-B cable to CT-UNO and open Arduino serial monitor. Type “ T” and press send. Serial monitor will reply temperature value  . This means temperature sensor node reply temparature value only when we send “T”. This is because to make sure temparature sensor node send temparature value only when master node send “T”.

 jhj

12. Close serial monitor and remove USB micro-B cable. Plug in 12V dc adapter or  powered up with the DC supply from LI-3.7-1000 batteries .

r

 

B) Temperature Sensor B using channel 009 .

1. Label CT-UNO as B.

Jpeg

2. Stack the Cytron XBee Shield onto CT-UNO.

3. Push the slide switch on RFBee module to AT MODE. If you are new to RFBee module, please check the User’s Manual to get started.

4. Stack the RFBee 433MHz module onto XBee Shield. Make sure RFBee module stack in correct orientation and the mini jumpers should be plugged at the “USB” and “USB” for Tx and Rx on Cytron XBee Shield.

5. Connect the CT-UNO to computer using USB micro-B cable and install the necessary driver. If you are new to CT-UNO, please check the User’s Manual to get started. Open ARDUINO IDE,
go to Tools -> Serial Port -> COM (that connected with CT-UNO). In my case, the COM is 7.

13

6. Change the wireless communication channel of RFBee module to 002 (since default channel is 001 ), optional from 001 to 127. This is just to show the method to change the wireless communication channel of RFBee module, you can ignore this if you want to stick to the default channel ( 001 ).

7. Open Serial Monitor in ARDUINO IDE. Make sure serial monitor’s baud rate is at 9600 baud and No line ending.

DD

Send “AT” to module
Return: “OK”

Send “AT+C009″ to module
Return: “OK+C009”

To obtain all common parameters of module, simply send “AT+RX” to module. Serial monitor will return serial port transparent baud rate, channel, transmitting power and transmission function mode in order.

Send “AT+RX” to module
Return: “ OK+B9600\r\n OK+RC009\r\n OK+RP:+20dBm\r\n OK+FU3\r\n ”

 44

RFBee module of Node A is using Channel 009.

8. Close serial monitor and load this sketch Slave_Node into CT-UNO. *Before uploading sketch into CT-UNO, please remove the mini jumpers on XBee shield to D2 and D3. This is to avoid the bootloading process interfered by RFBee.

3232

DSC00860

9. After loading is done, remove USB micro-B cable and push the slide switch on RFBee to TRANS mode. Make sure RFBEE module stack in correct orientation and the mini jumpers should be plugged at the “D1” and “D0”for Tx and Rx on Cytron XBee Shield.

10. Connect LM35 to XBee shield using male to male jumpers. The connections are very easy. Just connect one end to VDD (RED wire) and the other end to GND(GREEN wire) while the middle pin (WHITE wire) connect to A0. By referring to the CT-UNO there are total 6 analog pins that we can choose. I use A0 as ADC input pin. You even can directly solder LM35 onto XBee Shield.

FFODOLCFVW22FQV.LARGE

     

q w

11. Connect USB micro-B cable to CT-UNO and open Arduino serial monitor. Type “ T” and press send. Serial monitor will reply temperature value  . This means temperature sensor node reply temparature value only when we send “T”. This is because to make sure temparature sensor node send temparature value only when master node send “T”.

R

12. Close serial monitor and remove USB micro-B cable. Plug in 12V dc adapter or  powered up with the DC supply from LI-3.7-1000 batteries .

r

C) Master Node

To change channel of master node to communicate with different nodes of different channel, the CT-UNO need to to configure master node’s RFBee module manually. We want it to change channel of RFBee automatically. Understand this, to communicate wirelessly with other RFBee, the module itself must be in Trans mode (the slide switch must be at TRANS) and to send AT command (to configure the channel, baudrate, etc) the module itself must be in AT mode. We want this operation to be fully automatic without interaction from human. How can CT-UNO push the slide switch? No, the CT-UNO does not need to push the slide switch, instead, it change the logic (voltage) of the pin.  Tiny hacking on the XBee shield is needed.

Explanation about hacking master node

voltage-divider

The picture shows concept of voltage divider.

a) Picture below shows simple RFBee schematic for pin 4 and mode switch. Take note that pin 4 on RFBee is connected to SET pin of RF module . On the RF module, there is a resistor of 1K ohm series to the actual pin of input of on module microcontroller. If you notice, the slide switch on RFBee module is switching the SET pin to either GND or pull high to VCC (3.3V). CT-UNO can do that, it is like making LED ON and OFF :)

But since RFBee is powered with 3.3V but CT-UNO digital output is 5V, so a resistor to limit the current is recommended. I use 100 ohm. Connect a 100 ohm resistor in series with D12 pin (on XBee shield) to pin 4 of RFBee module as shown. Make D12 digital output on Arduino (in program), when you want RFBee in TRANS mode, make D12 HIGH. On the other hand, if you want RFBee in AT mode, make D12 LOW. Is as simple as that! Pay attention to your lecturer in electronic class.

 

b) Make sure the slide switch on RFBee module is at TRANS mode. Arduino cannot switch RFBee module to TRANS mode if the switch is at AT mode as it is connected to GND.

Procedure to hack the Master Node

1. Choose any digital pin of XBee shield that is free, (11,12, 2, 3 ). I choose digital pin 12.

2. Solder one end of resistor 100 ohm or 220 ohm at to digital pin 12 of XBee shield and another end to pin 4 of RFBee module socket.

3. Stack XBee shield that hacked onto CT-UNO.

4. Upload this sketch Master_Node*Before uploading sketch into CT-UNO, please move the mini jumpers on XBee shield to D2 and D3. This is to avoid the bootloading process interfered by RFBee.

3232

DSC00859

5. After uploading is done, remove USB micro-B cable and push the slide switch on RFBee to TRANS mode. Make sure RFBee module stack in correct orientation and the mini jumpers should be plugged at the “D1” and“D0” for Tx and Rx on Cytron XBee Shield.

6. Stack LCD shield onto XBee shield.

7. Plug in 12V dc adapter or powered up with the DC supply from LI-3.7-1000 batteries .

Jpeg

8. LCD shield on Master node should display temperature sensor value from Temperature sensor A and Temperature sensor B. Make sure the sensor node is being power up*If the transmission signal is weak, please solder the antenna on the antenna pad of the RFBee module else LCD displays “NO REPLY”. You may solder own spiral antenna using copper wire for flexible antenna and it works good. The length of antenna is 17cmUse arduino female headers for give extra space for antenna. According datasheet of LM35DZ IC(temperature sensors), maximum temperature can read is +100°C and minimum temperature can read is +2°C. If the temperature show below 1°C or above 150°C, it might be some problem in connection with temperature sensor node or temperature become too high or too low. In this situation, please troubleshoot temperature sensor node :).

JpegJpeg

Jpeg

JpegJpeg 

 

Conclusion :

When Master mode send “T” to temperature sensor node A, only the temperature node A will send temperature value to master Node.When Master mode send “T” to temperature sensor node B, only the temperature node B will send temperature value to master Node. So, no interference was happen. This tutorial is to show the master and slave roles in multipoint communication by using different channel. 

 

————————————————————————————————————————————————————————-

1. RFBee Module User’s Manual

2. CT-UNO User’s Manual

3. CT-UNO driver

Source Code :

1. Slave_Node

2. Master_Node

————————————————————————————————————————————————————————-

Buy

, , , , ,

Related Post

Jpeg

How to Make your Line Following Robot Faster?

Control Mobile Robot through WiFi with ESP-WiFi Shield (Arduino + Andriod)

image2

Let ESPresso thingSpeak for You

dsc00784 (1)

Lights Up Your Twitterland! :)

3 thoughts on “Multipoint wireless communication between RFBee ( Master and Slave )

  1. I’ve try this tutorial. Unfortunately, the TEMP B at the LCD not showing the temp measurement. It will remain “NO REPLY”. But the TEMP A at the LCD keep changing between “NO REPLY” and temp measurement. I really stuck on this. Hope you can help me. thank you.

  2. Hi, have you configure the RFBee accordingly. Please do share your settings in our technical forum as we seldom check the commend section in tutorial site.

Leave a Reply

Your email address will not be published. Required fields are marked *