Arduino resetting when xbee shield connected

Hello

I have the following setup:

Arduino Duemilanove + Xbee shield + XBee 2mW Series 2.5 Wire Antenna (Router) (Picture) (.pro configure file X-CTU)

< Wireless Xbee connection to >

XBee Explorer USB + XBee 2mW Series 2.5 Wire Antenna (Coordinator) (Picture) (.pro configure file X-CTU)

I have used to this setup guide.

The connection between the two xbees is established perfectly, but I receive the data in pulses. I have made a little video, so you can see what I'm talking about.

I think the problem is to find in the xbee shield. I believe so, because the arduino is working perfectly without anything on it. With the shield on the onboard led (on pin 13) is blinking every few seconds, like it is resetting.

Anybody have any idea why I receive the data like that?

Hope you can help :slight_smile:

If the XBees are communicating, the problem must be the code on the Arduino. Let's see...

Oh, wait. You didn't post any code.

Here's my code:

/*
- 2 buttons
- 1 joystick (2 dimensions - x and y)
- Arduino Duemilanova
- XBee shield
- XBee series 2 - router

The buttons is on the digital pin 2 & 3
The joystick is read on analog pin 0 & 1
 */
 
 bool recordDown;
 bool resetDown;

void setup() {
  Serial.begin(9600);
  pinMode(2, INPUT);
  pinMode(3, INPUT);
  recordDown = true;
  resetDown = false;
}

void loop() {
  int record = digitalRead(2);
  int reset = digitalRead(3);
  
  if(record == HIGH && !recordDown) {
      recordDown = true;
      Serial.println("/rec 1");
  }else if(record == LOW && recordDown) {
      recordDown = false;
      Serial.println("/rec 0");
  }
  
  if(reset == HIGH && !resetDown) {
      resetDown = true;
      Serial.println("/reset 1");
  }else if(reset == LOW && resetDown) {
      resetDown = false;
      Serial.println("/reset 0");
  }
  
  //int xAxe = analogRead(A0);
  int yAxe = analogRead(A1);
  
   //Serial.print("/xAxe "); Serial.println(xAxe);
   Serial.print("/yAxe "); Serial.println(yAxe);
}

Add a Serial.print() statement to setup(). See if that gets called more than once.

Open the Serial Monitor, and watch the data that shows there. Does it match the data that the XBee on the explorer board sends to the PC? Does the timing match?

The XBees do error checking and re-transmission if an error occurred. Is there anything that could be causing interference with the signal? Distance? Electrical activity nearby?

What speed do you have the XBees configured to communicate at?

Hi,

I am having the same problem with the same configuration. I wrote some very simple code to reproduce the problem and it is definitely resetting because the serial print message ""start again!!!!!!!!!!!!!!!" that I put in setup method keeps coming up.

void setup()
{
  Serial.begin(9600);
  Serial.print ("start again!!!!!!!!!!!!!!!\n");
}

void loop()
{
  Serial.print ("12345678901234567890\n");
  delay(10);
}

If I change the delay in the code to 1000 milli sec it does not reset but if I reduce it to 500 milli sec or lower it resets the Arduino every few seconds.

Symptoms:-

  • The Arduino sending the serial print statements is resetting.
  • The receiving Xbee connected to the Xbee Explorer is fine.

Debugging:-

  • I have switched out the Xbee Shields because I had a spare and it still resets
  • I have switched out the Arduino because I had a spare and it still resets.
  • I have even switched Xbee's because I had a spare and the problem still exists
  • I have switched the Router and Coordinator around between the explorer and the Arduino and it still resets.

Is it possible that the serial buffer on the Arduino is filling up and causing a reset of the device or maybe the Xbee is resetting the Arduino due to a buffer overflow?

Hi MeaMonkey

I think I found the resolution to this problem. I came across a great Blog written by someone called Ole who had the same issues. He also discusses some other neat tricks with Xbee.

Quote from Article:

"Anyway, turns out the solution for Annoyance #1, Mysteriously Resetting Arduino is also extremely simple. When using X-CTU to configure your EndDevice, simply set IOD7=0 (or use ATD7=0, same thing). The XBee will no longer reset your Arduino simply because it wants to sleep."

This solved my problem.

I read somewhere (I cannot remember now) to rest both xBee's to factory defaults as a coordinator and router and they will work. I did this an this also fixed the problem.