Eye of Sauron Guards the Vending Machine

Jeremy S. Cook
2 min readSep 27, 2019

--

PDX Hackerspace in Portland, Oregon acquired a vending machine. As you might expect, members immediately began to hack it, working on a remote monitoring and control system, lights, and even a siren. After considering that the machine should interact with customers in a more interesting way than simply taking money and dispensing the item, Lupo Grigio came up with a device that is able to sense people as they walk by and attempt to make eye contact.

The installation, dubbed “Eye of Sauron,” uses a cheap laptop and a USB webcam, along with OpenCV to detect faces as they pass by. Positional data is then passed to a Raspberry Pi 3B+, which runs an eye simulator based on the animated TFT eye display from Adafruit that you may have seen powering some spooky and/or realistic projects.

Instead of displaying on a small TFT screen, however, they eye here is piped to a comparatively gigantic HDMI display atop the vending machine. The eye formed in the shape of an oval, which certainly helps convey the spooky image from Lord of the Rings, and it’s encased in a nice green translucent enclosure.

Notably, two systems are used since running OpenCV and the eye display portion on the Pi 3B+ proved problematic. One has to wonder if a Pi 4 could handle the whole job, though the way things are coded means that the eye portion itself currently only runs on a ’3. If you’d like to build something similar, or even take on porting it to a ’4, code is available on GitHub.

--

--

Jeremy S. Cook

Engineer, tech writer, content creator, maker of random contraptions for fun and profit.