Project 15: IR Remote Control Tank

(1)Description:

Infrared remote control is one of the most common remote control applications found in electric motors, electric fans, and many other household appliances. In this project, we use the knowledge we learned before to make an infrared remote control smart car.

In the 9th lesson, we tested the corresponding key value of each key of the infrared remote control. In this project, we can set the code (key value) to make the corresponding button control the movements of the smart car, and display the movement patterns on the 8X16 LED dot matrix.

The specific logic of the smart car is shown in the table below:

Ultrasonic key

Key value

Instructions from keys

FF629D

Move forward(set PWM to 200)
display the pattern of going forward

FFA857

Go back(set PWM to 200)
display the pattern of going back

FF22DD

Turn left
display the pattern“STOP”

FFC23D

Turn right
display the pattern of turning left

FF02FD

Stop
display the pattern“STOP”

Initial setting: 8X16 LED dot matrix shows the pattern“

(2)Flow chart:

(3)Connection Diagram:

Note:

GND, VCC, SDA and SCL of the 8x16 LED panel are connected to G(GND), V(VCC). A4 and A5 of the expansion board.

Since the 8833 board integrates the IR receiver, you don’t need to wire it up. The pins of the IR receiver are G(GND), V(VCC) and D3.

(4)Test Code:

You can edit blocks to build up your code

(1)

(2)

(3)

(4)

(5)

(6)

(7)

(8)

(9)

Complete Test Code

(Note: Do not connect the Bluetooth module before uploading the code, because uploading the code also uses serial communication, and there may be conflicts with the Bluetooth serial communication, which can cause the upload to fail.)

(5)Test Results:

After upload the test code successfully and power up, the smart car can be controlled to move by IR remote control and the 8*16 shows the corresponding patterns of its movements.