JeremyBlum.com

v3.1

Tutorial 9 for Arduino: Wireless Communication

| 335 Comments

This tutorial was featured on the official Arduino blog on 3/9/2011

This week, we go wireless! We’ll be using a set of arduino Unos, XBee shields, and XBee Transceivers that will create a Personal Area Network (PAN) for wireless serial communication. By the end of the episode, we will be able to turn a potentiometer on one arduino, and have it adjust a motor connected to a another arduino – all wirelessly! I suggest you pick up one of these Sparkfun XBee USB Breakout Boards to get your XBee addresses set up. Enjoy the video :)

EDIT:
Serial.flush() has changed in Arduino 1.0. You can use the following instead:
while(Serial.available()>0) Serial.read();

You can download the files associated with this episode here:

GNU GPL License Distributed under the GNU General Public (Open-Source) License.
Please Attribute and Share-Alike.

335 Comments

  1. +++ OK
    ATMY1000 ERROR000
    ATDL1001 OK
    ATID1111, OK
    WR OK

    WAT TO DO..MY FINAL YR PROJECT DEPENDS ON IT :(

  2. Hello,

    I am trying to configure two XBee S2 modules to communicate with each other via Ardiono Unos and the XBee Pro shields. My problem is I am new to this and not sure how to configure the XBee modules to talk to each other. I tried using Putty with instruction from Jeremy but I keep getting an error during the ATML1000 configuration portion. (His instructions work great for the XBee S1 but not the XBee S2). I have downloaded the XCTU software but am unsure how to use and the proper procedure to configure S2 modules to talk to each other.

    Any help would be greatly appreciated.

    Cheers,

    Andrew

  3. Dear Sir

    Good day,

    I have been working with my colleages on our graduation project and we happened to use the Xbee S1 module and the Arduino Uno microcontroller.

    We wanted to develop a wireless sensor network as follows:

    The laptop will be used as the coordinator(Arduino) and we will have two end devices in two neighbouring classrooms both of which will be composed of an Arduino Uno mounted on an Xbee shield which has an Xbee antenna on top, these end devices have two sensors and two switches respectively.

    We need help in allowing these two end devices to act as transceivers and send/receive the sensor and switch readings accordingly.

    In addition to this, we are thinking of using another end device as an access point or a repeater that receives a signal and strenghens it in order to be received by a further away coordinator.

    Please present us with any ideas or ways to successfully implement these ideas into action.

    Yours faithfully,
    Saleh Helmy

  4. Pingback: Xbee lessons | Gnardo Polo

  5. Hello, Sir Jeremy!
    I was wondering If I could just pull the reset of the arduino to ground instead of removing the chip?
    It was suggested on this video http://www.youtube.com/watch?v=odekkumB3WQ. I have an arduino MEGA2560 and an xbee shield but I don’t have an xbee explorer.

  6. i need to send the data from two or more zigbee transmitters circuit to one zigbee circuit ca u help me??

  7. Pingback: Xbee notes | Grimtech

  8. Hello.. I am using digital fire sensor at one xbee and an LED on another ..
    I have done the XBEE commuications using putty as those commands are different from yours because i am using XBEE S2….the commands are..

    XBee 1
    +++
    ATDH13A200
    ATDL40B7A19B
    ATWR
    ATCN

    XBee2
    +++
    ATDH13A200
    ATDL40B7A189
    ATWR
    ATCN

    Its done….
    Now will you help me with the CODING part of both the arduino’s & tell me about jumbers on XBEE shield.. should I first keep it to USB and change to XBEE after upload?
    My Codes are:-

    For Arduino and XBEE 1:-

    void setup()
    {
    Serial.begin(9600);
    pinMode(11,INPUT);
    }

    void loop()
    {
    int no=digitalRead(11);
    Serial.println(no);
    delay(500);
    }

    For Arduino & XBEE2 :-

    void setup()
    {
    pinMode(12,OUTPUT);
    Serial.begin(9600);

    }

    void loop()
    {
    while(Serial.available() ==0);
    if(Serial.read()>0)
    digitalWrite(12,HIGH);

    }
    Is there any bug? And one more thing, When I am conecting two Arduinos to my laptop, it is giving two com ports but only one selected on both IDE’s
    My two ports are COM13 & COM23…
    either COM13 is selected or COM23
    I always have to select the COM port which is perticular..HELP ME!

  9. Hey Ram,

    I know this a post from two years ago, but I too am having issues with interfacing my ADIS16488 with my arduino. Did you ever get this problem resolved?

    Thank you for your time,
    Sam

  10. hello jermey
    i am using xbee s2 in AT Mode for sending a byte wireless in TX end i hook up accelerometer ti arduino and then sent a byte correspondingly tilting of accelerometer but RX end i am getting byte with some delay i don’t what’s happening is it kind of buffer overflow or something ??
    PLEASE REPLY SOON :)

  11. Hi Jeremy
    I wish to use EZ430-RF2500 for serial transmission of analog values from 5 potentiometers, from the End Ponit target board to the Access point target board, and obtain these values at the respective pins of the target board at receiver end. Is there any way to achieve this? Basically, i want to try substituting XBee with the Ez430 module
    Thanks

  12. hi I am working on control 13 servo motor wireless with potentiometer
    pls send me the correct code

  13. Pingback: Tutorial 09 for Arduino: Wireless Communication

  14. I currently have a similar setup but with 4 dc motors, hardware: 2 arduino UNOs, 2 xbee shields, 2 xbee series 2, 1 motor shield, 4 dc motors, and 1 2 axis joystick, can you help with code to control the motors with joystick wirelessly

  15. Hi Jeremy,

    I currently have a similar setup but with 4 dc motors, hardware: 2 arduino UNOs, 2 xbee shields, 2 xbee series 2, 1 motor shield, 4 dc motors, and 1 2 axis joystick, can you help with code to control the motors with joystick wirelessly. Im not sure where to start. Please help me I cannot find any examples like this online.

Leave a Reply

Required fields are marked *.