Start here, Make a project!
This blog shares various useful Projects made by Kuman and Kuman's specially invite writers. If you like, welcome to contribute to us, and get paid.
By Kumantech | 04 July 2017 | 12809 Comments

Basic principles of WiFi intelligent car/robot

Having a Wifi smart robot car is a dream for many people, just like the RC video car in the movie Home Alone, it looks really amazing!  
But to most beginners, they are not electronics majors or computer majors, but love the WIFI/Bluetooth controlled robot car. It was always very difficult for someone with no experience, but it is not a problem from now on. The Robotsfans FORUM will publish a series of tutorials continuously to help you to make your own robot car.

The Bluetooth smart car is very similar to the Wifi smart car, the only difference being that this one is Bluetooth and the other is WiFi.
OK, let's begin the first lesson: the basics of the smart Wifi robot car.
This uses a router and PC, mobile phone, and a webpage for controlling. The basic principle divide as 4 parts.

1. By uploading open source Openwrt OS to a router, it becomes a microcomputer. What is Opeenwrt?
OpenWrt is an embedded operating system based on the Linux kernel, primarily used on embedded devices to route network traffic. The main components are the Linux kernel, util-linux, uClibc or musl, and BusyBox. All components have been optimized for size, to be small enough to fit into the limited storage and memory available in home routers.
OpenWrt is configured using a command-line interface (ash shell), or a web interface (LuCI). There are about 3500 optional software packages available for installation via the opkg package management system.

OpenWrt can run on various types of devices, including CPE routers, residential gate ways, smartphones, pocket computers (e.g. Ben NanoNote), and laptops. It is also possible to run OpenWrt on personal computers, which are most commonly based on the x86 architecture.

The above is from Wikipedia. Overall, it comes from Cisco's router source code, as a mini Linux system applies to some specific ICs. With this system, the router is not only for internet but also can install various programs, driver, and based on the router platform, the users can upload a USB camera, network card, sound card etc. by themselves.

A program called mjpg-streamer is running on the Wifi board, which encodes the video from USB camera and sends back to control program by Wifi, then we can see the video from the robot car.

Normally the router has reserved TTL serial port, TTL is for adjusting or refreshing, driving the port and outputting the instructions from WIFI channel to serial port through Ser2net software installed on the router. The serial port is here to communicate with MCU microchip to make the microchip know the orders from USER. About TTL, please refer to the following article.

2. MCU system and robot driver
MCU system is a very simple computer system with very low frequency, not used for complex data operation. Its main function is to control the electrical level of output pins (IO port) to drive the motor's actions with the motor drive IC, to achieve the forward and backward for the robot car.
We call the program running in the SCM system a “slave” program. This program is to receive instructions from the host computer and decode the actions from the USER, then make high-low level assignment by the SCM's specific pins, routing the instructions from the Wifi module (routing). The top level is PC/mobile etc. (host computer)

Note that the TTL serial port is a Serial Communication Port. There are 3 data wires for  TX, RX and GND. TTL's electrical level is under 5V, the most common routing and microchips have TTL electrical level. The communication is running on the same level, except TTL serial port uses another serial port called RS232, also called 9 pin serial port  on the computer. So we cannot use such serial ports to connect with each modules, a 232 to TTL converter is needed.

Control the drive board from our Work studio, the source code is completely opened, hobbyists with some experiences can download here:
MCU system:

3. Motor drive circuit
As said above, the instructions from host computer can be decoded by microchip, through instruction controls then pull up or down its specific pin electrical level, but the pin current is too low to drive the car, so a drive IC is needed, that means the main chip tells the drive module by pin level, for example, when main chip P10-P13 is 1010, the drive module output 2 way forward voltage, the car goes forward, if output 0101, the car goes backward. 

4. Host computer
Host computer sends the instructions. It sends instructions to the Wifi module/router through host computer then switch to main chip by the router, then the robot executes your instructions, at the same time host computer sends a video request to router, the program at the end of router will resend the video to the host computer to decode and display.
The host computer programming involves a high-grade language program design, we have the documents for free, it is for PC, V2.2, download here:
Andriod/PAD version control site:!iIFijIRT!EwBAIW85sJqXkCDytvykGw

Programming the host computer is done through TCP/UDP communication mode, connected with a socket to send the data to routing side. Here, our host computer is Client mode, routing side is Servo mode, it is better to connect the Wifi smart car without Forwarding operation.

Ok, Let's make a quick summary, the smart robot car works as below:


Recently Reviews

Read More

Leave a Reply

Your email address will not be published.Required fields are marked. *
Verification code