Pet Feeder — Distance-Triggered Servo
When the pet is near, drop food
Ultrasonic
Servo
Automation
Project
What you will learn
- How to sequence actions: detect → smoothly-sweep-open → hold → smoothly-sweep-closed
- How to step a servo 1° at a time with delay() to make motion visible (not snap)
- How to debounce an ultrasonic reading with a cooldown so the feeder doesn't dump food repeatedly
What you will need
| Component |
|---|
| 1× Arduino Uno |
| 1× HC-SR04 |
| 1× servo motor (SG90) |
| 1× 220Ω resistor |
| 1× green LED |
| Breadboard |
| 6× jumper wires |
Step by step
Take it further
- Add a DHT11 — only feed when the room is a comfortable temperature (e.g. not too cold).
- Add a button — press to manually dispense one portion.
- Log each feed event with a timestamp to the Serial Monitor (so you can review when the pet was fed).
Practise it before you build it
Wire this circuit in the ThinkEdge Learn simulator first. The simulator runs a real Arduino sketch against a modified-nodal-analysis solver, so the LED on screen actually lights when the current is right — no hardware, no burnt components, and a class can try it in a browser.
Related projects
Smart Fan — Temperature + DistanceOnly blows when it is hot AND someone is within 100 cm
Bionic Hand PrototypeA cardboard hand controlled by fishing line — anatomy meets engineering
Servo — Knob to AngleTwist to point
Arduino — Ultrasonic Radar ScannerA servo sweeps the ultrasonic sensor to scan the room
Police SirenAlternating red + blue LEDs with a wailing 600–1500 Hz buzzer
LDR — Light-Following Robot (Solar Tracker)It always faces the brightest spot
Guides that use this project
2 guides on the site build this project as part of a longer explanation. The guide says why the circuit works; this page says how to wire it.
Physical AI: Intelligence That Has to ActPhysical AI is intelligence that drives a motor, not a cursor. Here is how models, controllers and feedback split up, and how to build the loop safely.
Drone DeliveryHow drone delivery works in practice: the range limits, the landing and drop mechanisms, the regulatory hurdles, and why most deliveries use a van for the last mile.
Where this project sits
It is also part of these lists, which is how a class usually finds it.
Arduino LED projects for beginners36 projects in this list
Arduino servo motor projects for students12 projects in this list
Arduino ultrasonic distance sensor projects10 projects in this list
Try the full simulator with your class
103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. One licence covers a whole school.