Adafruit Animated Snake Eyes Bonnet User Manual

Animated Snake Eyes Bonnet for Raspberry Pi
Created by Phillip Burgess
Last updated on 2021-02-09 11:20:59 AM EST
2 3 5
5
5 10 11 12 14 14 15 15 16 17 18 18 18 21 23 25 25 25 25
Guide Contents
Compatible Devices
Plan a Head Software Installation Pi-Eyes Software Options Dry Run Raspberry Pi 4 (Experimental) Things to Know First 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
© Adafruit Industries https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi Page 2 of 26
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!
PLEASE NOTE: the steps in this page currently DOES NOT WORK on the new Raspberry Pi 4 due to
lots of changes in the graphics subsystem. We have a work-around toward this, discussed on
https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi/raspberry-pi-4-experimental
© Adafruit Industries https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi Page 3 of 26
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 26
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, and have a finite lifespan (albeit
many thousands
of hours). 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 26
If using OLED display(s): use the “upper” rows (with the word
“OLED” between them).
There are 11 pins on the OLED breakout boards, which map
directly to the 11 pins on the bonnet board.
Make absolutely certain the wires are in the same order. “SI”
and “G” on the display board should go to “SI” and “G” on the
bonnet, and each pin in-between…no wires should cross.
© Adafruit Industries https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi Page 6 of 26
If using TFT or IPS display(s): use the “lower” rows (with the
word “TFT” between them).
There are 11 pins on the TFT breakout boards, which map
directly to the 11 pins on the bonnet board.
Make absolutely certain the wires are in the same
order. “Vin” and “Lite” on the display board should go to “Vin”
and “Lite” on the bonnet, and each pin in-between…no wires
should cross.
The 1.54" TFT has a 12th pin labeled "TE". DO NOT CONNECT THAT PIN TO THE BONNET. Only
connect the other 11 pins from "Vin" through "Lite"
There’s a common trope in science fiction stories: that there is no “up” or “down” in space. Wiring these
displays is a little like that…it doesn’t matter if the wires or headers come out the
front
or
back
of the
display breakout board, use
straight
or
right-angle
pins…as long as those wires get from the display to the
bonnet in the same positions and order , everything’s good.
(As for up and down: right now the software assumes the displays are oriented with the breakout pins
along the top edge; other rotations are not currently handled.)
© Adafruit Industries https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi Page 7 of 26
Here’s a probable layout for a non-portable installation.
Straight header pins have been soldered to the bonnet board
and the displays, projecting “up” and “back,”
respectively. Two 11-pin female-to-female ribbon cables then
join everything.
This might be easiest to assemble (and disassemble), and the
straight header pins on the displays make them easy to re-
use in breadboard projects later.
…but that’s not the only option.
This TFT display has right-angle hader pins on the front of the
board (front, back, doesn’t matter as long as the wires
connect in the same order). This makes it very slim, but also a
fair bit taller.
And this OLED has an 11-pin ribbon cable directly soldered to
the board, no header pins at all. Again…front or back, ribbon
could go straight out or can double back across the board…it
all depends on your construction and space needs, as long as
the pin order is followed. This is the most space-efficient, but
requires patience and ace soldering skills, and isn’t easily re-
used in other projects.
If using “rainbow” ribbon cables: these have 10 colors, while the displays use 11 wires…this means the
cables will have the same color wire along both edges. Therefore, DO NOT rely on a visual mnemonic
like “black wire is ground” or “red wire is Vin,” because your cable may have two black wires, or two reds,
or two
anything.
Instead, make sure to manually follow the first wire all the way from the bonnet to the
display, make sure they line up right, then install the remaining wires in order.
If you’re
really
economizing for space, here’s a secret: only 7 wires are really
needed…
it’s just easier and
less error-prone to solder a header at each end and plug all 11 wires straight through. If using the OLED
display, the SC, SD, CD and 3V pins can optionally be skipped. If using TFT, the 3v3 SO, CCS and Lite pins
can be skipped. Make certain the exact same pins are skipped at the bonnet end, don’t mix them up!
To ensure a clean signal from bonnet to displays, aim to keep your wiring short and tidy. Electrical
interference can lead to animation glitches…we’ll explain on the next page how to dial that back if
needed. It’s
possible
to use long ribbon cables (even a couple meters), but it invites problems with
interference or signal reliability.
© Adafruit Industries https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi Page 8 of 26
Loading...
+ 18 hidden pages