Alright, let’s talk about this little project I called the “pie gate”. It wasn’t anything fancy, really just something I cobbled together out in the shed.
Why Bother?
Well, the idea started simple enough. Had this small gate at the back of the garden, mostly to keep the dog in, maybe keep stray cats out. But I kept forgetting to close it properly, or wanted a way to open it without trudging all the way over there, especially when it was raining. Seemed like a job for one of those little Raspberry Pi computers I had lying around collecting dust.
Getting Started – The Messy Part
First thing, I dug out the Pi. Think it was an older Model 3 B, doesn’t really matter which one. Then I needed stuff to actually move the gate. Found an old servo motor in a box of junk – you know, the kind for remote control cars? No idea if it was strong enough, but hey, it was free.
Gathered up some other bits and pieces:
- Some jumper wires
- A breadboard for testing (always messy)
- A power supply for the Pi and another for the motor (learned that the hard way later)
- Scrap wood and metal bits to attach the motor to the gate and post.
Honestly, finding all the parts took longer than I thought. My shed’s not exactly organized.
Putting it Together
Okay, so I started hooking things up. Plugged the servo into the Pi’s GPIO pins. Wrote a super basic Python script. Like, really basic. Just something to tell the servo to turn left, then turn right. Ran the script. Nothing. Checked the wiring. Still nothing. Realized the Pi couldn’t power the motor directly. Duh. Had to find a separate power brick for the motor and figure out how to switch it using the Pi without frying the Pi. That took some fiddling and a cheap relay module I thankfully had.

Next, the physical part. Attaching the motor to the flimsy garden gate. This was… frustrating. Lots of drilling holes, finding bolts that fit, bits of wood acting as spacers. It looked pretty terrible, not gonna lie. A real Frankenstein setup. The servo wasn’t quite strong enough either, you could see it straining.
Then I tried to make it a bit smarter. Added a simple magnetic switch sensor to tell if the gate was actually closed. More wires, more code. Trying to get the Pi to read the sensor reliably was annoying. Sometimes it worked, sometimes it didn’t, especially when things got damp outside.
Did it Work? Sort Of…
After a weekend of tinkering, swearing, and drinking too much coffee, I had something that resembled a working gate opener. From my phone (just using SSH to run the script, nothing fancy), I could trigger the motor. It would groan and slowly swing the gate open or closed. Most of the time.
The magnetic sensor was still hit-or-miss. And if it was windy, the little motor really struggled. It definitely wasn’t a commercial product, that’s for sure. It was more of a proof-of-concept built with junk drawer parts.
Final Thoughts
So yeah, the “pie gate”. It does technically work. It opens and closes the gate via a computer command. Was it worth the hassle? Maybe. It was a fun little challenge, kept me busy. But it’s ugly as sin and probably won’t last through a harsh winter. Still, I built it, figured stuff out along the way. That’s usually the point for me anyway.
