Googley Googley Eyes
Googley Eyes, but they Google what they see
26 July 20234 minute read
By Kevin McAleer
Share this article on
Googley Eyes, but they Google what they see
26 July 2023
By Kevin McAleer
Share this article on
Watch the associated video here:
Youβve seen googley eyes or xeyes, but what if the googley eyes could Google what they see (and then announce it); I present googley googley eyes. (Ok, they donβt actually βGoogleβ the image, they actually use something far more cool - OpenAI).
The eyes rotate using the motors with encoders for accurate positioning. This means they can rotate all the way round, but also rotate to a specific position, which is needed for making the eyes look in a direction accurately.

| Item | Description | Qty | Cost |
|---|---|---|---|
| Pi Zero 2W | Raspberry Pi Zero 2W | 1 | Β£17.10 |
| Pi Camera | Raspberry pi camera | 1 | Β£36.90 |
| Camera Cable | Camera Cable - Pi Zero Edition 150mm | 1 | Β£3.90 |
| Motor Controller | Pimoroni Inventor HAT Mini | 1 | Β£24.00 |
| Motors | 2x MMME motors with encoders | 2 | Β£9.90 |
| Motor Cable | Pimoroni JST-SH cable - 6 pin (pack of 4) - 300mm | 1 | Β£3.90 |
| M2 Screws | Screws for the camera mount | 2 | Β£0.50 |
| M2.5 Screws | Screws for the Raspberry Pi Zero 2W | 4 | Β£0.50 |
| Speaker | Mini Oval Speaker - 8 Ohm 1 Watt | 1 | Β£2.70 |
Here are the 3d printed parts for the project:
pi_holder.stl - Holds the Raspberry Pi, this is from a modular robotics system Iβm working oneye_holder - Holds the motors and provides a desktop mount for the projecteye.stl - These are the white eye pieces, youβll need to print two of thempupil.stl - These are the black, pupil pieces, youβll need to print two of them
Setup the Raspberry Pi with a fresh install of Raspberry Pi OS 64-bit, Click here for a how to video
Push the Pimoroni Inventor HAT Mini onto the top of the Raspberry Pi Zero 2W
Connect the motors up to the Inventor Hat Mini
Push the motors into the eye_holder
If you have access to a vinyl cutting machine such as a Cricut Maker 3, you can cut out a circle 50mm in diameter for the white eye, and 30mm for the black pupil. The White eye has a small 7mm hole in the center. The 3d printed parts may require some filing to ensure a smooth motion
Push the black pupil 3d printed part into the white eye piece
Glue the eye 3d printed disk onto the eye_holder with some super-glue, be sure not to glue the pupil part ensuring it can still turn friction free
Screw the Raspberry Pi Zero 2W into the pi_holder using the M2.5 screws
Carefully push the Raspberry Pi camera cable into both the Raspberry Pi camera module and the Raspberry Pi Zero 2W
Screw the Raspberry Pi camera module into the eye_holder with some M2 screws
Push the small PicoBlade speak cable into the speaker connector on the Inventor HAT Mini

OpenAI has a nice automatic image captioning service, you can get this up and running by:
Download the project code:
git clone https://www.github.com/kevinmcaleer/googley_eyes
Sign up for an account on https://platform.openai.com
Create a new API key: Click on your profile picture at the top right, and then View API Keys, then click create new secret key
Copy the secret API key into a file named .env into the downloaded code:
OPENAI_API_KEY=<INSERT YOUR OPENAI API KEY HERE>
Create a virtual environment:
python3 -m venv venv
Activate the environment:
source venv/bin/activate
Install the dependencies:
pip install -r requirements.txt
Running the demo program caption_this.py:
python3 caption_this.py
You can upload your own image and update the code that loads the image.
You can also tweak the query, to ask OpenAI how to describe the image, here is a response generated from the query:
result = index.query('describe what is in the image, be nonchalant and snarky')
Results
βA cat and dog lounging on a blanket, like they own the place.β
The eyes can be moved using the Pimoroni Inventor HAT mini python library; for instructions on how to install that, click here.
Once youβve installed that, headover to the motors example code and run the motor_wave.py program:
cd InventorHATMini/examples/motors
python3 motor_wave.py
Here is the code you will need, please note this is a work in progress so the code will improve over time.
Kevin McAleer
I build robots, bring them to life with code, and have a whole load of fun along the way
Social Links:
If you found this high quality content useful please consider supporting my work, so I can continue to create more content for you.
I give away all my content for free: Weekly video content on YouTube, 3d Printable designs, Programs and Code, Reviews and Project write-ups, but 98% of visitors don't give back, they simply read/watch, download and go. If everyone who reads or watches my content, who likes it, helps fund it just a little, my future would be more secure for years to come. A price of a cup of coffee is all I ask.
There are a couple of ways you can support my work financially:
If you can't afford to provide any financial support, you can also help me grow my influence by doing the following:
Thank you again for your support and helping me grow my hobby into a business I can sustain.
- Kevin McAleer
Comments