It's easy to use eInk breakouts and bonnets with Python and the Adafruit CircuitPython EPD module. This module allows you to easily write Python code to control the display.
Using the eInk Bonnet
Since the eInk Bonnet comes preassembled, all you need to do is place it onto the GPIO pins.
Since there's dozens of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, please visit the guide for CircuitPython on Linux to see whether your platform is supported.
Connect the display as shown below to your Raspberry Pi.
Using an eInk Breakout
Alternatively, if you have a 2.13" Monochrome eInk Display available, you can wire it up along with a couple of buttons and resistors. There's a lot of wires, which is why we recommend using the bonnet.
- 3V Rail connects to the Pi's 3V pin
- eInk VIN connects to the 3V Rail
- eInk GND connects to the Pi's ground
- eInk CLK connects to SPI clock. On the Pi, thats SLCK
- eInk MOSI connects to SPI MOSI. On the Pi, thats also MOSI
- eInk ECS connects to our SPI Chip Select pin. We'll be using CE0
- eInk D/C connects to our SPI Chip Select pin. We'll be using GPIO 22.
- eInk RST connects to our Reset pin. We'll be using GPIO 13.
- GPIO 5 connects to one side of a tactile switch.
- GPIO 6 connects to one side of the other tactile switch.
- Place a 100KΩ resistor between GPIO5 and the +3V rail.
- Place a 100KΩ resistor between GPIO6 and the +3V rail.
- Connect the other side of each tactile switch to the Pi's ground.
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This may also require enabling SPI on your platform and verifying you are running Python 3. Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready!
Once that's done, from your command line run the following command:
sudo pip3 install adafruit-circuitpython-epd
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!
If that complains about pip3 not being installed, then run this first to install it:
sudo apt-get install python3-pip
Raspberry Pi usually comes with the DejaVu font already installed, but in case it didn't, you can run the following to install it:
sudo apt-get install fonts-dejavu
This package was previously calls ttf-dejavu, so if you are running an older version of Raspberry Pi OS, it may be called that.
We also need PIL, the Python Imaging Library, to allow graphics and using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:
sudo apt-get install python3-pil
That's it. You should be ready to go!