Maker Alvaro Viebrantz has created a neat little project in this candy dispenser which plays more like a game: it asks you to show it pictures, and rewards you with candy if you do.

Inside this build you’ll find a Raspberry Pi 3B running the Android Things dev preview. It’s connected to a camera, an arcade button and a small display.

The system is programmed to request an image (usually of an animal) which needs to be shown to the camera. Press the button, a snap is taken and then checked using Google’s Cloud Vision API. If it’s the right image, the dispenser will release some candy.

While this may seem like a strange project to make, it’s more of a demonstration of Android Things and a teaching tool for those looking to learn how to use it, than a candy-dispensing machine intended for everyday use.

It also works as a cool little game that we’re sure kids will be interested in, even if they’re being suckered into learning with M&M’s.

If you’d like to replicate this project or dig deeper into how it was made, check out its Instructables page which has everything you need, including wiring diagrams and the code.