xbee questions and motor shield

hey everyone,

I'm involved in a new project: creating a small "car" controlled by an iPhone via OSC. What I was thinking to do was: iPhone (via OSC)>Processing (in my Mac via WiFi)>XBee (plugged via XBee USB Explorer to my Mac)>XBee (on the Arduino plugged via the XBee Shield)>Arduino>Move servo/motor (plugged via the Motor Shield)

my questions are: on the web I just found projects where XBees were communicating from one Arduino to another one, but I'd like to go directly from XBee on my Mac to the one on the Arduino, is it possible ? what kind of steps should I go through ?

How can I use two different shields (the XBee Shield and the Motor Shield) in the same Arduino board ?

Thanks

but I'd like to go directly from XBee on my Mac to the one on the Arduino, is it possible ?

Yes, it is. You need something like this on the PC end: http://www.sparkfun.com/products/8687

what kind of steps should I go through ?

The XBees simply replace the USB cable between the PC and the Arduino. Serial.print(), Serial.println(), and/or Serial.write() to send data to the Arduino. Serial.available() and Serial.read() to read the data on the Arduino. Exactly the same as if there was a wire.

How can I use two different shields (the XBee Shield and the Motor Shield) in the same Arduino board ?

Depends on which motor shield and which XBee shield you are referring to. Links?

thanks for the answer, my shields are these:

Motor Shield: http://www.ladyada.net/images/mshield/done_t.jpg XBee Shield: http://www.emmeshop.it/images//arduino/Shield_XBee.jpg

I've also bought a few 8 and 6 pin stackable headers to solder to the Motor Shield, but I've not done that yet, what kind of setting would you suggest ? In case, is it possible, maybe to only connect via jumper wires a shield to another shield ?

thanks again

Pictures of the shields are almost useless. They all have the same general shape.

Yes, it is possible to connect the shields using wires instead of using headers and plugging them in. You need to make sure that every connection that the shield assumes IS actually made. Consult the wiring diagram for the shield, not the picture.

ok I'll try to do it. But while working I'm having a problem. I've configured both my xbees, now when I'm testing I can see that data has gone from iphone to processing to usb explorer xbee (tx led is blinking), but nothing is happening in the arduino where I've put the xbee shield with the wbee on it, any suggestion ?

maybe something to do with the movable "pins" on the arduino xbee shield ?

thanks

Help, my radio doesn't work. It doesn't matter what kind of radio it is, does it? It doesn't matter what frequency I have it tuned to, does it? It doesn't matter how I am determining that it doesn't work, does it?

Uh, yeah, it does.

I'm sorry for not being clear. So, I'm using two XBee modules S1, an Arduino XBee Shield and an Arduino Duemilanove I've configured the XBees using XBeeConfigTool for Mac OSX and it has 2 options for frequency and I choosed the one suggested for the ATmega328 that it's 57600. I'm determining that' the thing it's not working because I'm trying a simple led blink sketch with the arduino connected via usb (it works) and with the xbee shield (it doesn't work)

I’ve configured the XBees using XBeeConfigTool for Mac OSX and it has 2 options for frequency and I choosed the one suggested for the ATmega328 that it’s 57600.

What other options can you configure? Typically. you need to set MY, DL, and PAN ID. My on one Xbee needs to match DL on the other XBee. The PAN ID values need to match.

an Arduino XBee Shield

Which XBee shield? Several companies make them, and they are not all the same. Does yours have removable jumpers? If so, how are they positioned? Are there LEDs on the shield? Do they blink when the XBee receives data? When the XBee should send data?

I’m trying a simple led blink sketch with the arduino

Be useful if you posted it. What application are you using to send data to the Arduino?

I firstly used XBeeConfigTool to configure the Xbees and it gives only the possibility to edit MY, PAN, BAUD(only 2 options). I tried to use XCTU but it cannot establish a connection with the modules, that's strange I guess it's because I did the initial configuration on Mac with XBeeConfigTool.

The XBee shield I'm using I think it's the standard one, there are these two websites written on it: arduino.cc and libelium.com I'm trying to blink the integrated LED of the arduino (pin 13) and the XBee on the shield should not send data, only receive. On the shield I just see one led that blinks then stops then blinks (in a loop) There are removable jumpers and now they are both connected to the XBee side

Here's a pic that I've made http://twitpic.com/4y3xu3

I'm using processing to send data to the serial port with 57600 baud (the same as the one in the arduino and both the xbees)

Thanks for the patience

If you have access to a PC running windows, you really should try using X-CTU to configure the XBees. Setting MY (the address of the Arduino) is important, because it defines how other XBees would address it. Setting DL is also important, because it defines WHICH other XBee to talk to. If you aren't setting/can't set DL, who are you talking to?

There are 2 jumpers on the XBee shield. One (or both, it's hard to say) says USB/XBee. How do you have the jumper positioned? It needs to be in the USB position to upload a sketch, and in the XBee position to run the sketch.

I followed your suggestions using X-CTU and now everything works ! thanks again

I just finished soldering the adafruit motor shield and tested, what happens is that the LED blinks (showing that it may work) and I get a noise from the motor, here is a short video I've just made http://yfrog.com/hqzuiz please take a look

I've plugged each pin with a jumper because later on I also need to plug the xbee shield and I already saw that they won't fit thanks again

Just be careful when stacking shields. You have to make sure that any I/O pins used by one shield are not used by the other, and vice-versa. So if the motor shield expects data on pin 7, you cannot have the xBee shield using pin 7 for any reason whatsoever. Or if the xBee uses pin 12 to send data back to the Arduino, the motor shield can't do anything with that pin, etc. Sorry if this seems obvious, but I see folks pot with this problem all the time.

PS: It's ok if both shields use the same power and/or ground pins, provided the total current draw doesn't exceed the max ratings.

Hi friends, I have read this post and also this other: http://arduino.cc/forum/index.php/topic,20404.msg150540.html

I have a problem with the "2A motor driver" from DFROBOT: http://www.cooking-hacks.com/index.php/shop/robotics/drivers/2a-motor-shield-for-arduino.html

and the libelium XBee shield: http://www.cooking-hacks.com/index.php/communication-shield-xb-bt-rfid.html

I can insert/plug the 2A motor driver on my Arduino UNO board as the first shield in the stack. And then I put the XBee shield (with a WiFly module) on the top of the stack.

Because of libelium XBee shield needs Vcc(5V) and GND from the ICSP header and the 2A motor driver does not provide this ICSP pins, I route a pair of wires from this shield to the XBee shield with these power lines (5V and GND). So, it seems to work because I see leds of all shields blinking in some manner. But the program does not work because WiFly module cant't communicate with my PC and can't get DHCP IP, etc. On the other hand, if I plug the XBee shield+WiFly module directly on the Arduino board as the unique shield on the stack (without plugging the 2A motor driver), the set works properly communicating with my PC.

So I can't find wheres's the problem with the motor driver. I read the schematics/manuals and these shields seem not to haven common pins or signals....

Is there anybody who can help. Thank you very much in advance.

Hi friends again!

I just solved the problem.

Introducing a little delay in setup procedure (2 seconds) in order to wait for the initialization of XBee shield/WiFly fixed it up.

Why it worked before without this delay and without the DFR 2A motor driver? I don't know.

Thank you anyway...