Week 2
This week we will begin assembling the circuit, as well as testing the code.
Yiran and Yuhan connected the circuit, based on the schematic that had been produced the week before. Once this had been set up Naomi tested the code with the circuit and debugging any issues that arose. Due to a lack of components in week 1, the code was written blindly so took a little while to check it worked correctly and efficiently. The circuit worked brilliantly and produced exactly what we wanted, meaning that we had completed the first half of the project.
As a team we finally discussed whether to add a Wi-Fi or Bluetooth module. This would allow us to develop an app in order to control the Arduino remotely, with the user being able to adapt the time intervals without touching the code. Ordering a Seeit ESP32-DEV-30P bluetooth module, which allows for a wifi and a bluetooth connection. Following this plan, Naomi began on a graphical user interphase, as seen on the right. The GUI allows the user to personalise their start delay, meaning that the box doesn't open immediately, as well as personalising the time between the lid opening and closing. Naomi not only built the GUI but also built a new code to go with the bluetooth module.Automatic Feeder Code Workflow
1. *Initialization Phase*:
- Set up hardware pins: LED, servo, Bluetooth communication
- Start serial communication and wait for Bluetooth data
2. *Bluetooth Data Reception and Parsing*:
- Receive time data from Bluetooth (delay time, feeding time)
- Convert the received time data (hours, minutes) to milliseconds
3. *Feeding Operation*:
- Delay execution based on the received wait time (delay(Delay))
- Activate the servo to rotate forward (Movement_For()), open the feeder
- Control the servo to rotate for the set feeding time
- Activate the servo to rotate backward (Movement_Back()), close the feeder
4. *Continuous Execution*:
- Continuously check for new Bluetooth data and update control instructions
- Repeat the feeding operation at the specified intervals
The entire process involves waiting for Bluetooth instructions, parsing the time, controlling the servo movements, and indicating the feeding status through the LED.
See you next week,
2P47 :)
Comments
Post a Comment