You can make a treat dispenser for your pet out of some fairly basic ingredients, the main ingredients being cardboard and a solenoid. It's pretty fun, and after you're done you can say “I made a robot to feed my precious <insert pet's name>, what did you do today?”
Here's what you will need:
* Some corrugated cardboard – it can be used/recycled * Sharp X-acto knife * White glue * 12V solenoid (like this one) * A jar * Some patch wire * Some treats
We'll start by making a box. We're making a gravity-fed treat dispenser, so we need a fair amount of height to keep things moving along and not get clogged. Our box is 7“x7” on the base and 8“ high.
Cut out five 8”x7“ rectangles. We'll use four of the rectangles for the sides of the box. Save the extra for later.
Then cut out the top. It will be 7 1/8”x7“. The extra 1/8” is there to accommodate the thickness of the cardboard.
Trace the top of the jar on the top piece of cardboard and cut it out.
Now glue your box together. We found that using something to dab it on the edge of cardboard was helpful. Hold the pieces in place until they hold themselves. You'll be surprised how fast this goes, but be sure not to overdo the amount of glue.
When you're done, you'll have a box that looks like this. It's surprisingly sturdy!
OK, next, we need to assemble the funnel and funnel/valve assembly. This will go on the extra 8“x7” piece of cardboard. Draw a line at 4“ on the piece of cardboard. This is where the funnel will stop.
Next, cut out your funnel pieces. The funnel needs to be large enough at the top to fit the bottle opening and small enough at the bottom to work with the “throw” of the solenoid (how far the solenoid moves when powered), which is about 0.4”. In general, making the opening at the bottom about 50% larger than the solenoid throw is a good rule of thumb. You want to make your treat dispenser clog-resistant, which requires a bigger hole – err on the side of bigger for the bottom opening.
The solenoid will be our valve, and we want to attach a piece of cardboard to it – the “shutter”. The shutter should be bigger than the opening of the funnel to keep if from getting stuck. We extended the solenoid shaft with a straw and used some tape to attach the shutter to the straw (see below).
Next, add a structural member below the shutter to keep the shutter oriented correctly.
This structural member will require some extra gussets to strengthen it.
Next attach the solenoid to the cardboard using some machine screws, cable ties, or some double-sided foam tape. Test the motion of the solenoid and shutter by hand.
We now need to assemble a chute. Cut a 4“x10” piece of cardboard. Then cut the cardboard down the middle length-wise, but only cut through the first ply of cardboard.
Fold the cardboard into a right-angle and glue a right triangle with 2“ legs to the end. Let this dry.
The funnel/valve assembly fits into a “track” in the box. Slide the funnel/valve assembly in the box and mark where you want to place the track.
Cut out some strips of cardboard and glue them to the inside of the box to make the track for the valve assembly.
Next, cut a triangle to fit the chute in the funnel/valve assembly.
And cut a corresponding triangle on the box. You want the chute to have a decent amount of slope so that the treats will move down the chute via gravity. The triangle hole in the box should be lower than the triangle hole in the funnel/valve assembly so that this slope is created. Cut the triangle in the box with this slope in mind.
Treats can have oils that can leach into the cardboard. To prevent this, use some clear coat, or possibly paint to seal the cardboard. Only the funnel and the chute need to be protected.
Putting everything together is relatively easy. Slide the funnel/valve assembly into the box with the chute inserted and then push the chute through the triangle hole in the box before completely sliding the funnel/valve assembly into the box.
You can use some wire nuts to attach an extension cord to the solenoid, or just twist the wires together and use some tape to keep them from shorting together. The polarity doesn't matter.
Then attach the extension cord to pins 2 and 4 on Vizy's terminal block.
And don't forget to plug the terminal block into Vizy.
Test the treat dispenser with the Pet Companion application by clicking on
Or you can punch in some simple lines of Python. Just type into a Python instance (you can bring up a Python instance by pointing your browser to
import vizy power = vizy.VizyPowerBoard() power.vcc12(1) power.io_set_mode(vizy.IO_MODE_HIGH_CURRENT)
You can then trigger the solenoid (open shutter) with:
and turn off (close shutter) with:
Note, don't leave the solenoid on too long as it will get pretty hot. In general, you won't need to power the solenoid very long – less than a second at a time.
Congratulations, you've built a treat dispenser for your pet!