In the iconic 1993 film Demolition Man, Sylvester Stallone’s character, a cop from the ’90s, and Wesley Snipes’ character, a crime lord, are transported into the bleak and distant future of 2032. There they find a dystopian nightmare where Taco Bell has won the franchise wars (though Pizza Hut did in international releases), bathrooms are incomprehensible, and you can be ticketed for using curse words. Those tickets are handed out automatically by a machine, and now you can use a Raspberry Pi to build your very own “verbal morality ticketing machine!”
As in the movie, this machine will detct bad language and then print a “morality violation” ticket for it. Ostensibly, you could also use it for practical purposes like stenography, but we think this is more fun. To build it, you’ll just need a Raspberry Pi Zero W, a USB microphone, some sort of audio output, and a thermal printer. The machine built in the guide uses a Pimoroni Speaker pHAT for the audio output to keep things compact, and the thermal receipt printer connects through the Raspberry Pi’s serial port.
Be careful with the thermal printer, because it will draw a lot of current when printing. For that reason, you can’t power it from the Raspberry Pi and will need a separate power supply. After setting up the hardware, you can follow the guide to install Raspbian and the other necessary software. That includes Google’s Cloud API, which is used to detect swear words picked up by the USB microphone. Then just 3D print yourself an enclosure to fit everything, and you’ve got your very own at-home verbal morality ticketing machine that you can use to enforce good etiquette in your home!