WiFi Control Car

We can use the APP to view the WiFi camera screen, control the car's motion status, and control the servo rotation.

Download Yahboom CAM

You can scan the QR code below to download the latest APP.

image-20240604171241808

Device connection

Hardware connection

Use Type-B data cable to connect Arduino Uno and computer.

Software connection

Open the "Arduino IDE" software and select the model and serial port number corresponding to the development board.

Implementation ideas

Parse the data sent by the WiFi camera through the serial port and control the car according to the data.

Data format (communication protocol)

We only parse data in two data formats.

Data formatDescriptionExample
$Data header 
#Data tail 
Data,Data,DataData type 1Data represents only numbers: 1,0,0,0
Alphabet+DataData type 2Alphabet+Data represents a letter plus the following three digits: A100

Example:

Data format 1: $1,0,0,0#, $2,0,0,0#, $3,0,0,0#

Data format 2: $A100#, $A090#, $B120#

Note:

Click the function button on Yahboom CAM, the serial port will send data in the above format, our program parses the data and controls the car status.

Code Analysis

Here we only briefly introduce the code content. For detailed code, please refer to the corresponding code file, which is provided in the download area!

Note: Receive data between $ and #

Experimental results

After successfully compiling the program and uploading the code to the Arduino Uno development board, disconnect the car from the computer and connect the WiFi camera to the serial port on the expansion board.

After the program starts, we can control it through the Yahboom CAM APP.

APP remote control steps

It is recommended to use the hotspot built into the WiFi camera module for control.

APP connection

The mobile phone connects to the hotspot of the WiFi camera (the name of the built-in hotspot: Yahboom_ESP32_WIFI), and then open the YahboomCam software.

image-20240613164448710

Enter IP:192.168.4.1 in the YahboomCam software, then click to log in and enter the APP control interface.

image-20240605105322028

APP control

After entering the APP interface, the APP will display the camera screen.

image-20240605105424111

Control the movement of the car: U (forward), D (backward), L (left move), R (right move), S (stop), LT(left rotation), RT(right rotation)

Control the rotation angle of the servo: CL(rotate left), CR (rotate right), CU (rotate upward), CD (rotate downward)

Note:

Image problem: Due to the installation problem of the WiFi camera on our car, we need to check the horizontal flip and vertical rotation of the camera, so that the displayed image will be normal!

Servo control problem: Our car is only equipped with one servo, so it can only be controlled by the left and right of the servo, and the rotation range is controlled in front of the car [35°, 145°].