Magic Book Eye

by Markus Opitz in Circuits > Gadgets

6347 Views, 99 Favorites, 0 Comments

Magic Book Eye

Book-Eye-Titel.jpg
Unbenannt 1.gif

I recently read a nice fantasy book*. It has an eye on the cover and other beautiful drawings by the author.

Something comes to mind with the new round OLED displays. Why should the eye be just a drawing?

The magical fantasy book should become reality! Let's go!


*Walter Moers - Die Insel der Tausend Leuchttürme / The island of a thousand lighthouses

Supplies

01-supplies.jpg
  • old hardcover book, as thick as possible
  • 1,28‘ round display (GC9a01) e.g. at AZ-Delivery
  • ESP32 (Arduino Nano is too slow)
  • short wires
  • 5V power bank

Tools: Pen knife, ruler, drill, glue, hot glue

Basic knowledge of Arduino IDE is required.

Microcontroler & Wiring

39-bookeye_.jpg

Soldering is normally not necessary if you use cables and have large enough book with plenty of internal space. If you use a small book, it would be necessary to spare the cables and connectors by soldering short wires.

Follow the wiring list for an ESP32-Wroom:

VCC - 5V or 3V

GND - GND

SCL - 18 (SCK)

SDA - 23 (MOSI)

DC - 17

CS - 16

RST - EN

Software

sketch_150345.jpg

The eye should look straight ahead most of the time and occasionally blink and look to the side as a surprise effect. To do this, we use the random function for the pauses and the direction of gaze.

The eye itself consists only of filled circles that change the center of the circle using the program. I deliberately used graphic elements rather than an eye image in order to retain the comic-like character.

You can experiment a little: Background in white, yellow or black, eye color in blue, yellow, orange, magenta, red or green.

The graphic speed of the display is not particularly fast. It is therefore necessary to make the eye blink and then immediately change the position of the iris. Smooth animation is not possible.


Download the sketch "Book-eye-1.ino"

Downloads

Upload


Connect the ESP32 via USB with your computer and activate Arduino IDE.


Install libraries:

Sketch --> Include Library --> Manage Library --> type "GC9a01" --> install Adafruit_GC9A01A

Sketch --> Include Library --> Manage Library --> type "GFX" --> install Adafruit_GFX Library


Setup:

Board : ESP32 Dev Module

set the port

--> upload the sketch

Preparing the Book

10-bookeye_.jpg
13-bookeye_.jpg
14-bookeye_.jpg
03-cut1.jpg
05-cut3.jpg
20-bookeye_.jpg
22-bookeye_.jpg

My display has the diameter 3.7cm. A suitable hole is made in the middle of the book cover with a drill. If you don't have a suitable drill, you need to mark it out with a pair of compasses and cut it out cleanly with a penknife.

Then you define how much of the book you want to cut out. To do this, we open the first page and fix the book on both sides with wood strips and screw clamps. Now you can make cuts along the ruler and remove the paper in between. We do this until the space is large enough.

I use wood glue to fix the cut edges a little. It matches the color well, is slightly elastic and dries quickly.

Bring It All Together

vlcsnap-2024-03-20-22h06m30s533.jpg
29-bookeye_.jpg
32-bookeye_.jpg
33-bookeye_.jpg
34-bookeye_.jpg
36-bookeye_.jpg
37-bookeye_.jpg
Unbenannt 1.gif
Magic Book Eye

We fix the display in the hole with hot glue. A wooden strip can be helpful.

Drill a hole for the cable in a suitable place on the back of the book. Close the book, connect the power bank - done.