A USB food dispenser

A USB food dispenser

Not long ago, someone asked us whether it was possible to automate a dry food dispenser with Yoctopuce modules, the idea being to transform it into a food dispenser for a pet. The answer is obviously yes. There are even several solutions. There is one in particular which is based on a smart use of a Yocto-LatchedRelay which we wanted to show you for a while...

The food dispenser

Dry food dispensers are all more or less based on the same principle: under a container full of food, peanuts, cornflakes, or even rabbit pellets, there is a handle that you only need to turn to obtain a helping.

Can we automate this?
Can we automate this?

What we need to do is to motorize the handle with a small motor. But the real issue is how to control this motor?

The Yocto-LatchedRelay

And here comes the Yocto-LatchedRelay which has two features distinguishing it from other Yoctopuce relays. As its name indicates it, it is latched, but even more importantly, it has an input enabling us to change its state manually.

The Yocto-LatchedRelay and its input to switch its state manually
The Yocto-LatchedRelay and its input to switch its state manually

The idea is therefore to control the motor with the Yocto-LatchedRelay and to connect a micro-switch on this input. Thus, if we drive the micro-switch with a cam on the motor axle, we can not only drive the handle but also control the relay.

We can drive the Yocto-LatchedRelay with a micro-switch and a cam
We can drive the Yocto-LatchedRelay with a micro-switch and a cam

We can then trigger the relay, which turns the motor on. After a full turn, the cam activates the micro-switch, changing the state of the relay and therefore automatically stopping the motor.


We selected a food dispenser which was cheap and easy to modify. There is just enough space in the structure to put the Yocto-LatchedRelay and a small motor. It is driven with a small belt bought in a model shop: 4x4 remote controlled electric cars are almost all driven with a belt. We built the two pulleys and the cam with a 3D printer. We selected the motor with great care: we wanted it to be small, working with 5V, with a ~60rpm speed, and most of all plenty of torque. This forced us to buy in the upscale range.

The driving system...  ... fits in the base
The driving system

The power supply to drive the motor is taken directly from the USB bus: our motor needs only 200mA. Assembly is relatively easy if we ignore the fact that we must respect the right distances for the belt to be tense but not too much so. Here is a short video illustrating how the system works.



The Yocto-LatchedRelay is rather useful to build cheap mechanisms based on a precise control of the number of turns: we managed to motorize a food dispenser quite easily. We'll end with a piece of advice: this automatic food dispenser doesn't necessarily work very well with all types of dry food. If you build one to feed your pet when you are on vacation, we suggest that you test it thoroughly with the food that you intend to use. Otherwise, you risk to find on your return the said pet starved to death in front of a full, but stuck, dispenser.

1 - lukelly Sunday,august 13,2017 18H14

Hi there,

Great job and thanks for sharing :)

I was wondering, could many of these be joined together in a line and progrommed to dispense different ingredients one at a time into a bowl which is running on a conveyor belt?

2 - martinm (Yocto-Team)Monday,august 14,2017 5H18

@lukelly: You could line up as many as you want. Actually the most complicated part would be the conveyor belt. Note, however, that this king of dry food dispenser doesn't work well with any kind of dry food. Cornflakes work fine, but muesli will clog it in no time.

3 - rio Wednesday,october 31,2018 21H57

Would it be possible to do it without a USB and do it with a battery

4 - martinm (Yocto-Team)Thursday,november 01,2018 7H44

@rio. Yes I suppose this could be done without USB, but the whole point of this post is to show how to do it with a Yocto-LatchedRelay, which is an USB device.

5 - rio Thursday,november 01,2018 18H53

Well... I am trying to do this for my junior cert and i wont be able to use a USB would you tell me ,if possible, how to do it using a button.

Thank you

6 - martinm (Yocto-Team)Monday,november 05,2018 7H05

Search Internet for "flip-flop relay".

7 - rio Monday,november 05,2018 11H43


Yoctopuce, get your stuff connected.