13.02.2023 r.
Micro-controllers Programming
Created by Mateusz Suszczyk
Watch the video demo! -> link
The main purpose of my robot is to drive accordingly depending on what button will be clicked on a website accessible from PC/smartphone. In addition, the robot collects sensor data such as temperature, humidity, motion detection, and noise value.
- NodeMCU v2 WiFi ESP8266
- Robot Chassis + tyres
- Motor Driver LN298N
- DHT 11 - temperature and humidity sensor
- Sound sensor
- HC-SR501 - PIR sensor
- 4 DC motors
- Breadboard
- Wires
- Powerbank 5V
- USB Hub
- Using a power bank as a source of power for motors is sufficient, but not optimal. To get better performance of motors, I highly encourage to use better source of power (e.g. 2x 18650 batteries).
- DHT11 tends to hang when reading values. To solve this problem try to reset the sensor by removing the cables and then putting it back.
- I had problems with .js file used to properly visualize knobs on site. Automatic refreshing values finally worked after one of those methods:
- Putting .js on my GitHub and then reach file using cdn.jsdelivr.net -> pureknob.js.
- Uploading file on internal flash memory using
server.streamFile(file, contentType);
.
-
Clone repository.
-
After uploading code from
car.ino
to ESP8266 (remember to change the credentials of the wifi network), uploadindex.html
to ESP using the command below:
curl -F "[email protected]" x.x.x.x/upload
x.x.x.x
is IP address of your ESP.
- Make sure that javascript library is added. For more accurate sensor values I have changed
pureknob.js
line 635:
from
value = Math.round(value);
to
value = Math.round(value * 10) / 10;
If the website does not work properly, add this line at the beginning of index.html
:
<script src="https://cdn.jsdelivr.net/gh/suszczyk/ESP8266-WiFi-Robot-Car@main/pureknob.js"></script>
and rerun command from point 2.
-
Connect your phone to the same wifi network as your robot. After reaching
x.x.x.x
you should see the page above. -
Happy driving :)
- Adding LCD screen
- Adding LM393 IR Speed sensor
- Connecting another ESP or Arduino to get more pins
datasith projects:
- Robot Car Controlled Using Websockets
- ESP8266 Display JPEGs On NeoPixel Matrix - Store images on ESP8266
- ESP8266 Analog Voltages for Controlling Webpage RGB Colors
Sensors:
Other: ESP8266 and the Arduino IDE - IOT Website Weather monitoring system using Blynk
UI:
- Dynamic bars: pure-knob
- Blynk colors palette: https://community.blynk.cc/uploads/default/original/2X/2/2d740375e05c5a79124e6d73c0da1c1b26802605.png