Week 1
The first lab session for our project, we begun by delegating jobs within the team;
Naomi - Code
Yuhan & Yiran - Circuit & circuit design
Yiran - Poster
Elys - Physical Design, blog and report.
The code will be written within the Arduino Cloud and in a variant of C++. On a basic level, the code is written so that the LED lights up when the lid moves, and when stationary the LED will be off, providing visual feedback on feeding activity, however there is a delay between the LED turning on/off and any motor movement.
Code Workflow1. Initialisation at Startup
- Sets the LED pin as an output.
- Attaches the servo motor to pin 12.
2. Main Loop (loop)
- The servo motor rotates forward (0° → 180°), and the LED turns on.
- The rotation lasts approximately 6.3 seconds (180 steps × 35ms per step).
- Waits 15 seconds before the next movement.
- The servo motor rotates back (180° → 0°), and the LED turns on again.
- The rotation lasts another 6.3 seconds.
- Waits another 15 seconds before repeating the cycle.
The motor rotates a specific distance that is previously set within the code, this is to ensure that the motor operates consistently. This was tailored to the specific device however once set it doesn't need to be changed. The motors default position is when the lid is closed.
The circuit schematic below shows how we will connect the components in order for them to behave in the way we want so that the brief can be carried out. The circuit includes the Arduino, LED, motor and buzzer.
Comments
Post a Comment