The router uses 3.3V/GND for it's serial line voltage levels. We need to use a line level convertor that converts the 3.3V/GND to the +/-12V standard for RS232 serial communication. Technically, the right chip to use for this project is a MAX3232, however I've used both the MAX232 and MAX233 chips and they work fine as well. You could use any one of these 3 chips. MAX233 is nice because there is no need of external capacitors with it.
 |
| MAX232 circuit diagram |
 |
| MAX 233 circuit diagram |
This should look like this:
NOW The Software Part of this Hack:
The process described here will test both serial ports using X-WRT, a linux distribution for the WRT54GL that has a nice web interface. well to know how to install firmware image on to the router see (the firmware upgrade) section of this project.these ports should work fine for the other distributions as well.
After installing the firmware image, acess the web interdace (by default: http://192.168.1.1/). The first screen will ask you to set a new password. Set a new password and remember it!
To Test TTYS/0 (Console port /THE FEMALE DB9 connector):
- Connect a serial cable form the female DB9 connector to your PC. cable for this is usually called CROSS CABLE in markets.
- Open a hyperterminal connection using the settings showns (115200,8N1)
- Reboot the router.
- you should see a bunch of kernel messages. Hit enter at the terminal and you should see a screen like that looks like the one below.
To Test TTYS/1 (Port we will be using /THE MALE DB9 connector):
- Connect a null modem cable between the TTS/1 DB9 connector and your PC.
- Open a hyperterminal connection using the settings shown in the figure (9600,8N1).
- SSH in to the router (username is "root", Password is what you have set earlier) PUTTY is a good SSH software for Windows.
- Enter the command: echo "hello world" > /dev/tts/1
- confirm that you see "hello world" on your serial console in hyperterminal, if you see it means the hack is perfectly working. Consult these pictures for help.
MICROCONTROLLER CIRCUIT :
Microcontroller used in this project is a simple one that is (PIC 16F628A). It is easily available easy to use and cheap as well. The microcontroller is connected with the router, when router receives a control signal it passes it on to the microcontroller which then handles the further operation. Microcontroller compared the received values with the ones already coded in it and does the corresponding operation. For example if it receives value 8 it sends a ‘1’ to a pin responsible for the forward movement of the robot.
As for testing purposes a 3.3V coming from router were converted to 12V so now it cannot be fed directly to the microcontroller and it needs to be converted back so max232 is again used with the microcontroller and a male DB9 connector is also added as shown in figure
CAR RECEIVER IC:
Computer connects to the router, router connects to the microcontroller, and microcontroller connects to the CAR RECEIVER IC and feeds the signal to it. Disassemble your car and look for the receiver IC usually there is a realtek IC in there, search the IC data sheet on internet and look for the FORWARD BACK RIGHT LEFT pinouts. here is the diagram for the one i had in my car.
Connect the FOUR pins (Forward , backward, right , left) coming from the microcontroller to this IC's respective pinouts.
THE FIRMWARE UPGRADE:
lINKSYS allows us to upgrade the firmware and install a third party firmware that gives us extra features, but the warantee is gone once you install a third party firmware. Here we have used X-WRT a graphical extension to OPENWRT white Russian v0.9. To install the firmware SEE THIS PAGE. You can have the image file of X-WRT here.
Why a third party firmware has been used? Answer to this question is that only third party firmware allows installing the desired code into the router’s memory and by doing so that router could be used for our desired purpose. Secondly for using serial port it had necessary to make some changes in the boot file used by the router an openwrt-xwrt which can be used to do so.
CAR SERVER DEVELOPMENT:
There are pieces of this software which makes this project possible:
VB6 wifi robot client application (runs on windows), the car server which is in C and runs on the router running X-WRT and the microcontroller firmware which i have provided.
Installing the Car Server into the router:
The router should first be connected to perform this operation. so connect to the internet first.
SSH into the router using PUTTY type :(dont write the hash#)
# cd /tmp
# wget www.jbprojects.net/projects/wifirobot/carserver_1_mipsel.ipk
#ipkg install ./carserver_1_mipsel.ipk
Getting the serial port working:
Now we need to configure the male DB9 connector or the TTS/1 connector which we are using so for that SSH into the router using putty and write the following lines to install the serial port package into the router.(dont write the hash #)
#ipkg upgrade
#ipkg install setserial
#cd /usr/sbin
#wget http://www.jbprojects.net/projects/wifirobot/stty.tgz
#tar -zxvf stty.tgz
#chmod 755 stty
now in the X-WRT setup at 192.168.1.1 , go to the CUSTOM USER STARTUP (or /etc/init.d/custom-user-startup) and add the following lines to make the serial port working on the router startup and have the carserver automatically start.
/user/sbin/setserial/dev/tts/1 irq 3
/usr/sbin/stty -F /dev/tts/1 raw speed 9600
/bin/carserver &
this is it for the serial port thing.
INTERFACE DEVELOPMENT:
The computer interface is designed in Visual Basic 6.0. It uses TCP/IP communication to transmit control signals to the router. The reason why UDP was not opted is that it doesn’t have a flow control and also that TCP is a standard protocol for Wi-Fi. Additional serial communication features are added to have controls for the camera movement:
DOWNLOAD CAR CLIENT APPLICATION HERE
Client application also have camera rotation options whose circuit is discussed later in the camera rotation part!
HURDLE DETECTION PART:
We have implemented the other two methods which are (ULTRASONIC & INFRA-RED). Both of these methods have their own pros and cons.
ULTRASONIC METHOD OF HURDLE DETECTION:
Ulrasonic sensors work on the principle similar to radar or sonar which detects a target by interpreting the echoes from the radio ot sound waves respectively. ultrasonic sensors generate high frequency sound waves and evaluate the echo ehich is received back by the sensors. Sensors calculate the time interval between sending and receiving the echo to determine the distance to an object.
Our designed hurdle detector works at a frequency of 40 kHz. It uses two specially made ultrasonic transducers: One transducer emits 40 kHz sound, while the other receives 40 kHz sound and converts it into electrical variation of the same frequency.
Here is the circuit diagram: See the diagram and note down the components used. the two speaker looking like things are the ultrasonic tx rx of 40khz easily available in market.
Here is the circuit for integrating the hurdle detection part with the robot . so that it interrupts the forward signal when ever there is a hurdle.
INFRA-RED METHOD OF DETECTING HURDLES:
The receiver consists of a 555 timer IC working as an oscillator at about 38 KHz (also works from 36 kHz to 40 kHz) which has to be adjusted using the 10K variable resistor. The receiver uses a sharp IR module. When the IR beam from the transmitter falls on the IR module, the output is activated this activates the relay and de-activated when the beam is obstructed.
The relay contacts can be used to feed the microcontroller on the robot as an interrupt, lights etc. The 10K variable should be adjusted until the receiver detects the IR beam. When there is nothing in front of them, the IR beam is not reflected onto the module and hence the circuit is not activated. When an object comes near the device, the IR light from the LEDs is reflected by the object onto the module and hence the circuit gets activated
- The LEDs should be pointed in the same direction as the IR module and at the same level.
- The LEDs should be properly covered with a reflective material like glass or aluminum foils on the sides to avoid the spreading of the IR beam and to get a sharp focus of the beam.
We implemented two INFRA-RED based circuits where one was not successful and the other has an issue of variable results at times. The two circuits are shown below.

CAMERA ROTATION FEATURE:
Camera rotation feature is also an option feature for this project just like hurdle detection and light sensitivity feature. you can buy simply a PAN TILT IP CAMERA to have this feature but they are a little expensive for my liking so i came up with a new idea that is to use a RF Tx and Rx circuit to send and receive signals for rotation and feed these signals to a DC Gear motor which then rotates the camera mounted over it.
Here is a block diagram of what we need to do for camera rotation.
The Transmitter and receiver circuit can be obtained through any small toy car. TX from its remote and RX circuit from the car that runs the toy car motors.
You need to have a microcontroller here i have used Atmel 89C51, burn the given code on it, HERE IS THE CODE. connect the microcontroller with the computer COM port for that you need to use a level converter MAX232 as we did earlier with the PIC16F628A.
car client interface here has all the controls to serially communicate with the controller. now feed the 2 outputs of the controller to the 2 JUMPERS at the remote circuit of the toy car. these jumpers are the ones which are pressed when you push the remote buttons. unscrew the remote and you will know what i am saying when you see it.
so the transmission part is ready up till here where you can serially send signals from your computer Com port to the micro controller which feeds the Tx remote and that remote circuit then transmit a wireless signal.
now the receiver circuit is to be placed on the robot when the receiver circuit receives the signal we want it to be feed to the motor but we use a H-Bridge circuit here that enables us to rotate the motor in both directions secondly the DC GEAR MOTOR needs more power so the bridged circuit lets it use bigger battery . here i recommend to use the same 12v battery used for the router already .
H-bridge circuit:

The -ve and +ve are terminals of 12v battery.
The two blocks are the relays of 6v
The motor is DC Gear motor
The COM wire is to be connected to the negative of the receiver circuit of toy car
where as connect the two wires of receiver circuit (which were previously connected to the motor of the toy car) to the two coils of the receiver circuit.
Mount the camera over this GEAR MOTOR to rotate the camera , it is to be noted that the LAN CABLE of the camera should be kept long enough so that it can be rotated with the camera.
now your h-bridge is up and running!
POWER SUPPLY PART:
Power is an important factor as the router and the camera consumes a lot of power so it was necessary to develop a reliable and a rechargeable power source so that the robot could be operated wirelessly over a good period of time.
Following are the power sources which are used in this project.
Router and light sensing circuit uses
|
12v 1.2A rechargeable battery
|
For IP camera
|
2 rechargeable batteries of (5V 1.2A)
connected in parallel to get 5v and 2.5A
rating for the camera
|
Hurdle detection circuit an camera rotation circuit
|
9v disposable battery
|
Motor circuit
|
9.6V rechargeable battery in my case you
must see first that how much voltage is
needed by your toy car (used for tx rx circuit
of camera rotation)
|
DC GEAR MOTOR
|
12v Motor use the same router battery
|
LIGHT sensitivity circuit
|
Use the same 12v router battery
|
POSSIBLE FUTURE ENHANCEMENTS:
There are various possible future enhancements which can be made to this project. These enhancements will not only increase its functionality but they will also increase the scope of its application.
Metal detector:
Metal detector can be introduced in the robot vehicle for making it more suitable for the military use and for security and intelligence purposes.
Access points:
By the use of access points the range of this robot can be increased up to any desired level, this will make it a very suitable choice for the purpose of research and exploration.
Auto return:
It is another feature that can be added to this robot will make its operation more flexible and will reduce the risk of losing the control over difficult surfaces, as controller will not have to drive it back to the base station again instead it will come back by itself on the same path.
Temperature sensor:
Temperature sensors can also be added for having a temperature reading of a certain far off place. This might be an application dependent feature.
Image processing (face detection):
As the robot transmit a real time video therefore some image processing can be done on the received video to detect faces or places by using matlab algorithms. This will enable this robot to search and identify the suspects. This feature will add a great capability to this robot.
Web interfacing:
Web interfacing can be done and through that this robot will be controllable through the internet as well, the camera used in this project is a IP camera so its video can be view over internet as well so this will be a very good feature for using this robot for surveillance purposes.
RESULTS AND FINDINGS:
Wifi link is a better and more flexible option for being used as a communication link for controlling robot in comparison to RF link, because by using wifi we can increase the range of this robot by the use of access points and secondly it can also be integrated to interne by developing a web based console.
Max speed:
We conducted a test of speed between two defined points and time taken by the robot to cover that distance was calculated. The actual distance was 5m meters and time taken to cover this distance was 0.8s.
Speed = distance/time
Speed = 3m / 0.9s =3.3 m/s or 12 km/h
Distance:
We tested this robot in an open field for estimating the maximum distance that it can cover; it covered ~200m after this limit it got disconnected and no further signals could be sent.
DOWNLOADS:
[Its a .Docx file, Run in MS WORD]
[Its a SWF file, play in flash player or in google ghrome, Send a request for its design file to edit the presentation]