6. PC Based Control Using Serial Communication
In this chapter, simple robot control over wired (USB) or wireless medium (XBee wireless
module) is covered. User can expand this protocol further to write his own applications. Using
good packet based protocol; user can design applications involving complex multi robot
communication scheme with robots to robots and robots to PCs simultaneous communication. A
more bit advanced communication protocol for the robot control and sensor data acquisition is
covered in the chapter 7. Spark V ATMEGA16 robot can communicate with the PC using USB
or XBee wireless module.
6.1: Communication protocol for simple robot control
Table 6.1 shows the simple robot control protocol. Using this, robot can be moved in forward,
backward, left or right directions and its buzzer can be turned on or off. You can use any serial
port control software such as hyper terminal or terminal.exe etc. For user friendliness keys of the
numerical pad of standard 104 keys querty keyboards are used. When a particular number key is
pressed, its ASCII character value is transmitted over serial / USB port. Robot receives this
ASCII values and based on its value it actuates its motors, buzzer etc. Keys are mapped in the
intuitive way on the Numerical pad of the keyboard.
This communication protocol is covered in the "10A_Serial_Communication_USB" and
"10B_Serial_Communication_ZigBee" projects which are located in the "Experiments" folder in
the documentation CD. Section 6.2 and 6.3 covers robot control using PC's USB port and XBee
wireless module.
Important:
While using "Numerical Pad" of the key board, make sure that "Num. Lock" is on.
6.2 Robot control using USB port
Spark V ATMEGA16 has onboard USB port for direct interface with PC. USB interfacing is
based on FT232 USB to serial converter. Serial port of the ATMEGA16 can be connected to
either USB port via FT232 USB to serial converter or to XBee wireless module. To connect
TXD and the RXD of the microcontroller to FT232 USB to serial converter, Jumper J5 needs to
be set in the correct setting. Refer to figure 6.1 for the jumper setting to use USB port.
© NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA
Character
ASCII value
8
0x38
2
0x32
4
0x34
6
0x36
5
0x35
7
0x37
9
0x39
Table 6.1
SPARK V ATMEGA16 Hardware Manual
Action
Forward
Backward
Left
Right
Stop
Buzzer On
Buzzer Off
87
Need help?
Do you have a question about the SPARK V ATMEGA16 and is the answer not in the manual?