Did I close the garage door? Let Raspberry Pi check for you
Our resident community engagement guru and all-round Raspberry Pi-powered DIY home hack enthusiast Matt Richardson does not like venturing outside to check whether he remembered to close his garage door. So he cobbled something together from a couple of Raspberry Pi Pico Ws and some sensors to check for him.
No one wants to hang around in the pouring rain waiting to make sure with your own eyes that the garage door has closed. Nor do you want to have to shuffle outside in your pyjamas for peace of mind before you go to bed. Matt’s creation lets you check your garage is secure from the comfort of your own indoors.
How does it work?
Two Raspberry Pi Pico W microcontrollers drive this build. One lives inside the garage and controls the door sensors. The other lives inside the house and indicates what state the garage door is in.
The Pico W inside the garage is connected to two Hall effect sensors attached to different parts of the door opening mechanism. These register whether the door is open or closed.
The Pico W inside the house flashes three separate LEDs based on the signal it receives from the sensors inside the garage. One LED flashes when the door is open, another flashes when the door is in the process of opening or closing, and another when it is fully closed.

Mosquitto, an open source MQTT message broker, runs on the Pico W inside the house. You don’t have to use a Raspberry Pi board for this, but the software is so lightweight it can run on basically anything, even our miniature microcontrollers. No need to worry about a whole computer for this part. You can find installation instructions and links for Mosquitto here. It’s this software that sends messages between the two Pico Ws.

You’ll need something to keep all the hardware in the garage dry. Matt used this fancy weatherproof electrical box, but you could just use some Tupperware.
Disney + Raspberry Pi crossover event
If Matt is the sort of person you’d like to see pop up on your TikTok feed, give him a follow. It’s mainly joyful Disney Parks content but some Raspberry Pi builds (Disney-themed, obv) pop up now and again.
Our favourite Disney/Raspberry Pi mashup TikTok is Matt’s Halloween countdown clock.
18 comments
Jump to the comment form
Anders
I’ve done a similar project, but just used a tilt sensor and attached it to the door. When the door is open it’s off the vertical as it is an up and over.
Robert Alderton
Or, a magnet, reed switch, phone wire,led and battery.
The reality version for living in supply chain problem era
DeeJay
“Mosquitto, an open source MQTT message broker, runs on the Pico W inside the house.”
Is that correct?
The voice-over suggests there is an MQTT Broker running on a classic Raspberry Pi SBC elsewhere in the house.
Perhaps the internal Pico W is running an MQTT Subscriber Client to acquire the data to configure the status LEDS?
Raspberry Pi Staff Matt Richardson
Yep, you’re correct. I have a Raspberry Pi running my VPN server and MQTT broker. The Raspberry Pi Picos are MQTT clients.
Raspberry Pi Staff Ashley Whittaker — post author
I GROSSLY underestimated the number of Pis you have running in your house. I am not surprised.
Dru Nelson
Hi Matt and Pi Team – I would add a gentle suggestion.
You need to add a current limiting resistor to each LED.
Otherwise, you run the risk of burning out your Pico pin or the LED.
Heinz
Very much a newbie, but why are there no resistors in the LED circuit?
Dru Nelson
Hi Heinz, funny. our posts were just minutes apart.
The short answer your question…
Yes, you will need current limiting resistors.
Joel Berger
I built something to monitor/control my garage door and even made a lightning talk about it at a conference https://youtu.be/aJc5yYONBBc
Nicko
For my garage doors I used some cheap ultrasonic range sensors (like the ones used on robot experiments) stuck the the ceiling. The measured range indicates if the door is up the door is down but no car present or the door is down and the car is in.
Bill
Great idea. Especially incorporating vehicle detection. I may borrow it. Details posted anywhere?
bsimmo
Ah in the UK garages are not really for cars, they’re just sheds/store rooms/etc. Few are large enough to fit a car in even on a new build house. Hey most people can’t be bothered to drive the car onto a driveway if they can avoid it.
Dumping cars on the road/pavement/grass verges is the modern way.
;-)
Raspberry Pi Staff Ashley Whittaker — post author
That’s what I said?! (Not here. Somewhere else. Maybe LinkedIn?) Our too-tiny-for-a-car garage has Christmas stuff in and summer furniture we can never be bothered to get out for the one week a year it is useful.
Also – basements – how come the Americans get all the good garages AND basements.
Jed Peterson
American here. We traded access to healthcare for garages and basements. Now our vehicles are too big for the big garages AND we can’t get medicine.
Raspberry Pi Staff Ashley Whittaker — post author
👎 x 1000
Henry
Or you could just buy the Chamberlain MyQ WiFi Garage door controller for $30.
Ben Wing
https://github.com/ben-wing/door_alert
Built this with a magnet, Reed switch, and Pi Zero W, a number of years ago. Still running strong, unless it gets blasted by the snowblower and it shorts the reed.
John D
Please provide the spec for the terminal breakout board?