Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2025:vstoica:nicusor.zaharia0308 [2025/05/30 08:25]
nicusor.zaharia0308 [Decision Making]
pm:prj2025:vstoica:nicusor.zaharia0308 [2025/05/30 09:53] (current)
nicusor.zaharia0308 [Conclusions and Concepts]
Line 17: Line 17:
  
 The schematic contains 5 main systems. The schematic contains 5 main systems.
-The first one represents the board used: An **Arduino Mega with an ATMega2560**. This is the µC used to control the tracking system.+    * The first one represents the board used: An **Arduino Mega with an ATMega2560**. This is the µC used to control the tracking system.
  
-The next system is **Direction & Speed Control System**. This is used for controlling the direction and speed of the train. A L298N Dual H-Bridge Motor Driver connected to a power supply represents the interface between the ATMega2560 and the railway.+    * The next system is **Direction & Speed Control System**. This is used for controlling the direction and speed of the train. A L298N Dual H-Bridge Motor Driver connected to a power supply represents the interface between the ATMega2560 and the railway.
  
-Following, we have **Position Control System** - a set of sensors to detect the position of train on the track. This way, the train can stop, change direction and speed.+    * Following, we have **Position Control System** - a set of sensors to detect the position of train on the track. This way, the train can stop, change direction and speed.
  
-Besides these a **Track Switch System** that uses 4 relays controlled by 4 pins is used to change the direction of the track. To simulate more trains, a **RFID reader RC522** detects various tags and commands the rail switch accordingly.+    * Besides these a **Track Switch System** that uses 4 relays controlled by 4 pins is used to change the direction of the track. To simulate more trains, a **RFID reader RC522** detects various tags and commands the rail switch accordingly.
  
-The last but not least, is the **Arduino Uno with the Braccio shield**. This helps to simulate the idea of "more trains"​ because it changes RFID tags that help the ATMega2560 with the RFID scanner to make a decision to change the direction of the rail.+    * The last but not least, is the **Arduino Uno with the Braccio shield**. This helps to simulate the idea of "more trains"​ because it changes RFID tags that help the ATMega2560 with the RFID scanner to make a decision to change the direction of the rail.
  
-A sheet with components, datasheets and link to buy can be found here:​{{:​pm:​prj2025:​vstoica:​nicusor.zaharia0308:​components.xlsx|}}+    * A sheet with components, datasheets and link to buy can be found here:​{{:​pm:​prj2025:​vstoica:​nicusor.zaharia0308:​components.xlsx|}} 
 +    * An image with the most important components:​ 
 +{{:​pm:​prj2025:​vstoica:​nicusor.zaharia0308:​componente.jpeg?​600|}}
  
 ===== Hardware Description ===== ===== Hardware Description =====
  
-I'll start with the ATMega2560. Pins D2(PE4), D3(PE5), D4(PG5), D5(PE3) are outputs for the 4-channel relay module. This system helps changing the direction of the track in one of the three directions, using 2 [[https://​trennet.ro/​produs/​actionare-macaz-sine-piko-55271-ho/​|switch machines]] that have 2 states. Those are powered by a 14V, 1.1A power supply.+    * I'll start with the ATMega2560. Pins D2(PE4), D3(PE5), D4(PG5), D5(PE3) are outputs for the 4-channel relay module. This system helps changing the direction of the track in one of the three directions, using 2 [[https://​trennet.ro/​produs/​actionare-macaz-sine-piko-55271-ho/​|switch machines]] that have 2 states. Those are powered by a 14V, 1.1A power supply.
  
-Next pins used are D6(PH3), D7(PH4) for the **ultrasonic sensor** placed at one of the extremities.+    * Next pins used are D6(PH3), D7(PH4) for the **ultrasonic sensor** placed at one of the extremities.
  
-The pins that are used for the direction and speed of the train are D42(PL7), D43(PL6), D44(PL5). PL5 allows **PWM** so it is perfect for speed modulation. Those are connected to the **l298n motor driver**+    * The pins that are used for the direction and speed of the train are D42(PL7), D43(PL6), D44(PL5). PL5 allows **PWM** so it is perfect for speed modulation. Those are connected to the **l298n motor driver**
 alongside a power supply of 12V, 0.5A DC. alongside a power supply of 12V, 0.5A DC.
  
-Pins from D49 to D53 are used for the **MFRC522** scanner. It communicates with it using **SPI**.+    * Pins from D49 to D53 are used for the **MFRC522** scanner. It communicates with it using **SPI**.
  
-For the other extremity of the railway is placed a simple **Infra Red Sensor** that detects when the train reaches a certain position+    * For the other extremity of the railway is placed a simple **Infra Red Sensor** that detects when the train reaches a certain position.
- +
-Here **Braccio**,​ a robotic arm made from 6 servomotors replaces the RFID tags. This is controlled through a **shield placed on Arduino Uno (ATMega328p)**. The communication between the 2 μC is facilitated by **I2C/​TWI**. The pins used on the ATMega2560 are PD0 and PD1 and for the ATMega328p PC4 and PC5. Arduino Uno controls Braccio using 6 PWM signals for the 6 servos, PD3, PD5, PD6, PB1, PB2, PB3.+
  
 +    * Here **Braccio**,​ a robotic arm made from 6 servomotors replaces the RFID tags. This is controlled through a **shield placed on Arduino Uno (ATMega328p)**. The communication between the 2 μC is facilitated by **I2C/​TWI**. The pins used on the ATMega2560 are PD0 and PD1 and for the ATMega328p PC4 and PC5. Arduino Uno controls Braccio using 6 PWM signals for the 6 servos, PD3, PD5, PD6, PB1, PB2, PB3.
 +{{:​pm:​prj2025:​vstoica:​nicusor.zaharia0308:​pregatire.jpeg?​600|}}
  
 ===== Decision Making ===== ===== Decision Making =====
Line 52: Line 54:
 ===== Software Design ===== ===== Software Design =====
  
 +The full code can be found on [[https://​github.com/​NickZaharia308/​Train-Control-System/​tree/​main/​Code|GitHub]]
  
-<note tip> +Libraries used in the project
-Descrierea codului aplicaţiei (firmware)+    **MFRC522**:​ Used to interface with the RFID sensorIt reads RFID cards to determine which train rail to switch toensuring the train is directed onto the correct track. 
-  mediu de dezvoltare (if any) (e.g. AVR StudioCodeVisionAVR) +    **SPI**: Required by the RFID reader, as it uses SPI for communication with the microcontroller
-  librării şi surse 3rd-party (e.g. Procyon AVRlib) +    * **Wire**: Used for I2C communication to control the Braccio robotic arm from the Master device. When the train arrives at the station, the Master sends a signal via I2C, triggering Braccio to pick up the old RFID card and replace it with a new one. (The Arduino Mega is the Master and the Uno is the slave). 
-  algoritmi şi structuri pe care plănuiţi să le implementaţi +    * **Braccio**A library used to simplify control of the Braccio robotic arm’s six servo motorsallowing for easier/​safer coordination of complex movements. 
-  ​* (etapa 3surse şi funcţii implementate +    * **Servo**: dependency required by the Braccio library to control individual servo motors.
-</​note>​ +
- +
-===== Rezultate Obţinute ===== +
- +
-<note tip> +
-Care au fost rezultatele obţinute în urma realizării proiectului vostru+
-</​note>​ +
- +
-===== Concluzii ===== +
- +
-===== Download ===== +
- +
-<note warning>​ +
-O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectuluisursescheme, etcUn fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-).+
  
-Fişierele se încarcă pe wiki folosind facilitatea **Add Images or other files**Namespace-ul în care se încarcă fişierele este de tipul **:pm:​prj20??:​c?​** sau **:​pm:​prj20??:​c?:​nume_student** (dacă este cazul). **Exemplu:** Dumitru Alin331CC -> **:​pm:​prj2009:​cc:​dumitru_alin**. +The trains keeps going until a sensor halts it's movementIts motion is controlled based on feedback from two sensors: 
-</​note>​+    ​An infrared sensor positioned at the starting point. 
 +    ​An ultrasonic sensor placed at the end of the track. 
 +When the train reaches the end and is detected by the ultrasonic sensor, it automatically reverses direction and moves backward. 
 +If the infrared sensor at the starting point detects the train’s return, the train stops and waits for further action. 
 +At this point, the Braccio robotic arm is triggered via I2C communication ​(with the Arduino Mega acting as the master and the Uno as the slave). Braccio then performs the following sequence: 
 +    ​Picks up the old RFID card from the cargo bay. 
 +    ​Replaces it with a new RFID card. 
 +The new RFID card is then scanned by the RFID sensorwhich determines the appropriate track the train should take next based on the card’s data.
  
-===== Jurnal =====+Bugs and difficulties encountered along the way of building such a challenging project: 
 +    * The RFID module can sometimes behave unreliably. Issues observed include intermittent failures to detect cards, entering an unresponsive or sleep state, and inconsistent readings 
 +    * Infrared Sensor: readings can be affected by ambient light in the environment. In darker conditions, the sensor tends to return lower values due to reduced infrared interference,​ while bright lighting or direct sunlight can cause higher or unstable readings. Also depending on the material properties, the sensor will give higher or lower values. 
 +    * Electrical Instability:​ due to imperfect connections,​ excessive voltage, or high current on the breadboard, one of the track switches overheated to the point where it physically melted. This highlights the importance of ensuring secure, low-resistance connections and staying within the rated voltage and current limits for all components. Breadboards,​ in particular, are not designed to handle high current and can become unreliable or even dangerous under such conditions. 
 +    * Cable management: having long tracks of wires and a big board it is difficult to have a great cable management especially that some components (like MFRC522) have pins instead of holes.
  
-<note tip> 
-Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului. 
-</​note>​ 
  
-===== Bibliografie/​Resurse ​=====+===== Youtube videos ​=====
  
-<​note>​ +Two videos can be found [[https://​youtu.be/​Cf_taeLb9fo|here]] and [[https://​youtube.com/​shorts/​iZsClUN0Juc?​feature=share|here]]. The first one describes the components and the interaction between them and the second one describes how does the whole project work. 
-Listă cu documentedatasheet-uriresurse Internet folositeeventual grupate pe **Resurse Software** şi **Resurse Hardware**. +===== Conclusions and Concepts ===== 
-</​note>​+    * **GPIOsInterruptsPWMADC, SPI, I2C** directly used in the project through microcontrollers. 
 +    ​* **UART, Multimeter, Oscilloscope,​ Soldering and other instruments** used for testing, debugging
 +.
  
-<​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​ 
  
pm/prj2025/vstoica/nicusor.zaharia0308.1748582710.txt.gz · Last modified: 2025/05/30 08:25 by nicusor.zaharia0308
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0