This shows you the differences between two versions of the page.
pm:prj2025:iivasciuc:bogdan.ciocea [2025/05/13 23:45] bogdan.ciocea [C4T3-LU (remote controlled land drone)] |
pm:prj2025:iivasciuc:bogdan.ciocea [2025/05/21 19:51] (current) bogdan.ciocea [Software Design] |
||
---|---|---|---|
Line 2: | Line 2: | ||
Designed by Ciocea Bogdan-Andrei, 333CA, May 2025 \\ | Designed by Ciocea Bogdan-Andrei, 333CA, May 2025 \\ | ||
Contact: bogdan.ciocea@stud.acs.upb.ro \\ | Contact: bogdan.ciocea@stud.acs.upb.ro \\ | ||
- | Github: [[https://github.com/BogdanCiocea | BogdanCiocea]] | + | Github: [[https://github.com/BogdanCiocea/C4T3-LU | BogdanCiocea]] |
===== Introduction ===== | ===== Introduction ===== | ||
=== Product description === | === Product description === | ||
Line 17: | Line 17: | ||
It can move in all primary directions: **FORWARD, BACKWARD, LEFT, RIGHT**, and diagonally. | It can move in all primary directions: **FORWARD, BACKWARD, LEFT, RIGHT**, and diagonally. | ||
+ | |||
+ | **Update**: I added **the bomb**. Now the hand controller can activate it. | ||
Line 29: | Line 31: | ||
===== General description ===== | ===== General description ===== | ||
- | {{pm:prj2025:iivasciuc:schema_c4t3lu1.jpg?600}} | ||
- | {{pm:prj2025:iivasciuc:schema_c4t3lu2.png?600}} | ||
- | |||
The **hand controller** includes the following components: | The **hand controller** includes the following components: | ||
* [[https://www.optimusdigital.ro/ro/shield-uri-pentru-arduino/274-shiel-pentru-arduino-cu-lcd-si-tastatura-.html|LCD 1602 shield]] – displays the current action sent to the robot and provides GPIO input via buttons. | * [[https://www.optimusdigital.ro/ro/shield-uri-pentru-arduino/274-shiel-pentru-arduino-cu-lcd-si-tastatura-.html|LCD 1602 shield]] – displays the current action sent to the robot and provides GPIO input via buttons. | ||
Line 38: | Line 37: | ||
* [[https://ro.mouser.com/ProductDetail/Seeed-Studio/101020054?qs=1%252B9yuXKSi8BEO0W3MQ6BNA%3D%3D|Grove 3-Axis Digital Accelerometer]] - communicates via I2C to detect angle rotation | * [[https://ro.mouser.com/ProductDetail/Seeed-Studio/101020054?qs=1%252B9yuXKSi8BEO0W3MQ6BNA%3D%3D|Grove 3-Axis Digital Accelerometer]] - communicates via I2C to detect angle rotation | ||
* [[https://www.robotshop.com/products/i-o-grove-base-shield-arduino|I/O Grove Base Shield ]] – manages connections to all hardware components. | * [[https://www.robotshop.com/products/i-o-grove-base-shield-arduino|I/O Grove Base Shield ]] – manages connections to all hardware components. | ||
+ | {{pm:prj2025:iivasciuc:bogdan.ciocea:schema_c4t3lu1.jpg?600}} | ||
The **robot** includes the following components: | The **robot** includes the following components: | ||
Line 45: | Line 45: | ||
* [[https://sigmanortec.ro/placa-dezvoltare-esp32-cam-wifi-bluetooth-ov2640-2mp|Support for ESP32 camera module]] - can be used independently for **WiFi video streaming** or interfaced via UART/SPI if needed. | * [[https://sigmanortec.ro/placa-dezvoltare-esp32-cam-wifi-bluetooth-ov2640-2mp|Support for ESP32 camera module]] - can be used independently for **WiFi video streaming** or interfaced via UART/SPI if needed. | ||
* [[https://www.optimusdigital.ro/en/ultrasonic-sensors/9-hc-sr04-ultrasonic-sensor.html|HC-SR04 Ultrasonic Sensor]] - obstacle detection using **digital I/O** pins (trigger and echo). | * [[https://www.optimusdigital.ro/en/ultrasonic-sensors/9-hc-sr04-ultrasonic-sensor.html|HC-SR04 Ultrasonic Sensor]] - obstacle detection using **digital I/O** pins (trigger and echo). | ||
+ | {{pm:prj2025:iivasciuc:bogdan.ciocea:schema_c4t3lu2.png?600}} | ||
- | ===== Hardware Design ===== | + | The **bomb** includes the following components: |
+ | * [[https://www.optimusdigital.ro/en/buzzers/635-3v-active-buzzer.html| Buzzer]] - a buzzer which connects to a digital port | ||
+ | * [[https://sigmanortec.ro/en/led-5mm-red | Led]] - a led which will light up to show it's active | ||
+ | {{pm:prj2025:iivasciuc:bogdan.ciocea:diagram_bomb.png?600}} | ||
- | <note tip> | + | |
- | Aici puneţi tot ce ţine de hardware design: | + | ===== Hardware Design ===== |
- | * listă de piese | + | |
- | * scheme electrice (se pot lua şi de pe Internet şi din datasheet-uri, e.g. http://www.captain.at/electronic-atmega16-mmc-schematic.png) | + | |
- | * diagrame de semnal | + | |
- | * rezultatele simulării | + | |
- | </note> | + | |
List of components: | List of components: | ||
Line 81: | Line 80: | ||
* [[https://www.optimusdigital.ro/en/ultrasonic-sensors/9-hc-sr04-ultrasonic-sensor.html|HC-SR04 Ultrasonic Sensor]] | * [[https://www.optimusdigital.ro/en/ultrasonic-sensors/9-hc-sr04-ultrasonic-sensor.html|HC-SR04 Ultrasonic Sensor]] | ||
{{pm:prj2025:iivasciuc:bogdan.ciocea:ultrasonic.png?600}} | {{pm:prj2025:iivasciuc:bogdan.ciocea:ultrasonic.png?600}} | ||
+ | * [[https://www.optimusdigital.ro/en/buzzers/635-3v-active-buzzer.html | Buzzer]] | ||
+ | {{pm:prj2025:iivasciuc:bogdan.ciocea:buzzer.png?600}} | ||
+ | * [[https://sigmanortec.ro/en/led-5mm-red | Led]] | ||
+ | {{pm:prj2025:iivasciuc:bogdan.ciocea:led.png?600}} | ||
+ | |||
Line 93: | Line 97: | ||
| Support for ESP32 camera module | [[https://sigmanortec.ro/placa-dezvoltare-esp32-cam-wifi-bluetooth-ov2640-2mp| Vendor]] | [[https://media.digikey.com/pdf/Data%20Sheets/DFRobot%20PDFs/DFR0602_Web.pdf | Datasheet]] | 61.32 lei| | | Support for ESP32 camera module | [[https://sigmanortec.ro/placa-dezvoltare-esp32-cam-wifi-bluetooth-ov2640-2mp| Vendor]] | [[https://media.digikey.com/pdf/Data%20Sheets/DFRobot%20PDFs/DFR0602_Web.pdf | Datasheet]] | 61.32 lei| | ||
| HC-SR04 Ultrasonic Sensor | [[https://www.optimusdigital.ro/en/ultrasonic-sensors/9-hc-sr04-ultrasonic-sensor.html|Vendor]] | [[https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf | Datasheet]] | 6.49 lei| | | HC-SR04 Ultrasonic Sensor | [[https://www.optimusdigital.ro/en/ultrasonic-sensors/9-hc-sr04-ultrasonic-sensor.html|Vendor]] | [[https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf | Datasheet]] | 6.49 lei| | ||
+ | | Buzzer |[[https://www.optimusdigital.ro/en/buzzers/635-3v-active-buzzer.html | Vendor]] |[[https://www.farnell.com/datasheets/2171929.pdf | Datasheet]] | 0.99 lei | | ||
+ | | Led |[[https://sigmanortec.ro/en/led-5mm-red | Vendor]] | [[https://www.farnell.com/datasheets/1498852.pdf | Datasheet]] | 0.30 lei | | ||
- | Total 496.27 lei | + | Total 497.56 lei |
===== Images ===== | ===== Images ===== | ||
Line 104: | Line 110: | ||
===== Software Design ===== | ===== Software Design ===== | ||
+ | The code was written in ArduinoIDE. | ||
+ | I used these libraries: | ||
+ | * [[https://github.com/arduino-libraries/Arduino_SensorKit/|Arduino_SensorKit]] - for communicating with the controller accelerometer | ||
+ | * [[https://github.com/arduino-libraries/LiquidCrystal|LiquidCrystal]] - for showing on a 16x02 display the commands | ||
+ | * [[https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFi|ESP8266WiFi]] - to know the MAC address of the boards | ||
+ | * [[https://github.com/henriberisha/EasyEspNow|espnow]] - for communicating with the boards | ||
+ | * [[https://github.com/jrullan/neotimer | neotimer]] - a non blocking timer for not using standard delays | ||
- | <note tip> | + | The software consists of 6 source files — two for each board (ESP8266 and ATmega328P on controller, robot and bomb). |
- | Descrierea codului aplicaţiei (firmware): | + | |
- | * mediu de dezvoltare (if any) (e.g. AVR Studio, CodeVisionAVR) | + | |
- | * librării şi surse 3rd-party (e.g. Procyon AVRlib) | + | |
- | * algoritmi şi structuri pe care plănuiţi să le implementaţi | + | |
- | * (etapa 3) surse şi funcţii implementate | + | |
- | </note> | + | |
- | + | ||
- | The software consists of 4 source files — two for each board (ESP8266 and ATmega328P on both controller and robot sides). | + | |
=== 🧤 Hand Controller == | === 🧤 Hand Controller == | ||
- | The **hand controller** acts as a **WiFi client**. It reads user input from buttons or an accelerometer and sends commands to the robot over WiFi. | + | The **hand controller** acts as a **master**. It reads user input from buttons or an accelerometer and sends commands to the robot over ESPNOW. |
The board used combines two microcontrollers: | The board used combines two microcontrollers: | ||
* **ATmega328P** – responsible for reading button presses, sensor input or just displaying commands. | * **ATmega328P** – responsible for reading button presses, sensor input or just displaying commands. | ||
- | * **ESP8266** – handles WiFi communication by sending HTTP `GET` requests to the robot. | + | * **ESP8266** – communication by sending commands using ESPNOW to the robot. |
- | The `LCD shield` is used as both a display and a keyboard (for entering IP addresses when switching between multiple target devices). | + | The `LCD shield` is used as a display to show the user which command is transmitted. |
- | The ATmega328P sends user input as a **command string** to the ESP8266, which then formats and transmits the command as an HTTP `GET` request to the robot server. | + | The ATmega328P sends user input as a **command string** to the ESP8266, which then formats and transmits the command to the slaves (robot and bomb). |
- | == 🤖 Robot == | + | The hand controller also can activate the bomb when the arm is controlling and the **SELECT** button is pressed. |
- | The **robot** acts as a **WiFi server**, waiting for incoming requests from the hand controller. | + | === 🤖 Robot === |
+ | |||
+ | The **robot** acts as a **slave**, waiting for incoming requests from the hand controller. | ||
On receiving a command: | On receiving a command: | ||
- | * The **ESP8266** parses the HTTP `GET` request and extracts the command string. | + | * The **ESP8266** extracts the command string. |
* It forwards this string via **USART** to the **ATmega328P**. | * It forwards this string via **USART** to the **ATmega328P**. | ||
* The **ATmega328P** interprets the command and activates the motors accordingly (via PWM and digital I/O signals). | * The **ATmega328P** interprets the command and activates the motors accordingly (via PWM and digital I/O signals). | ||
- | == ℹ️ Note == | ||
- | Although HTTP is not the most efficient communication protocol for this use case, it was sufficient for proof of concept and ease of implementation. | + | === 💣 Bomb === |
+ | |||
+ | The **bomb** acts also as a **slave**. | ||
+ | |||
+ | On receiving a command: | ||
+ | * The **ESP8266** extracts the command string. | ||
+ | * It forwards this string via **USART** to the **ATmega328P**. | ||
+ | * The **ATmega328P** interprets the command and activates the bomb. | ||
+ | * The bomb cannot be deactivated for obvious reasons. | ||
+ | |||
+ | |||
+ | |||
===== Rezultate Obţinute ===== | ===== Rezultate Obţinute ===== | ||