Skip to content

An autonomous car that can solve maze and find it's path out.

Notifications You must be signed in to change notification settings

abdosalem490/Carcotech

 
 

Repository files navigation

Table of content

preface

click to view...

our problem statment was to create a car that follows a line without drifting out of the line and traverse a maze to find a specific path from end to end, the car have a small user interface via buttons, can play song and produce various patterns on strip of neopixel leds while traversing the maze or running on the line tracker, all without affecting the main functionality of the car, this wouldn't have been possible without the help of freeRTOS and espressif-idf.

An autonomous car that can follow a line, solve maze and find it's path out.

our lovely car

shape of line tracker that was given to us to train on

line tracker1

shape of line tracker that was given on compitition day

line tracker2

shape of maze that was given to us and used on competition day

maze

car design

click to view...
  • we used freeCAD to design our car body, the design files can be found in 3D car design files/freeCAD-project files and you can open it using freeCAD, at first we designed the car to be of 3 floors and designed a holder for the sensor but after printing a prototype of the design, it was found that files called third floor.FCStd and first_floor.FCStd are only the useful file and all of the rest of design files were not used for the sake of this project.

  • to print the 3d design, you need to generate STL files from your design (was done by freeCAD also), so the generated stl files are found in 3D car design files/stl files for 3 printing where 1st - floor.stl and 3rd - floor.stl are only files that we printed where each files is printed alone and you shall send the .stl files to the 3D printing service company not the .FCStd files.

  • we made a custom design not a readily printed one as we needed a custmized shape, surface area and customized space for PCB and 2 motors, we choosed a circular shape as it seems to be a nice modern shape and it was inspired by Pololu car

image of the final designed

final car body

components, prices and links

click to view...

you can find the list of components with prices in the directory called prices & components used in the prices and components list.pdf or prices and components list.xlsx but it's not mentioned where we purchased these components and the prices doesn't include custom costs nor the shipping prices.

if you have time, we recommend you to purchase all of the components from ali express as it's cheaper in prices

component no.of items unit price link extra details
5 Channel TCRT5000 IR 5 Channel TCRT5000 IR 2 50 EGP https://www.aliexpress.com/item/1005004984933041.html?spm=a2g0o.order_list.order_list_main.25.21ef1802DzQBHj used to detect line, intersections, path, etc...
3D printing (Car Chassis) 3D printing (Car Chassis) 1 460 EGP https://wa.me/+201228206436 and https://wa.me/+201203414479 this is the car body, there are plenty of companies, individuals whom provide 3d printing services, but these 2 numbers are for students who provide 3d printing services for a good quality with cheap prices
wires wires 40 1 EGP https://store.fut-electronics.com/search?type=product&q=jumper+wire was used to connect compoents with each other, future electronics provides jumper wires with many different lengths ( we used 30 cm and 20 cm wire)
voltage regulator (L7805) voltage regulator (L7805) 1 4.5 EGP https://free-electronic.com/product/l7805cv/ supplied esp32 with the power supply of 5V, we had to insulate the power source of esp32 from other components as speakers made small fluctuations in the power source which made esp32 to reset several times
PCB Bread Board Shape FR2 (9X15 cm2) PCB Bread Board Shape FR2 (9X15 cm2) 2 15 EGP https://free-electronic.com/product/pcb-bread-board-shape-fr2-9x15-cm2-horizontal/ we used a prototype pcb which is more reliable than solderless board
pin header pin header 8 4 EGP https://free-electronic.com/?s=pin+header&product_cat=0&post_type=product needed pin headers to be soldered onto prototype pcb (we mainly used female pin header and rarely male pin headers)
Robot Car Wheel 85mm Robot Car Wheel 85mm 2 85 EGP https://free-electronic.com/product/robot-car-wheel-85mm/ this was the perfect wheel for our car body the provided needed height from the ground
Metal Coupler 4mm Metal Coupler 4mm 2 35 EGP https://free-electronic.com/product/metal-coupler-4mm-short-coupling-for-robot-smart-car-wheel/ was used to connect the motors to the wheels
Metal Caster Wheel for Robot (20mm)  Metal Caster Wheel for Robot (20mm) 2 35 EGP https://free-electronic.com/product/metal-caster-wheel-for-robot-20mm/ since car has only 2 motors so we needed 2 caster wheel to support car body from beneath to prevent it from swinging
NeoPixel Led stick NeoPixel Led stick 1 200 EGP https://www.aliexpress.com/i/4000203985307.html I bought this component before a year from ram-electronics but it seems now it's not available on ram any more but it's available on ali express
DC Gear Motor (8.8KG ) 250RPM DC Gear Motor (8.8KG ) 250RPM 2 325 EGP https://free-electronic.com/product/dc-gear-motor-8-8kg/ criteria of selection of our gear motor is that it has high reduction ration with high torque and high rpm but note that rpm is inversely proportional to reduction ratio so our motor had torque of 8.8 KG with rpm = 250 RPM and reduction ration 25:1 but it worked perfectly
Motor driver DRV8871 Motor driver DRV8871 2 130 EGP https://www.aliexpress.com/item/1005001590487986.html?spm=a2g0o.order_list.order_list_main.40.21ef1802DzQBHj motor driver small chip where one chip controls one motor so we needed 2, this is better than L298 as it's smaller, can pass higher current
Screw Mounting Bracket Screw Mounting Bracket 2 50 EGP https://www.aliexpress.com/item/32856826638.html?spm=a2g0o.order_list.order_list_main.89.21ef1802DzQBHj used to hold the motor onto the car body
ESP32 Development Board ESP32 Development Board 1 150 EGP https://www.aliexpress.com/item/1005001621773806.html?spm=a2g0o.order_list.order_list_main.95.21ef1802DzQBHj this was our main MCU and we recommend using it over arduino as it has many useful features like its espressif-idf that comes with freeRTOS, dual core, high speed MCU (240 MHZ), integrated wifi and integrated bluetooth on chip
DFPlayer Mini MP3 DFPlayer Mini MP3 1 50 EGP https://www.aliexpress.com/item/1005004994130177.html?spm=a2g0o.order_list.order_list_main.70.21ef1802DzQBHj a chip that plays mp3 audios without need of continous interaction with MCU, you just give it mp3 file number using MCU and it will play it for you
Speaker 4 Ohm 3 Watt Speaker 4 Ohm 3 Watt 2 55 EGP https://www.aliexpress.com/item/1005005020984275.html?spm=a2g0o.order_list.order_list_main.15.21ef1802DzQBHj speakers used to output sound and music while traversing
I/O Expander Breakout - SX1509 I/O Expander Breakout - SX1509 1 85 EGP https://store.fut-electronics.com/products/copy-of-bi-directional-voltage-level-translator-shifter-txb0104?_pos=1&_sid=6a669f7ad&_ss=r since the amount of pins on esp32 wouldn't be enough for all components, we used a port expander that communicates with esp32 through I2C that will increase the number of pins available
battery holder ( 3 x 18650 ) battery holder ( 3 x 18650 ) 1 15 EGP https://free-electronic.com/product/battery-holder-3-x-18650/ holder for lithium batteries as our car runs on 3 lithium batteries
Rechargeable Li-ion Battery18650 Rechargeable Li-ion Battery18650 3 50 EGP https://free-electronic.com/product/rechargeable-li-ion-battery18650-3-7v-1200mah/ used as power source for the car
electrolytic capacitor (25V - 60 micro farad) electrolytic capacitor 1 3 EGP https://ram-e-shop.com/product/c-47u250v/ was used to be connected between 3.3v and GND that helps in power source stability
switches switch 2 1.5 EGP https://free-electronic.com/product/boat-rocker-switch-on-off-6a250vac-kcd1/ one used to switch on/off the battery from the system and second one to switch on/off esp32 from the system
push buttons push button 3 0.75 EGP https://free-electronic.com/product/press-2pin-6x6/ used as user interface , 1 for Line tracker (L) , 1 for maze trainer (M_t) , 1 for maze solver (M_s)
LM2596HVS-ADJ DC-DC Step-Down Module (3A) DC-DC Step-Down Module 1 60 EGP https://free-electronic.com/product/lm2596hvs-adj-dc-dc-step-down-module-3a/ used to convert power supply from batteries (around 11 volt) to 3.3V to supply all the system of the car except esp32 that's supplied by voltage regulator and we didn't use voltage regulator to supply the whole system as the whole system withdraw a high amount of current and the maximum that a voltage regulator can supply is about 1 A
external EEPROM - 32 Kilo-byte (24C256) EEPROM 1 25 EGP https://free-electronic.com/product/24c256/ was used to store the optimized path after traversing the maze as Esp32 doesn't have interal EEPROM so we bought external one to store the optimized path on it so that if the system shutdown (car was turned off), we don't have to train again as the path is already stored
IC SOCKET Base 8 PIN DIP for eeprom IC socket 1 0.5 EGP https://free-electronic.com/product/ic-socket-base-8-pin-dip/ we didn't solder EEPROM IC onto the pcb board directly but instead, we solder the IC socket and the eeprom is inserted to the socket so any time, you can change the eeprom
PAM8403 5V Power Audio Amplifier Board amplifier 1 35 EGP https://free-electronic.com/product/pam8403-5v-power-audio-amplifier-board/ since the DFPlayer can output weak analog signal, the this amplifier module is used to amplify the signal before bypassing it to the speakers and the knob on it is used to control the volume

schematics

click to view...

schematics

demo videos

click to view...

Line tracker

(click on image to view the video)

IMAGE ALT TEXT

Maze trainer

(click on image to view the video)

IMAGE ALT TEXT

Maze solver

(click on image to view the video)

IMAGE ALT TEXT

Miscellaneous Videos

(click on image to view the video)


competition day line tracker with sound

IMAGE ALT TEXT

random expriment 1 on Line tracker

IMAGE ALT TEXT

random expriment 2 on Line tracker

IMAGE ALT TEXT

competition day maze trainer with sound

IMAGE ALT TEXT

random expriment 1 maze trainer

IMAGE ALT TEXT

random expriment 2 maze trainer

IMAGE ALT TEXT

random expriment 3 maze trainer

IMAGE ALT TEXT

random expriment 4 maze trainer

IMAGE ALT TEXT

competition day maze solver with sound

IMAGE ALT TEXT

random expriment maze solver

IMAGE ALT TEXT

random expriment 1 maze solver & maze trainer

IMAGE ALT TEXT

random expriment 2 maze solver & maze trainer

IMAGE ALT TEXT

android app

click to view...
  • the app can be found on google play sore

  • whereas the code can be found in the directory called android code

  • we used android app only in the line tracker as the mobile application sends "H" via bluetooth to the car to tell it that it's running on a straight so move faster or send "L" via bluetooth to the car to tell it that it's not running on a straight so move slower

Material Bread logo

Important Notes

click to view...
  1. we used freeRTOS that comes with espressif-idf.
  2. code can be found in ESP32 code/Carcotech/ where the project is made using platformIO (platformIO is just vscode extension that can be downloaded), we recommend using platformIO over arduinoIDE as you can manage code more professionaly on vscode than on arduino IDE.
  3. to open the project, open platformIO and click open project where the project working directory is ESP32 code/Carcotech/, also note that we used alot of libraries where some of them aren't included in the project files but they are present in platformIO repo, so once you open the project using platformIO, platformIO will download these libraries from its repo.
  4. if you couldn't understand the code, here is a video for explanation of the code but note that the video is in arabic.
  5. in the directory called datasheet of some components, as the name implies, you can find some of the datasheets and reference manual of the components that we used .
  6. name of libraries that are not included in this project files are found in the file called platformIO.ini where the libraries are

About

An autonomous car that can solve maze and find it's path out.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 60.5%
  • Java 32.9%
  • C 3.7%
  • CMake 2.5%
  • Batchfile 0.1%
  • Objective-C 0.1%
  • Other 0.2%