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.
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
andfirst_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
and3rd - 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
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 | 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) | 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 | 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) | 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) | 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 | 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 | 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 | 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) | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 ) | 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 | 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) | 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 | 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 | 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) | 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) | 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 | 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 | 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 |
click to view...
- we made the schematics using KICAD (one of the most free useful tools in PCB designs and schematics) where the KICAD project files can be found in the directory called schematics files/KICAD project files and the schematic itself is exported as pdf where it can be found in schematics files/shematics view.pdf
click to view...
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
click to view...
- we used freeRTOS that comes with espressif-idf.
- 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.
- 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. - if you couldn't understand the code, here is a video for explanation of the code but note that the video is in arabic.
- 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 .
- name of libraries that are not included in this project files are found in the file called platformIO.ini where the libraries are
- dfrobot/DFRobotDFPlayerMini @ 1.0.5
- https://github.com/RobTillaart/I2C_EEPROM
- https://github.com/adafruit/Adafruit_NeoPixel