Project Overview
"Pavlov-Feeder" is more than a simple automated cat feeder; it is a full-stack IoT Behavioral Analysis Platform. By leveraging the Arduino MKR1000 and its advanced networking capabilities, the project explores the "Classical Conditioning" theory of Ivan Pavlov. The system combines remote control via Telegram Chat-Bots with localized behavioral sensing (phototransistors) to automate pet training, while hosting a dedicated web server to visualize the training's statistical success rate.
Technical Deep-Dive
- IoT Bot-API Forensics (Telegram):
- Custom Keyboard HMI: The project utilizes the
TelegramKeyboardclass to replace standard text input with a specialized emoji-driven interface. Emojis are transmitted via Unicode (UTF-16), allowing for a rich, platform-independent UI that controls hardware status (MusicAndFoodvsMusicNoFood) with zero latency over a secure WiFiSSLClient. - Secure Telemetry Bridge: By utilizing the WiFi101 library and SSL encryption, the MKR1000 maintains a secure connection to the Telegram servers, acting as a bidirectional gateway between the physical world and the digital cloud.
- Custom Keyboard HMI: The project utilizes the
- Embedded Web Server & AP Mode:
- Access Point Forensics: The MKR1000 can operate in AP Mode, hosting its own localized network SSID. When "Server Mode" is toggled from Telegram, the board serves a dynamically generated HTML/CSS table.
- Data Serialization: Successful cat detection events are serialized into a string buffer and injected into the HTML stream. This allows the user to view a "Conditioning Log" directly in their browser without an external database.
- Behavioral Sensing & Logic:
- Phototransistor Thresholding: The presence of a subject (cat) is detected by monitoring an analog voltage drop across a Phototransistor via pin A6. A threshold logic distinguishes between ambient lighting changes and the physical blockage caused by the cat approaching the food bowl.
- Non-Blocking Timers (Millis): To ensure the MKR1000 remains responsive to Telegram pings while waiting for the cat, the project avoids
delay()functions. Instead, it usesmillis()to create a 120-second "Detection Window" immediately followed by a conditioning melody.
Engineering & Implementation
- Deterministic Servo Actuation:
- The food portion size is controlled by a variable-delay servo sweep. By varying the
PortionAmountinteger from the Telegram UI, the developer can precisely calibrate the "Open Duty Cycle" of the dispenser to accommodate different kibble sizes.
- The food portion size is controlled by a variable-delay servo sweep. By varying the
- Acoustic Frequency Conditioning:
- The buzzer uses the
tone()function to play specific MIDI-frequency arrangements. By associating a high-frequency melody with food and a low-frequency melody with "No Food," the system reinforces auditory conditioning.
- The buzzer uses the
- Power Rail Forensics:
- The MKR1000 requires a stable 3.3V logic rail, but the servo motor can draw significantly more current. The project highlights the necessity of external power management (like the MKR IoT Bundle's battery port) to prevent MCU brown-outs during high-torque dispensing events.
Conclusion
Pavlov-Feeder is a masterclass in modern Human-Appliance Interaction. By mastering the integration of Emoji-based UI, Embedded Web Servers, and Behavioral Logic, developers can build intelligent IoT systems that bridge the gap between biological behavior and digital automation.