Using the APC220 wireless data transmission module (including antenna), create a remote-controlled tracked vehicle that can be controlled from a long distance.
▲ A complete demonstration video is at the end
APC220 Wireless Data Transmission Module (Including Antenna)
The APC220 module is a highly integrated half-duplex low-power wireless data transmission module, which embeds a high-speed microcontroller and a high-performance RF chip, allowing direct communication between two MCUs using the APC220 module.
Remote Control
The remote control uses Arduino, with the joystick Vrx connected to pin A0 and Vry connected to pin A1 to control the vehicle’s forward, backward, left, and right directions. The buttons are connected to pins 9 and 10 for simple control of the vehicle’s movement forward and stop. The APC220 module’s TX and RX are connected to the corresponding RX and TX of the Arduino.
Remote Control Program
bool a;
bool b;
int value=0;
void setup()
{
pinMode(13, OUTPUT);
pinMode(10, INPUT);
Serial.begin(9600); // Set serial baud rate to 9600
}
void loop()
{
value=analogRead(A0);
if(value<10){
Serial.write("l");
}
if(value>1000){
Serial.write("r");
}
value=analogRead(A1);
if(value<10){
Serial.write("b");
}
if(value>1000){
Serial.write("f");
}
a=digitalRead(10);
b=digitalRead(9);
if(a==HIGH){
Serial.write("f");
digitalWrite(13, LOW);
}
if(b==HIGH){
Serial.write("s");
}
}
Tracked Vehicle
The APC220 module’s TX and RX are connected to the corresponding RX and TX of the Arduino.
The motor driver uses the L289N red board, connected to pins 4, 5, 6, and 7 of the Arduino.
The tracks use parts from other robots, and due to motor interface issues, hot melt glue is used. The power supply is a power bank, serving as the main base of the vehicle, and hot melt glue is also used to connect to the motor (the vehicle structure lacks strength).
Tracked Vehicle Program
char a;
void setup()
{
pinMode(13, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
Serial.begin(9600); // Set serial baud rate to 9600
}
void loop()
{
a=Serial.read();
if(a=='s'){
digitalWrite(13, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
if(a=='l'){
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
if(a=='r'){
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
digitalWrite(7, LOW);
}
if(a=='f'){
digitalWrite(13, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
digitalWrite(7, LOW);
}
if(a=='b'){
digitalWrite(13, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
}
}
Demonstration Video
▼ Video Demonstration
Original link: https://mc.dfrobot.com.cn/thread-311923-1-1.html
Project Author: Yun Tian
First published in DF Maker Community
Hardware Arsenal
DF Hardware Arsenal
Click to learn more👆
If you have anything to say or corrections to the article translation, feel free toleave a message!
Everyone is welcome to clickread the original text, and communicate directly with Teacher Yun Tian!
Previous Project Reviews
Raspberry Pi Basic Series Tutorial
Open Source! Teach you to make the most exquisite Pi!
Make a handheld computer with Raspberry Pi and ESP32
Mood Logger – A Counting System Based on Wireless RF Modules
Modify an ESP8266 to create a “Matrix” code rain computer case
How to make a Strider camera robot using ESP32-CAM and 3D printed parts
Click to read👆
Leave a Comment
Your email address will not be published. Required fields are marked *