yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
Roboduino V2📖
0.Instruction manual
  • Instruction manual
1.Get started quickly
  • 01.Assembly of the Car
  • 02.Remote Control Car
  • 03.Common Problem Analysis
  • 04. Lithium Battery Pack and Charger Usage Guidelines
  • 05. Important Notes (Read Before Starting)
2.Environment Construction
  • 01.Serial port driver installation
  • 02.Arduino IDE Installation
  • 03.Arduino IDE usage
  • 04.Using third-party libraries
  • 05.Program compilation and upload
3.Basic car course
  • 01.RGB Control
  • 02.Serial Print
  • 03.KEY Read
  • 04.Buzzer control
  • 05.Logo Breath
  • 06.Servos Control
  • 07.Motor Control
  • 08.Ultrasonic Ranging
  • 09.Track Print
  • 10.Infrared Remote Print
  • 11.WIFI Camera
4.Advanced car course
  • 01.RGB Breath
  • 02.Play Music
  • 03.KEY Control RGB
  • 04.KEY Control Buzzer
  • 05.Serial Parse Data
  • 06.Parse Data Control Motor
  • 07.Parse Data Control RGB
  • 08.Parse Data Control Buzzer
  • 09.Parse Data Control Servo
5.Car motion control
  • 00.Mecanum wheel motion principle
  • 01.Car Vertical Movement
  • 02.Car Diagonal Movement
  • 03.Car Sideways Movement
  • 04.Car Rotational Movement
  • 05.Car Patrol
6.Comprehensive gameplay of car
  • 01.Car tracking
  • 02.Car Obstacle Avoid
  • 03.Car Follow Hand
  • 04.Car tracking Avoid
  • 05.Car Infrared Remote
  • 06.WiFi Control Car
  • 07.IR WiFi Control Car
7.AI vision course
  • 1. Cat(dog) detection
  • 2. Color recognition
  • 3. QR code instructions
  • 4. Person Recognition
  • 5. Face Detection
  • 6. Color Follows
  • 7. Face following
8.Expand peripherals
  • 01.Digital Tube Display
  • 02.Color Recognition
Download
  • Code
  • Library
  • Hardware manual
  • Software
  • 3D Model
  • Instruction Manual
Download ZIP

Welcome to Roboduino V2 repository

07.IR WiFi Control Car

IR WiFi Control Car

IR WiFi Control CarDevice connectionHardware connectionSoftware connectionImplementation ideasWiFi remote control carData format (communication protocol)Infrared remote control carData analysisCode AnalysisExperimental effectAPP remote control carAPP connectionAPP controlInfrared remote control carInfrared control

Use the K1 button to switch between WiFi remote control car and infrared remote control car in the car function mode selection stage.

xxxxxxxxxx
Since the previous tutorial has explained the basic knowledge of all car modules, the car control tutorial will not be repeated, and the main focus is on the car function implementation ideas!

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

WiFi remote control car: parse the data sent by the WiFi camera through the serial port and control the car according to the data;

Infrared remote control car: receive and parse the data from the infrared receiver, and then control the corresponding peripheral status of the car according to the data.

WiFi remote control car

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:

  • Data format 1 is mainly used to control the car status

  • Data format 2 is mainly used to control the servo angle

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.

Infrared remote control car

Data analysis

Infrared remote controlParsed dataFunction
Power0x00Stop all peripheral functions
RGB0x40Switch RGB colors
Buzzer0xA0Control the buzzer
Car Forward0x80Car forward
Car Backward0x90Car backward
Car Left0x20Car moves to the left
Car Right0x60Car moves to the right
Car Left Spin0x10Car rotates left
Car Right Spin0x50Car rotates right
Add0x30Increase speed
Sub0x70Decrease speed
Number 00xB0None
Number 10x08None
Number 20x88None
Number 30x48None
Number 40x28None
Number 50xA8None
Number 60x68None
Number 70x18None
Number 80x98None
Number 90x58None

Code Analysis

The code content is not introduced here. For detailed code, please refer to the corresponding code file, which is provided in the download area!

This function combines the infrared remote control car and WiFi remote control car function codes. You can understand the ideas based on the code.

Experimental effect

After the program is started, the RGB light on the car expansion board will display white, indicating that the remote control function mode selection stage has entered.

Mode switching: Press the K1 button on the car expansion board to switch between two remote control modes. The mode switching time is about 5 seconds. Once the RGB does not display color, it means that the function switching mode is over and the last selected remote control mode is retained.

RGB light displays white: WiFi remote control car mode

RGB light displays red: infrared remote control car mode

xxxxxxxxxx
If you want to switch the remote control mode again, you can press the Reset button on the development board to restart the program!
xxxxxxxxxx
The drive motor needs an external battery pack and the expansion board switch is turned on to drive normally.
The burning program cannot use other programs to occupy the serial port or the external serial communication module (for example: WiFi camera module), otherwise the program cannot be burned or an error message will be prompted!

APP remote control car

The car function mode needs to select WiFi remote control car mode: the initial setting is WiFi remote control mode after the program starts. Please wait for 5 seconds before remote control operation.

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.

xxxxxxxxxx
Some mobile phones will prompt for connecting to a hotspot without a network. We need to click to keep connected!

image-20240613164448710

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

xxxxxxxxxx
The IP of the WiFi camera's built-in hotspot is 192.168.4.1

image-20240605105322028

APP control

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

xxxxxxxxxx
If there is no display, check whether the phone is connected to the WiFi camera hotspot normally

image-20240605105424111

  • Left button

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

  • Right button

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°].

xxxxxxxxxx
The car program limits the rotation angle of the servo sent by the APP, and the control rotation range is [35°, 145°], which is to avoid collision or squeezing between the WiFi camera and the car expansion board.

Infrared remote control car

The car function mode needs to select the infrared remote control car mode: please press the K1 button within 5 seconds after the program starts. When the RGB light of the expansion board changes from white to red, it means that the mode is switched to infrared remote control.

Infrared control

Use the infrared remote control to aim at the infrared receiver on the car expansion board to control the buttons. The APP only sets the functions of some buttons.

image-20240526230334829

Infrared remote controlParse dataFunction
Power0x00Stop all peripheral functions
RGB0x40Switch RGB colors
Buzzer0xA0Control the buzzer sound
Car Forward0x80Car forward
Car Backward0x90Car backward
Car Left0x20Car moves to the left
Car Right0x60Car moves to the right
Car Left Spin0x10Car spins left
Car Right Spin0x50Car spins right
Add0x30Speed increase
Sub0x70Speed reduction

The infrared remote controller controls the movement of the car. You need to press and hold to perform corresponding control: for example, long press the car to move forward, and release the button to stop the car.

xxxxxxxxxx
In order to avoid infrared light interfering with the sensor, we need to use the infrared remote control function indoors

 

WiFi Control Car
Cat(dog) detection

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文