SST Makerspace ESP32 IoT Car

Make an electronic car that can be controlled with your phone, computer or any other electronic device using basic electronic components!

Beginner3 hours113
SST Makerspace ESP32 IoT Car

Things used in this project

Hardware components

Espressif ESP32 DEVELOPMENT BOARD
×1
L298N Dual H Bridge DC Stepper Motor Driver
×1
18650 Li-ion 2600mAh 3C Rechargeable Battery
×1
Battery Casing
×1
Male/Male Jumper Wires
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Geared motor
×2
Smart Car Tyre
×1
breadboard
×1
Castor Wheel
×1
Car Chassis
If you buy this car chassis from Hub360, you don't have to get geared motors, castor wheel, car tyres and a castor wheel as they will come with it (according to the description). Alternatively, you could use a wooden board or some other flat surface and buy the other components.
×1

Software apps and online services

Arduino IDE
Arduino IDE
https://www.arduino.cc/en/software
Blynk
Blynk

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
If you don't have a glue gun, you can use super glue or tape in some instances. Tape can also be used as an alternative in some cases where you may need to solder.
Small Screw Driver

Story

Read more

Schematics

ESP32 IoT Car Connection Diagram

This is a fritzing circuit connection diagram showing how the various components of the car are connected.

Note: The power source used in the diagram was a 9V battery. You can make use of that or of two 3.7V Lithium-Ion Batteries (since they are rechargeable). You may need to charge the Lithium Ion Batteries well before use (this means you may have to buy a battery charger if you choose this option) as if the supply reduces, it will not be able to power the esp32 properly and that could cause it to trip off or go offline.

Code

Code for the ESP32 car

Arduino
This is the Arduino IDE code for the car. It has been reviewed and commented to help you understand line by line.

All you have to do is copy the code, paste into your Arduino IDE and then read through the code comments for any few other changes you need to make.
//defining information constants that will carry the information from my online blynk account that will be used to connect to blynk cloud
//You are to copy these from the blynk website after making your template and adding your device
#define BLYNK_TEMPLATE_ID "YourTemplateID" 
#define BLYNK_TEMPLATE_NAME "YourTemplateName"
#define BLYNK_AUTH_TOKEN "YourBlynkAuthToken"
#define BLYNK_PRINT Serial //prints to serial monitor the status of the blynk when connecting or connected

#include <WiFi.h> //including for WiFi functionalities 
#include <WiFiClient.h> //including to allow the esp32 exhibit client qualities by connecting to the blynk online service (blynk.cloud)
#include <BlynkSimpleEsp32.h> //including for the basic Blynk functionalities for the esp32

//initialising a character array "auth" to take blynk auto token which will later serve as a parameter to setup Blynk to begin
char auth[] = BLYNK_AUTH_TOKEN;

//initialising WiFi credentials (which will serve as the source of connection between the blynk cloud and esp32)
char ssid[] = "YourWIFIOrHotspotName";
char password[] = "YourWIFIOrHotspotPassword";

//initialising variables for the IN pins to make future edits easier
int IN1 = 27;
int IN2 = 26;
int IN3 = 12;
int IN4 = 13;

BLYNK_WRITE(V1) { //creating the function with V1 as parameter to move forward whenever V1 is inputted as parameter from blynk control dashboard
  digitalWrite(IN1, param.asInt());
  digitalWrite(IN3, param.asInt());
}

BLYNK_WRITE(V2) { //moves backward when V2 is inputted as parameter from blynk control dahsboard
  digitalWrite(IN2, param.asInt());
  digitalWrite(IN4, param.asInt());
}

BLYNK_WRITE(V3) { // turns left when V3 is inputted as parameter from blynk control dashboard
  digitalWrite(IN2, param.asInt());
  digitalWrite(IN3, param.asInt());
}

BLYNK_WRITE(V4) { // turns right when V4 is inputted as parameter from blynk control dashboard
  digitalWrite(IN1, param.asInt());
  digitalWrite(IN4, param.asInt());
}

void setup() {
  Serial.begin(9600); //Beginning the serial monitor and setting the buad rate i.e 9600

  pinMode(IN1, OUTPUT); //specifying the IN pins as output for the pins to output to the motor
  pinMode(IN2, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);

  Blynk.begin(auth, ssid, password, "blynk.cloud", 80); //setting up the blynk by inputting necessary parameters to allow it begin 
  //(80 or 8080 is the port for blynk cloud)
}

void loop() {
  Blynk.run(); //running set up Blynk to collect input from Blynk
}

Credits

Joseph Adigwe
2 projects • 1 follower
I'm a student with an interest in electronics, robotics and automation. It started from watching movies and reading articles about robotics.
Contact
Saviour Emmanuel
0 projects • 0 followers
Contact
Pius Onyema Ndukwu
14 projects • 12 followers
I am a student and I have been developing hardware since 2017. My hardware journey started when I stumbled upon a youtube video on Arduino.
Contact

Comments

Please log in or sign up to comment.