惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
Attack and Defense Labs
Attack and Defense Labs
Google Online Security Blog
Google Online Security Blog
SecWiki News
SecWiki News
N
News and Events Feed by Topic
O
OpenAI News
Application and Cybersecurity Blog
Application and Cybersecurity Blog
AI
AI
L
LINUX DO - 最新话题
S
Securelist
Cisco Talos Blog
Cisco Talos Blog
V
Vulnerabilities – Threatpost
Webroot Blog
Webroot Blog
T
Threatpost
A
Arctic Wolf
罗磊的独立博客
T
Tor Project blog
The Hacker News
The Hacker News
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
Latest news
Latest news
Y
Y Combinator Blog
S
Schneier on Security
T
Troy Hunt's Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Security @ Cisco Blogs
量子位
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
Jina AI
Jina AI
L
Lohrmann on Cybersecurity
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Help Net Security
Help Net Security
腾讯CDC
The Last Watchdog
The Last Watchdog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed
Cloudbric
Cloudbric
Simon Willison's Weblog
Simon Willison's Weblog
AWS News Blog
AWS News Blog
NISL@THU
NISL@THU
GbyAI
GbyAI
B
Blog
Spread Privacy
Spread Privacy
宝玉的分享
宝玉的分享
S
Secure Thoughts
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell

The DIY Life

I Rebuilt My 3D Printed Lab Rax Homelab… in Wood - The DIY Life I Built a Compact Raspberry Pi Cluster Using The Makera Z1 Desktop CNC Machine - The DIY Life Pironman 5 Pro Max, A Raspberry Pi 5 Case with Touchscreen, Camera and Speakers I Designed A Mini ITX PC Shelf For My Lab Rax 10″ Homelab I Ran AI on a Raspberry Pi… The Results Were Unexpected I Built a 5″ Portable Raspberry Pi Homelab This Is the Most Overkill Raspberry Pi 5 Cooler I’ve Ever Built Beelink ME Pro, A Small Form Factor NAS with Serious Home Server Potential Turn a Raspberry Pi Zero into a Global Ad Blocker with Pi-hole and Tailscale I Built an AliExpress Homelab, Is It Surprisingly Good or Total E-Waste? Pi 5 NAS With Custom Carbon Fibre Panels, Made on the Makera Z1!
I Built a Pi 5 AI Chatbot That Talks, Blinks, and Looks Around!
Michael Klements · 2025-11-17 · via The DIY Life

There’s something fun about bringing tech to life, literally. Today’s project is all about that, building an AI chatbot that blinks, looks around, and even talks back using a set of custom animatronic eyes and a mouth made from a Neopixel LED light bar. The AI chatbot runs on a Raspberry Pi 5, and the result is a lively little assistant sitting on your desk.

Animatronic Eyes on Chatbot

This idea started after I experimented with the Whisplay Hat by PiSugar. It’s a clever add-on for the Pi Zero 2W that turns it into a compact, portable AI chatbot. You press a button on the side to speak, and it replies through a small onboard speaker while also showing text and emojis on its built-in display.

PiSugar Whisplay Hat Chatbot

It’s a surprisingly capable setup considering its size. After playing around with it for a while, I wondered whether I could build my own version with a bit more life-like appeal. There’s something fascinating about giving an AI a face, not just a screen, but expressive eyes that blink and move around while it talks. This makes it feel more “alive”, which is exactly what I wanted to explore.

Here’s my video of the build and the AI Chatbot in action, read on for my write-up;

Where To Buy The Parts For This Project

Tools & Equipment Used:

Some of the above parts are affiliate links. By purchasing products through the above links, you’ll be supporting my projects, at no additional cost to you.

Revisiting My Animatronic Eyes Design

To bring the AI chatbot to life, I used a Raspberry Pi 5 as the brain and went back to my old animatronic eyes design from a few years ago.

The original version worked, but it relied on fishing line between the servos and the eyes, and the servos were glued in place, which made adjustments and repairs a bit of a pain. So for this build, I updated and expanded the design. I added a proper supporting stand, a mouth, and a mount for the Pi 5 and electronics on the back.

Design of Animatronic AI Chatbot

Download the 3D Print Files

So with that sorted, it was time to print out and assemble all of the parts. I printed out the parts in PLA, black for most of the components, white for the eyeballs (aside from the pupils) and mouth diffuser and then grey for the eyelids.

3D Printed Parts For Chatbot

Each eyeball uses a small universal joint to give it a full range of motion. They’re held in place with a drop of hot glue.

Universal Joint Installation
Glue Universal Joint In Place

The new base includes screw-in mounts for the servos, each one attached using two M2 screws.

Installing Servos With M2 Screws
Three Servos Attached

The eyes are driven using small RC pushrods for each axis. The z-bend goes through the printed arm on the inside of each eye-ball and the rod attaches to each servo with the included screw-on clamp. Don’t worry too much about adjusting these at this stage. It’s actually better to leave them loose so that they can be adjusted when the servo’s are centred in the code.

All Servos Installed
RC Pushrods Installed

Each eye gets three servos: one for horizontal movement, one for vertical movement, and another for the eyelids.

The eyelids pivot around adjustable M2 screws on either side of each eye. These are screwed in from the outside of the bracket towards the eyeball and should almost touch the eyeball (about a 0.5mm gap). The eyelids can then be snapped into place on these screws, starting with the upper eyelid (larger one) first.

Eyelid Pushrod Assembly
Blink Functionality

A two-part pushrod connects the eyelids to the servo. This also attachs to the eyelids with M2 screws and a single M2 screw acts as the pivot point in the middle to make the two parts into a single pushrod.

Eyelid Assembly Operating
Eyelid Assembly Connected To Servo

With six servos in total, the mechanism is a bit more complex than it needs to be, but it gives you independent movement of both eyes and eyelids. That means winking, going cross-eyed, or expressing more subtle movements becomes possible.

The mouth uses an 8-LED Neopixel bar. A soldered on jumper cable runs through the holder and the bar then screws into the stand again with some M2 screws. A white clip-on cover plate acts as a simple diffuser. If you’d like a more or less diffused mouth, play around with the infill settings on this part when printing it out.

Neopixel LED Mouth
Neopixel Mouth Screwed Into Place
Diffuser Plate Pushed Into Place

With the mouth done, we can add two M2 screws to join the left and right eye bases to make a single assembly. The whole eye assembly then mounts onto the stand and is held in place with four M2 screws.

Screwing Eye Assembly To Stand

Electronics: Giving It a Brain

All six servos connect to a PCA9685 control board, which handles their power and PWM signals. This makes servo-control much easier, since the Pi just sends position commands over I2C and the board deals with the actual movement. It also avoids voltage-level issues, because the Pi’s 3.3V logic often isn’t compatable with servos that expect a stronger 5V PWM signal. This board is connected to the Pi’s I2C pins (SCL and SDA) as well as 5V and GND.

PCA9685 Servo Control Board
PCA9685 Servo Control Board With Servos Plugged In

The Raspberry Pi 5 is mounted below the servo board, and the Neopixel bar connects directly to GPIO 13, physical pin 33. It also needs a 5V and GND input.

Raspberry Pi 5
Raspberry Pi 5 With All GPIO Connections Made

Circuit Diagram

Animatronic AI Chatbot Circuit

Wiring Connections Summary:

Servos to PCA9685 Board:

  • Left Eye X Movement – Servo Port 0
  • Left Eye Y Movement – Servo Port 1
  • Left Eye Blink – Servo Port 2
  • Right Eye X Movement – Servo Port 3
  • Right Eye Y Movement – Servo Port 4
  • Right Eye Blink – Servo Port 5

PCA9685 Board to Pi 5:

  • GND – Pi 5 Pin 6 (GND)
  • OE – None
  • SCL – Pi 5 Pin 3 (SCL)
  • SDA – Pi 5 Pin 5 (SDA)
  • VCC – Pi 5 Pin 4 (5v)
  • V+ – External 5V Power Supply +
  • GND – External 5V Power Supply –

NeoPixel Bar to Pi 5:

  • 5V – Pi 5 Pin 5 (5V)
  • GND – Pi 5 Pin 9 (GND)
  • Din – Pi 5 Pin 33 (GPIO13)

Building the Chatbot: Three Stages

With all of the electronics wired up, I put together a short Python test script to make the eyes roam around and blink at random intervals. This was just to test the movement and controls out, it makes the eyes feel alive even before adding the chatbot. I also added variables in the script so you can adjust things like movement speed, blink frequency, travel limits etc.. You can download this version of the code from my GitHub repository.

Animatronic Eyes Basic Eye Movement Script

With the animatronics working, the next step was building the actual chatbot. I broke this into three stages:

1. OpenAI API for Conversation

I started with a simple terminal-based chatbot using OpenAI’s API. To get started, you need to register an account and create an API key. You’ll also need to load some account credit to be able to generate responses, a chatbot uses very little so just load the minimum allowable balance to start out.

AI Chatbot Python Script
AI Chatbot Terminal Application

The OpenAI API also makes it easy to experiment with tone and personality, so you can tailor it to be friendly, sarcastic, calm, chaotic, or create your own custom personality prompt by changing these lines in the code.

Adapt The Chatbot's Personality
AI Chatbot Is Now Grumpy

2. Text-to-Speech

Once the text conversation worked, I added text-to-speech so the chatbot could talk back. This code takes the return text response and converts it into speech and then plays back the generated audio file.

Adding A Voice To The Chatbot

The voice options are also very flexible. You have different basic voice options, but can also tailor accents, styles, and levels of expression through the same text prompt as the previous step. You can go flat, dramatic, natural, robotic or whatever suits the personality of the chatbot you’re building.

3. Speech Recognition

Lastly, I added speech recognition. This code listens for spoken audio, which it then saves as an audio clip. It then converts it to text which is then used as the chatbot prompt and the rest of the code the same as in the previous steps. At this point, the system can listen, think, and respond entirely on its own.

Adding Listening For Input To The Chatbot

Adding Expression: The Neopixel Mouth

With the AI chatbot’s logic complete, I tied in the Neopixel mouth. The 8-LED bar lights up dynamically based on the volume and intensity of the speech. Soft sounds only light the middle LEDs, while louder or more expressive moments light the whole bar.

Neopixel Mouth 2 LEDs Light Up
Neopixel Mouth All LEDs Light Up

It’s a small detail, but it adds a lot of personality. Paired with the blinking animatronic eyes, the chatbot now feels quite lifelike.

AI Chatbot Complete and Running In Terminal
AI Chatbot With Animatronic Eyes and Mouth

The Complete AI Chatbot (And It’s Few Personalities)

And that’s the full AI chatbot build, complete with its animatronic eyes and a responsive Neopixel mouth, all powered by a Raspberry Pi 5. It’s best to watch my Youtube video linked at the begining of the post to see it in action.

Download the code from my GitHub repository.

I then experimented with different personalities:

  • A mad scientist
  • A grumpy, sarcastic chatbot
  • A chilled, laid back and casual chatbot

Seeing it blink, look around, and talk back never really gets old.

Eyes Looking Around
Animatronic Eyes Moving
Animatronic Eyes on Chatbot

While I could have tried running the language model locally on the Pi 5, using cloud-based models gives significantly better results. There’s still about a 1–3 second delay between speaking and getting a reply, but it’s noticeably faster and far more natural than local models. And using the OpenAI API means you can access models like GPT-4 or GPT-4 Mini, which provide richer and more context-aware responses.

What Should I Add Next?

If you enjoyed this AI chatbot project, I’d love to know what you think I should add next. Should it track your face? Respond with emotions? Use gestures? There are a lot of possibilities for upgrading its personality and expressiveness.

Before we wrap up, here’s the chatbot’s final message to everyone:

“Goodbye, humans. May your code always compile and your servos never jitter.”

I think it has been spending a little too much time on GitHub…

AI Chatbot With Animatronic Eyes and Mouth

Thanks for reading, and I’ll see you in the next one!

Michael Klements

Michael Klements

Hi, my name is Michael and I started this blog in 2016 to share my DIY journey with you. I love tinkering with electronics, making, fixing, and building - I'm always looking for new projects and exciting DIY ideas. If you do too, grab a cup of coffee and settle in, I'm happy to have you here.