Tech Thoughts

Cloud-based IoT System for Automatic Pet Feeding

16.04.2022


Wiring schema

This project was developed for the IoT course to solve the problem of feeding a pet automatically or manually from remote locations. The solution is a cloud-based IoT system that gathers data from sensors and interacts with the environment using actuators. The system ensures that the pet is fed on time, whether the user is nearby or far away.


The IoT device is built using RIOT-OS and an STM NUCLEO-f401re board. The system is designed around AWS cloud-based services, integrating both sensors and actuators to control the pet feeding process.

The core components of the system include two sensors and two actuators:


The board communicates with the cloud via MQTT-SN, which ensures low-latency and lightweight communication, ideal for IoT applications. The system's communication is optimized to handle small message sizes. Latency measurements show an average delay of less than 2 seconds for reading the fill level and 1 second for dispensing food. The overall round-trip time from a dispense request to the updated dashboard is less than 7 seconds, which is within acceptable limits for real-time interactivity. Messages are transmitted at small sizes (8 bytes for dispense requests, 3 bytes for sensor readings), minimizing network overhead. MQTT-SN was selected for its small message footprint, making it ideal for IoT environments.


The 'Sense-Think-Act' paradigm is followed in the system’s design:


After dispensing food, the system checks if the container needs refilling by measuring the distance using the ultrasonic sensor. If the container is empty, the LED turns on as a visual alert.


The system integrates with AWS IoTCore for cloud communication. The following services were utilized to ensure smooth operation:

AWS IoTCore ensures seamless communication with the device, while Lambda functions enable efficient, real-time processing.


You can find the complete code for both the RIOT-OS board logic and the cloud infrastructure on GitHub: Pet Feeder Repository. It contains detailed instructions on how to replicate the project, both for the hardware setup (including the sensors, actuators, and board) and for deploying the cloud-based services on AWS.



IoT AWS MQTT RIOT-OS IoTCore DynamoDB Lambda API Gateway Amplify PIRSensor UltrasonicSensor StepperMotor CloudComputing MQTT-SN