Animated Snake Eyes Bonnet for Raspberry Pi
Created by Phillip Burgess
Last updated on 2018-09-26 04:27:26 AM UTC
Guide Contents
Guide Contents
Overview
Hardware Assembly
Compatible Devices
2
3
5
5
Plan a Head
Software Installation
Pi-Eyes Software Options
Customizing the Hardware
Analog Controls
Buttons
Software Changes
Customizing the Look
Changing the Python Code
Changing Graphics
Replacing Everything
Using Just the Software
Downloads
Files
Schematic
Fab Print
5
10
11
14
14
15
16
17
17
17
20
22
25
25
25
25
© Adafruit Industries
https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi
Page 2 of 25
Overview
The
Snake Eyes Bonnet
is a Raspberry Pi accessory for driving two 128x128 pixel OLED
or
TFT LCD displays, and also
provides four analog inputs for sensors.
It's perfect for making cosplay masks, props, spooky sculptures for halloween, animatronics, robots...anything where
you want to add a pair of animated eyes!
© Adafruit Industries
https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi
Page 3 of 25
It’s a follow-on of sorts to another project:
Electronic Animated Eyes Using Teensy 3.2
(https://adafru.it/j6D).
The
Teensy 3.2 is a
very
capable microcontroller, and the code for that project squeezed every bit of space and
performance from it. I had been experimenting with the Raspberry Pi as an alternative…while it’s still very experimental,
why not make that work available to others?
The Raspberry Pi offers some potential benefits:
Hardware-accelerated 3D graphics (OpenGL), including antialiasing.
A faster CPU, ample RAM and dual SPI buses could yield faster frame rates.
Standard graphics formats like JPEG, PNG and SVG can be decoded on the fly; no preprocessing step.
The eye rendering code is written in a high-level language — Python — making it easier to customize.
And some possible downsides to the Pi:
Raspberry Pi takes time to boot an operating system off an SD card, whereas Teensy is instant-on with all code in
flash memory, . The Pi also requires an explicit shutoff procedure (usually
(https://adafru.it/AJr)).
The Raspberry Pi is not as suitable for wearable applications…it’s larger, uses more power, and the SD card
makes it less rugged.
This is a somewhat technical and not-inexpensive project. Please read through everything first before commiting. If it
seems daunting, the original
Teensy Eyes
(https://adafru.it/j6D)
are more “Arduino-like” to build and customize, or
other guides like
Animating Multiple LED Backpacks
(https://adafru.it/iwB)
provide a more approachable introduction to
code and electronics with less of an investment.
A Raspberry Pi 3 or Pi 2 is highly recommended. The code
will
run on a Pi Zero or other single-core Raspberry Pi
boards, but performance lags greatly.
© Adafruit Industries
https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi
Page 4 of 25
Hardware Assembly
Don't forget, our Bonnet only comes with the PCB that lets you connect two displays. The two displays are
not included and must be purchased separately!
Some situations don’t require the screens or Bonnet at all! See the “Using Just the Software” page if
planning a single, non-interactive HDMI eye.
Compatible Devices
The code for this project works only with our
128x128 pixel OLED
(https://adafru.it/fXP)
and
TFT
(https://adafru.it/dXl)
displays and
240x240 pixel IPS TFT
(https://adafru.it/BhX)
displays. Other displays
such as our 160x128 TFT or various PiTFT displays ARE NOT SUPPORTED AT ALL, period, not even sorta.
Any recent Raspberry Pi board with the 40-pin GPIO header should work. The very earliest Pi boards — Model A
and B, with the 26-pin GPIO header — are not compatible.
A Raspberry Pi 3 or Pi 2 is highly recommended. The code
will
run on a Pi Zero or other single-core Raspberry
Pi boards, but performance lags greatly. We’re gradually working to improve performance on these boards.
Plan a Head
Before committing to any particular hardware, think your project through. There are some decisions to be made…
One display or two? You don’t
have
to connect two displays…some of the most creative variants of the “Teensy
eyes”
had only a
single
eye
(https://adafru.it/taM).
OLED
(https://adafru.it/fXP),
TFT LCD
(https://adafru.it/dXl)
or
IPS TFT
(https://adafru.it/BhX)
displays? OLEDs
have a wide viewing angle and excellent contrast and color saturation, but they’re somewhat pricey. TFTs make
good economy displays if you’re okay with the slightly washed-out appearance. IPS TFT displays are in-between
in cost and
super
sharp!
What model of Raspberry Pi to drive it? The latest multi-core boards (like the Pi 3) have ample performance for
smooth animation…but their size and power draw might make them best for stationary displays, like maybe a
Halloween window prop. Costume and portable installations may fare better with the diminutive Pi Zero, though
the animation will be much less smooth.
Will the animation be running autonomously, or do you plan to control the eyes with a joystick and buttons? Will
the pupils react to light? These require additional components.
There’s one more factor to consider: how do you want everything connected? Think about your intended installation.
Is it temporary or permanent? Is space at a premium or do you have ample working room? These can influence your
choice of wiring and connectors.
The breakout pins along the edge of each display board are wired up to matching pins on the bonnet boards. But you
need the
correct
row for each display type…
© Adafruit Industries
https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi
Page 5 of 25