Web Control

Share for us

In the kit, there are two control methods: Web control and Python program control.

In this chapter, we are provided with method of web control. So we can open the browser on different devices, including computer, cellphone(Recommended), tablet and so on. You can use most functions of Picar-4wd, such as obstacle avoidance, line-following, object following and voltage check.

Note: Check the next chapter if you want to use python to control Picar-4wd.

Boot Web Control 

Input the command and start up the web control program.

cd /home/pi/picar-4wd/
picar-4wd web-example

As the program is running, on the browser, type the IP of the Raspberry Pi, and you can enter the Web interface.

Interface Introduction

  1. Arrow Key
  2. Power Regulator
  3. Obstacle Monitor: checking the obstacle ahead within 35cm and 180°. Red dot represents there is an obstacle ahead detected by ultrasonic module.
  4. Grayscale Monitor: displaying the color condition of the detected surface. If the module detects the black lines and then the cliff, the different colors will display on the monitor.
  5. Mileage
  6. Speed Monitor
    1. Ultrasonic: turning on/off the obstacle monitor and the ultrasonic measurement function.
    2. Grayscale: turning on/off the grayscale monitor and the line following function.
    3. Avoid: turning on/off obstacle avoidance function can make the car get around the obstacles automatically or not.
    4. Follow: turning on/off line following function can let the car follow the objects ahead or not.
    5. Cliff: turn on/off edge detection. The car retreats once it detects the cliff or not. If the car doesn’t realize the effect, please adjust the threshold on the setting page.
    6. Path: to turn on/off line following function. Once you start up the line following function, the car will drive along the black lines on the ground. If not, please adjust the threshold on the setting page.
    7. Setting: You can enter the Setting page by clicking this one.

Setting Page

Ultrasonic

This page is used to test whether the ultrasonic sensor works well. The slider below can be used to adjust the current direction and angle of the ultrasonic sensor.

Wheels

You can test the working condition of the wheels on this page.

Click a wheel then set the POWER, click the two buttons in bottom right corner. When you press the button at left, the wheel goes forward; press the button on the right, the wheel go backward. If the car doesn’t follow your operation like that, you should adjust the direction. The methods are as follows:

  1. Input the following command to open the configure file.
cd ..
ls -a
cd .picar-4wd/
nano config
  1. In the configure file, the first 4 lines of codes are used to control the turning of the motor. The last line is used to adjust the angle of the servo. For example, if in the above test, the direction of the motor at bottom left is reverse, so we change the code in the third line to left_rear_reverse = True.
  1. Rerun the following commands.
cd /home/pi/picar-4wd/
picar-4wd web-example
  1. In the browser, click Retry, and you can test the direction of the wheel ready to be used.

Grayscale

On this page, you can adjust the threshold of the line following and cliff detection.

Line Reference

Put the Picar-4wd on the white surface and record these three values of Grayscale. Now the value of Grayscale is large enough, about 1500. Then put the grayscale sensor module of Picar-4wd above the black surface and record these three values of Grayscale. Now, the value of Grayscale gets relatively small, about 150 as is predicted. So we set the value of Line Reference to 400. Of course, you can change the value. Once you finish doing this, you can see that the corresponding area turning into gray if the value of Grayscale is larger than 400; if not so, turning into black.

Cliff Reference

Put the car at the edge of the desk with the car’s head sticking out from the desk. Record three values of Grayscale, and now the value is relatively small, less than 100. Please set the value of Cliff Reference to 110. When you finish doing this, the corresponding area appears red exclamation symbol if the value of Grayscale is less than 110.

System

You can check the operating condition of the system on this page.

  • Make the example program run automatically at startup.
picar-4wd web-example enable
  • If you want to turn off the Start on Boot, please type in the following command.
picar-4wd web-example disable