Let Raspberry Pi Automate those Snake Eyes

If you are looking for something to bring your cosplay masks, props, or other spooky sculptures to life for your robots, animatronics, or Halloween parties, you can use the snake eyes cowl as a pair of animated eyes. This is an accessory for operating two 128×128 pixel TFT LCD or OLED displays through a single board computer such as the Raspberry Pi (RBPi). It also has four analog sensor inputs.

The project started life as a project named Electronic Animated Eyes using the microcontroller Teensy 3.2. However, the author found the RBPi to be a better alternative as it offers some potential benefits, such as hardware-accelerated graphics, and includes antialiasing. With a faster CPU, dual SPI buses, and ample RAM, the RBPi offers faster frame rates. The RBPi does not require a preprocessing step to decode standard graphics formats such as SVG, PNG, and JPEG. The author has written the eye rendering code in a high-level language, Python, and that makes it easier to customize.

However, using RBPi for this project has some downsides as well. The RBPi usually takes a while to boot an operating system from an SD card. It also needs an explicit shutdown procedure. As the RBPi is large and uses more power, it is not very suitable for wearable applications. Moreover, the use of an SD card makes it less rugged.

The author recommends an RBPi model 2 or 3. Although the code runs fine on an RBPi Zero or another single-core RBPi board the performance will lag greatly. Make sure the RBPi board used for the project has a 40-oin GPIO header.

However, it is not necessary to connect both displays for the project, as a single eye can also produce a very creative effect. The author recommends OLED displays, as they have very wide viewing angle along with excellent contrast and color saturation. However, OLED is more expensive compared to TFT. TFTs are also acceptable as displays, although they may look somewhat washed out for this project. Users may need additional components if they plan on controlling the eyes with a joystick and buttons, and allowing them to react to light, rather than allowing them to run autonomously.

The author uses bonnet boards to wire up the breakout pins on each display board. The user must decide if the installation will be a temporary arrangement or a permanent one. Space for wiring may depend on the housing chosen for the installation, and these may influence the choice of connectors and wiring. Wiring has to be done carefully, following the instructions to avoid disappointment.

Preferably, solder a header at each end, and plug all the wires through. This is easier and less error-prone. Keeping the wiring short and tidy from the bonnet to display, ensures the display gets a clean signal, as electrical interference may lead to glitches in the animation.

Start the project by downloading the latest version of the Raspbian Lite operating system, and transfer it to an SD card of 2 Gb or larger size. Follow instructions here.