Pi-Rex – Bark Activated Door Opening System with Raspberry Pi
(DISCLAIMER: Not meant as a security solution or a lesson in good dog behavior. It’s an experimental proof of concept to play with the application of embedded computing to solve particular use cases)
Sleep deprivation has been driving me mad recently. And it’s all down to a new member of the family (kind of), our new dog. She barks at night when she’s left out. She barks early in the morning when she’s left in. So once I recognized the patterns of her barking, I realized that all I needed was something that would let her out when she needed to go for a pee, usually around 6:30 in the morning. I could do this with a timer switch and a door strike, but where’s the fun in that.
I wanted this to be an educational project, so I decided I’d use the Raspberry Pi again, this time for a non-camera related project. And I decided on a bark activated automatic door opener.
It involves a bark detector (noise detector circuit) wired to the input of the Raspberry Pi so that it can detect the barks. A motor driver circuit to drive the actuator that unlocks the door, and a weight/pulley system that swings the door open when its unlocked.
Here’s the pulley system. As soon as the door is unlocked, the door swings gently open, allowing Rex to go to do their business.
I picked up the audio detection circuit in Maplin as a DIY kit for €9.99, the kind of ones where you get all the components and a PCB in a bag, and solder them all together. It took about 30 minutes, but worked perfectly, I could bark, and the LED’s would light as I barked. My family thought I was gone mad when they heard me making dog noises in my workshop.
Electronics engineers will now cringe at what I did next. I probed the audio sensor with a voltmeter, and saw that when the volume into the microphone was at a decent level I saw about 3-3.5 volts at one point, so I hooked that directly up to the GPIO on the Raspberry Pi, and it worked beautifully. Ideally, a proper buffer circuit would be used to give a proper logic signal to the GPIO, but I’m not always one for the perfect solution, as is obvious by the fact that I built this contraption at all!
Here’s the actuator I used, it’s a 12V model, €3 with €3 shipping from Hong Kong. There’s about 30mm of travel in the actuator, which is ideal for the lock/unlock mechanism that I built.
And here’s what the actuator is driving. I had a few pieces of metal lying around, and an angle bracket which got around the concrete blocks nicely to meet the door lock. I added a couple of bearings to reduce the friction on the mechanism, I didn’t want to burn out the actuator. When it was built, it was still a little stiff, so I greased it up, and it was then moving nice and smoothly.
The actuator came with a metal rod so I used that to connect to the locking system. Notice the small bit of tape to keep it from falling out of it’s hole!
The actuator as two positions, and here it is in the latched position, where it just catches the door bolt.
And when the bark is detected, it moves the lock mechanism to the following position, allowing the door to swing open.
For more detail: Pi-Rex – Bark Activated Door Opening System with Raspberry Pi