Xbee+arduino communication problem

In summary, the conversation is about troubleshooting an issue with a system involving xbees, arduinos, and EMG signals. The goal is to send these signals from one arduino to another through xbees and wires, and eventually use them in a Simulink program. The xbees are configured in AT mode and the arduino code involves reading and printing analog values. The issue is with serial streaming and help is needed to achieve a signal similar to the original analog signals.
  • #1
ReneeL
1
0
I tried testing the system and I’m not sure if the problem is with the xbee’s, the transmitting code, or the recieveing code. Before I post my code I will explain what we are doing with the signals. We have three analog EMG signals that will be sent serially through on xbee using an arduino and xbee shield. We want to send these signals to the receiving xbee where the arduino will output these signals to be connected to a third arduino through wires to be used in a Simulink program. We are using an arduino mega for the transmitting side and an arduino uno for the receiving side. I was told I need to do serial streaming but I’m not sure how that’s done. I understand the xbee and arduinos both digitize signals but we are hoping to get a signal very similar to the analog signals we are transmitting. Any amount of help is greatly appreciated!
This is how I have my xbees configured (series 1) both in AT mode:
Transmitting Xbee:
Channel:10
Pan id: 1234
MY: 10
DL: 11
Receiving Xbee:
Channel:10
Pan ID: 1234
MY: 11
DL: 10
transmitting Arduino code:
void setup() {
Serial.begin(9600);
}
void loop() {
// read the input on analog pins
int sensorValue1 = analogRead(A0);
int sensorValue2 = analogRead(A1);
int sensorValue3 = analogRead(A2);
// print out the value you read:
Serial.println(sensorValue1);
Serial.println(sensorValue2);
Serial.println(sensorValue3);
delay(1);
}
Receiving Arduino code:
int received1=8;
int received2=9;
int received3=10;
void setup(){
pinMode(received1, OUTPUT);
pinMode(received2, OUTPUT);
pinMode(received3, OUTPUT);
Serial.begin(9600);
}
void loop(){
if(Serial.available() )
{
byte output1 = Serial.read();
byte output2 = Serial.read();
byte output3 = Serial.read();
digitalWrite(received1, HIGH);
digitalWrite(received2, HIGH);
digitalWrite(received3, HIGH);
}
}
 
Computer science news on Phys.org
  • #2
I'm sorry you are not finding help at the moment. Is there any additional information you can share with us?
 

1. How do I troubleshoot a communication problem between Xbee and Arduino?

The first step in troubleshooting a communication problem between Xbee and Arduino is to check all physical connections. Make sure the Xbee module is properly connected to the Arduino and that both devices are powered on. Next, check the code to ensure that the correct serial port is being used and that the baud rate is set correctly. You can also try resetting both devices and checking for any error messages.

2. Why is my Xbee not showing up in my Arduino IDE?

If your Xbee is not showing up in the Arduino IDE, there could be a few potential issues. Make sure that the Xbee module is properly inserted into its socket and that it is securely connected to the Arduino. Also, check that you have selected the correct serial port in the Tools menu of the Arduino IDE. If the Xbee still does not show up, try resetting both devices and checking for any error messages.

3. How do I know if my Xbee and Arduino are communicating successfully?

To confirm successful communication between Xbee and Arduino, you can use the serial monitor in the Arduino IDE. Upload a simple code to the Arduino that sends a message to the Xbee, and then open the serial monitor. You should see the message being received by the Xbee and transmitted back to the Arduino. You can also use a multimeter to check for data transmission between the two devices.

4. How can I increase the range of my Xbee and Arduino communication?

To increase the range of communication between Xbee and Arduino, you can try using a higher power Xbee module or adding an external antenna to the Xbee. Additionally, make sure the devices are placed in an open area without any obstructions that could interfere with the signal. You can also try adjusting the baud rate and using error-checking protocols to improve communication reliability.

5. Can I use Xbee and Arduino to communicate wirelessly with multiple devices?

Yes, Xbee and Arduino can be used to communicate wirelessly with multiple devices. Xbee modules can be set up in a mesh network, allowing for communication between multiple Xbee devices. This allows for data to be transmitted from one Xbee to another, creating a network of wireless communication. Additionally, each Xbee module can be assigned a unique address to prevent interference between multiple devices.

Similar threads

Replies
7
Views
1K
Replies
22
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
1K
  • Electrical Engineering
Replies
3
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Electrical Engineering
Replies
5
Views
3K
Replies
1
Views
3K
  • Programming and Computer Science
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
14K
Back
Top