GoBack
ESP32 based RC Car
Welcome to the ESP32 RC Car project. Beginner guide to your
journey to ESp32 for yourself and kids. If you are from Nepal, you
can find all the items linked to the Daraz, but you can also find
these easily on other shopping platforms like Amazon. Specially
for Nepali users, you can get all this in under 2500 which makes
it pretty affordable for begineer. So let's start building.
This code only supports Android devices. I'll be create another
schematics to support IOS devices.
You can also opt for an RC kit,
here
which includes the following components: 1: Chassis 2: Free-Rotating Wheel 3: One-way Switch 4: 3 1.5V Battery Holder 5: 2 Motors
Controller:
We'll be using Android App named Bluetooth RC car app, which you
can find the link
here
. The code presented here is made to support this app only. You
can also create your own app using MIT labs, but you'll have to
update the signal unless you decide to use the same.
Pinout Diagram: Code:
We'll be using Arduino IDE to create our code and upload it to
ESP32. If you are new with using ESP32.
Here
is a guidelines on setting up ESP32 on Arduino IDE
Below is the code. Please ensure you've the bluetooth serial
library installed. After that you can just copy the code and
upload it to your ESP32
#include "BluetoothSerial.h" #include <Arduino.h> BluetoothSerial serialBT;
//Bluetooth signal Store in this variable
char btSignal;
//initial Speed int Speed = 100;
//declare channel for pwm Output #define R 0 #define L 1
//PWM Pin for Controlling the speed
int enA = 5; int enB = 23;
//motor controlling pin int IN1 = 22; int IN2 = 21; int IN3 = 19; int IN4 = 18;
void setup() { Serial.begin(115200);
//Bluetooth Name
serialBT.begin("BLT"); //Bluetooth name