Remote Mobile Robot with XBee-WiFi

*During write this tutorial, Xbee WiFi don’t have SoftAP mode yet. But now, Xbee WiFi offers SoftAP mode and much more suitable for this application. So it is recommended to read this tutorial: Remote Mobile Robot with XBee-WiFi (Android)

Since Digi International (company of XBee) has launch their WiFi module (XBee-WiFi), I am thinking to create a simple but interesting application using this module. What should be on your mind? Then I start to check my store, what should be the interested item. After a while I found this, mobile robot base with motor and wheel, MC40A board (I get this during the “spot 1 sen item” by Cytron), 7.4V LiPo Battery with connector, Xbee WiFi with SKXBee Rev2.0 and 4 set of PCB stands.

This is my base robot using donut board. I made it last 2 years, complete with SPG10 DC motors, extended bracket and Tamiya castor. At that time EDUBOT2 is not launch yet, so I choose donut board as a base. Why? I can easily drill using Pro’sKIT mini hand drill.

2 wires represent 2 point at each DC motor. It will be connected to MC40A ‘Left M’ and ‘Right M’ connector respectively. So I can control the DC motors direction.

Time to start assemble the mobile robot. Put the PCB stands at every edge (hole) of base. Ok, done!

Once your module has been recognized by the XCTU software, try to connect to your WiFi network. First click on ‘Active Scan > Scan’.

I’m using YES and this is my WiFi name “IdrisWiFi”. Click yours and enter the WiFi password.

Yes! My module connected to IdrisWiFi in 9614 ms.

Once connected, ASSO LED (DS5) on your SKXbee will blink, that’s mean your module has successfully joined the WiFi network and it will be given specific IP address. Click on ‘Read’ and you will see the updated ‘MY – Module IP Address’, ‘MK – IP Address Mask’ and ‘GW – IP Address of Gateway’. Look at ‘DL – Destination IP Address’, it shows 255.255.255.255 which means the broadcast address. It is better to set it corresponding to your PC/laptop IP address.

Make sure your PC/laptop connected to WiFi too. Then check your IP address. You can use command prompt, then type “ipconfig” followed by “enter”. It will display your current IP address. Mine is 192.168.1.10.

Now I will set the ‘DL – Destination IP Address’ to 192.168.1.10 in XCTU. Then change the ‘IP – IP Protocol’ to ‘1-TCP’. Why TCP? Because I just want to use the HyperTerminal software, and this software is a client TCP/IP. After done all the setting, click ‘Write’.

Make sure the ASSO LED (DS5) is blinking; otherwise you can press reset button on the SKXBee and wait until the ASSO LED is blink. Then click ‘Read’ again to double check all the parameter following what you set before. If it is different, you can repeat the configuration again.

Now, I want to test the connection. Open HyperTerminal software, give a name e.g. “XbeeWiFi”.

Don’t forget the basic setting on ASCII Setup. Check box for “Send line ends with line feed” and “Echo typed characters locally”.

Try to send any data. “Assalamualaikum” is a data from HyperTerminal to XCTU, and “Waalaikumussalam” is a data from XCTU to HyperTerminal. The communication between my laptop and the module via WiFi network is success.

Now, time to program the PIC16F887. I’m using MPLAB X IDE V1.51 and XC8 V1.12. Let’s focus on the main part.

After you download the program, make sure the XBee-WiFi is connected to your laptop Wifi (check the ASSO LED on SKXBee Rev2.0, it should blink), press SW1. Robot will send some string to the HyperTerminal, then it will move a little left and right to test the motor. Once you get the “Ready!” string, you can start press a key on the keyboard.

w/W – Forward

a/A – Rotate Left

d/D – Rotate Right

s/S – Stop

That’s all from me, hope you can play with it. Of course you will face some problem and troubleshooting, that’s call experience, and experience gives you valuable knowledge. 🙂

P/S: If you have question for Author, please do discuss in Cytron’s technical forum.

im at final stage… Robot will send some string to the HyperTerminal, then it will move a little left and right to test the motor. Once you get the “Ready!” string… i receive this at hyperterminal but when i press w for example nothing happen… i need ur advise…