This shows you the differences between two versions of the page.
pm:prj2025:iivasciuc:bogdan.ciocea [2025/05/18 15:28] bogdan.ciocea [Software Design] |
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 54: | Line 54: | ||
===== Hardware Design ===== | ===== Hardware Design ===== | ||
- | |||
- | <note tip> | ||
- | Aici puneţi tot ce ţine de 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 118: | 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 **client**. It reads user input from buttons or an accelerometer and sends commands to the robot over ESPNOW. | + | 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: | ||
Line 139: | Line 130: | ||
The `LCD shield` is used as a display to show the user which command is transmitted. | 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 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). |
The hand controller also can activate the bomb when the arm is controlling and the **SELECT** button is pressed. | The hand controller also can activate the bomb when the arm is controlling and the **SELECT** button is pressed. | ||
- | == 🤖 Robot == | + | === 🤖 Robot === |
- | The **robot** acts as a **server**, waiting for incoming requests from the hand controller. | + | The **robot** acts as a **slave**, waiting for incoming requests from the hand controller. |
On receiving a command: | On receiving a command: | ||
Line 151: | Line 142: | ||
* 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). | ||
+ | |||
+ | |||
+ | === 💣 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 ===== | ||