This shows you the differences between two versions of the page.
pm:prj2022:apredescu:automatedparking [2022/05/26 12:55] mathis.vaugeois [Software Design] |
pm:prj2022:apredescu:automatedparking [2022/05/27 10:06] (current) mathis.vaugeois [Hardware Design] |
||
---|---|---|---|
Line 10: | Line 10: | ||
Block Diagram of the project : | Block Diagram of the project : | ||
- | {{ :pm:prj2022:apredescu:block_diagram_automated_parking_v2.png |}} | + | {{ :pm:prj2022:apredescu:block_diagram_automated_parking.jpg?500 |}} |
===== Hardware Design ===== | ===== Hardware Design ===== | ||
<note tip>To create this project, i used an Arduino Uno R3, 5 HC-SR04 Ultrasonic Sensors, 2 SG90 Micro Servo Motors, a 1602 LCD with I2C Interface, 4 Infrared Obstacle Sensors and wires </note> | <note tip>To create this project, i used an Arduino Uno R3, 5 HC-SR04 Ultrasonic Sensors, 2 SG90 Micro Servo Motors, a 1602 LCD with I2C Interface, 4 Infrared Obstacle Sensors and wires </note> | ||
- | {{ :pm:prj2022:apredescu:scheme_electric_parking.png?600 |}} | + | {{ :pm:prj2022:apredescu:scheme_electric_parking.jpg?600 |}} |
- | {{ :pm:prj2022:apredescu:diagram_eletric_parking.png?600 |}} | + | {{ :pm:prj2022:apredescu:diagram_eletric_parking.jpg?600 |}} |
===== Software Design ===== | ===== Software Design ===== | ||
Line 28: | Line 27: | ||
To ease the connection of the arduino, i'm defining each pin for their use : all the pin between 2 and 9 are use by the Ultrasonic sensor and those between 11 and 14 are for IR sensor. For the LCD screen, it need to be connected on SDA and SCL on the pin A4 and A5 while i define A2 and A3 for the entry and exit servo. | To ease the connection of the arduino, i'm defining each pin for their use : all the pin between 2 and 9 are use by the Ultrasonic sensor and those between 11 and 14 are for IR sensor. For the LCD screen, it need to be connected on SDA and SCL on the pin A4 and A5 while i define A2 and A3 for the entry and exit servo. | ||
- | Then comes the setup, i define the bau (Serial.begin(9600);) and initialise the LCD screen, i add a backlight to it to ease the reading on it. For the IR sensor, i place the pin in Input mode to recieve the data. And for the servo, i use the .attach() methods to create the variable Entrance_servo and Exit_servo with the pin, the minimum and maximum as parameters. | + | Then comes the setup where i define the data rate. |
+ | <note>Serial.begin(9600);</note> | ||
+ | I initialise the LCD screen, i add a backlight to it to ease the reading on it. For the IR sensor, i place the pin in Input mode to recieve the data. And for the servo, i use the .attach() methods to create the variable Entrance_servo and Exit_servo with the pin, the minimum and maximum as parameters. | ||
+ | |||
+ | <note>Entrance_servo.attach(EntryServo, 1000, 2000);</note> | ||
+ | |||
+ | For the loop, i just called function i created to split the diffrent part of the project. | ||
+ | We can find UltrasonicDistance that recuperate the distance for the sensors. | ||
+ | <note>void UltrasonicDistance()</note> | ||
+ | PlaceUpdate that compare the distance with the integer cm to see if a place is taken. | ||
+ | <note>void PlaceUpdate()</note> | ||
+ | LCDUpdate that do as it said (it update the screen). | ||
+ | <note>void LCDUpdate()</note> | ||
+ | IRUpdate that check the Ir sensor and store their state. | ||
+ | <note>void IRUpdate()</note> | ||
+ | DoorEntryCheck and DoorExitCheck that move the servo based on the state of infrared sensor. | ||
+ | <note> | ||
+ | void DoorEntryCheck() | ||
- | For the loop, i just called function i created to split the diffrent part of the project. We can find UltrasonicDistance that recuperate the distance for the sensors, PlaceUpdate that compare the distance with the integer cm to see if a place is taken, LCDUpdate that do as it said (it update the screen), DoorEntryCheck and DoorExitCheck that check the IR sensor and move the servo based on that. | + | void DoorExitCheck() |
+ | </note> | ||