TeMo – Telerobotics over Mobile packet data services
TeMo is a tele-operated mobile internet robot. While other internet robots mostly use WiFi (or a nearby PC with an internet connection), TeMo connects to the internet using Mobile packed data services (e.g. GPRS / EDGE / UMTS / HSDPA). The advantage is virtually unlimited mobility for the robot.
Simply put, TeMo is a robot that can
- Move around and do stuff (since it has tank tracks and a robotic arm)
- Can be controlled from any where in the world (since it has Internet connectivity)
- Can boldly go where no robot has gone before !! (since it used mobile packet data services for Internet connectivity)
TeMo is controlled using an Ajax based webage. The webpage is served by a tiny webserver running on a mobile phone that is mounted on the robotic platform. TeMo is also capable of sending pictures in realtime to the user terminal (and possibly also video in the near future). Watch a video demonstration on Youtube
Lets look at TeMo in detail. TeMo is made up of the following parts:
- Lego (technic) blocks for the basic mechanical structure.
- 5 servo motors for mobilty, torso rotation and arm control.
- A microcontroller that controls the motors, listens for commands from the webserver
- A standard mobile phone that runs a tiny Webserver, connects to the Internet using GPRS/EDGE/UMTS and communicates with the microcontroller over Infrared.
The following diagram shows how the overall system works.
Design and Implementation
I will describe the following in this section:
- Mechanical structure of the robot
- The electronics and the hardware.
- The Software
Mechanical structure of the Robot
TeMo has been made using Lego Technic Blocks. The Lego Technic system make is very easy to construct mechanical machines. The mechanical structure is based on the Lego Excavator . I bought the excavator kit and some more bricks from Ebay and that was all I needed to make the robot. I didnt want to use the servo motors from the Lego Mindstroms kit (since they are expensive and big in size), instead I used standard RC servo motors bought from Conrad (Model:RS-05 Cat No:230500). The robot has 5 servos in total. Two servos are used for movement (forward, backward, left and right) , one for torso rotation (left and right) and two servos for arm control (up, down, grasp and release). All the servos have been modified for continuous rotation so that they can rotate full 360 degress. Have a look at this page to see how that was done.
Electronics and the hardware
I have used a 16 bit Microchip microcontroller from the PIC24F family (PIC24FJ64002 64K flash program memory, 8K RAM, 2 UARTs, 6 timers) that listens for commands from the Mobile phone over IrDA. I did not feel the need of using an external crystal oscillator and thus the PIC is running at 4MIPS using its internal 8Mhz RC oscillator. The UARTs of the PIC24F family are IrDA capable and so I only had to connect and external IrDA transreceiver to make it talk to the mobile phone. There are many other ways to interface a microcontroller to a mobile phone, I have done a lot of research and experiments on the same topics. Have a look at this article to see why I choose this solution and what other options are available. The second UART on the PIC can be connected to the PC for debugging the software. The whole circuit board supports "In Circuit Programming", so I just need to connect my programmer to a header on the board and that enables me to upgrade the software on the PIC. Mobile phone: I was looking for the following features in a mobile phone so that it could be used for building TeMo:
- Internet connectivity: This meant that the phone needed to support any packet data service (GPRS / EDGE / UMTS / HSDPA). Data rate is not an issue, the currently software can work over a very low data rate / bandwidth connection also.
- A camera : This again is quite common with mobile phones today. TeMo can use the camera on the mobile phone to send back pictures to the user terminal (and possibly also a live video stream in the future)
- Infrared / Bluetooth / Serial Connectivity: These would enable the SW on the mobile phone to talk to the microcontroller that controls the motors and the sensors. I havent added USB to the list because it is very difficult to imeplement USB host functionality on a 16 bit microcontroller. It is relatively easier to implement Infrared / bluetooth / serial connectivity on a microcontroller using its on board peripherals or by using external modules. More information on this topic here.
- SW Platform: I needed a mobile SW platform using which a SW could be implemented that had the functionality of a webserver, a camera image capture utility and connectivity capabilities. It is easier to write such software with Java and it also makes sure that it will work on a variety of phones. Other platforms like Windows Mobile, Symbian etc. do not have this advantage (although you can write much more capable software for the phones using the native platform).
All the above mentioned features are standard with most mobile phone today. If you want to look at an exhaustive list of all the mobile phones that could have been used try GSM Arena's advanced phone search. The site returns more than a 1000 phones that have at least GPRS + a camera + Java. TeMo is currently using a Nokia 6233. It is a standard candybar style 3G mobile phone. The phone has not been modified in any way for use with TeMo. Battery Pack TeMo runs on four AAA size rechargeable batteries. The 4.8 volts output of the battery pack is used to drive the servo motor while the microcontroller runs at 3.6volts derived from the same battery pack.
The software running on the mobile phone acts as the webserver, uses the phone camrea to take photographs and communicates with the microcontroller over IR. As soon as the SW comes online it establishes an IrDa link with the micrcocontroller, registers its own IP address with a PHP script on embisys.com and starts listening for incoming connections on TCP port 80. The user needs to just open a known url under the embisys.com domain in a browser (AJAX support required). The users browsers is automatically redirected to the IP address of the mobile phone and the webserver serves the TeMo webpage to the browser. When the user clicks a button on the TeMo webpage an HTTP request is passed to the webserver. The webserver parses the request and appropriately taken an action. If the action required involves movement of TeMo, then the appropriate command is passed on to the microcontroller over the IrDa link. Have a look at this sequence digaram to get a better understanding. The microcontroller SW is runs an IR stack and acts as a server for the IrCOMM protocol (lets the infrared device act like either a serial port). The SW uses one of the microcontroller's internal timer to continuously poll for commands on the IR link and then send the required pulses to the servo motors using GPIO pins.
Development Environment: Mobile SW: Java 2 Platform – Micro Edition, Eclipse 3.1 IDE integrated with Carbide.j 1.5 Micrcontroller SW: written in C , MPLAB IDE integrated with C30 compiler, PIC Kit2 programmer, Microchip IrDA stack for 16bit MCUs
The current implementation of TeMo does not have any sensors. I am currently working on implementing the following:
- Laser ranging with 2D distance mapping: A Laser (will probably come out of a cheap pointer) will be mounted on the torso. The laser will project a fixed pattern (a triangle to start with) on objects in front of the robot. The distance will be calculated based on the scaling ratio of the pattern when viewed from the on board camera (i.e. farther the object, bigger is the pattern in the image). The robot will rotate its torso to take multiple readings and using extrapolation would be even able to estimate the shape of objects around it.
- Passive Infrared Sensor (PIR) : This sensor along with the help of image processing will help the robot to track or follow humans. The processing need not be done by the robot and could be offloaded to some other capable computer on the Internet. This feature could be very helpful for rescue, surveillance and even household robots.
References / Source Code / Links
- Microchips's 16bit PIC microcontrollers
- Nokia Carbide Development Tools
- Forum Nokia Java Documentation
- Microchips's IrDA stack for 16bit Microcontrollers
- W3schools AJAX tutorial
- Lego blocks: ~ 30 Euros from Ebay
- Servo Motors: 19.75 Euros (3.95 Euros / piece) from Conrad
- Microcontroller: 3 Euros from Microchipdirect
- Battery Pack: 8 Euros ( 4 * AAA size rechargable 1100 mAh) from Saturn
- Miscellaneous : ~ 15 Euros (wires, connectors, capacitors, resistors, plastic housing) from Conrad