Face Value

Hardware hacker Michael Klements built an animatronic, talking chatbot face with personality using a Raspberry Pi 5 and ChatGPT.

Nick Bild
12 days agoAI & Machine Learning
A chatbot with animatronic eyes (📷: Michael Klements)

With the help of weekend hackers, the large language models that power chatbots have broken free from the confines of their web-based user interfaces. From desktop speakers to wearables and handheld gadgets, DIY chatbots offer a more natural way to talk with these advanced AI models. Now, hardware hacker Michael Klements has built a different type of chatbot interface, and there is no question that it has got some personality.

Klements 3D printed a pair of animatronic eyes that move and blink in coordination with audible responses from a chatbot. Each eyeball is attached to the frame via a universal joint for a wide range of motion, and a set of three servos control the x- and y-axis, as well as the eyelids. Rods connected between the servos and the eyes control the actuation. An 8 RGB LED bar, covered with a plastic diffuser, was installed below the eyes to serve as the mouth.

Control of the system is provided by a Raspberry Pi 5 single-board computer. A PCA9685 PWM driver board simplifies servo control by sending the proper signals when given commands via I2C. A script running on the Raspberry Pi randomly moves the eyes and triggers periodic blinking.

As far as the chatbot functionality is concerned, Klements hooked into the OpenAI API. The Raspberry Pi could run a model locally, but using the API allowed for faster responses, and also the use of a much more advanced AI model.

When the user speaks their request, a custom speech recognition script transcribes it into text. That text prompt is sent to ChatGPT, and when the response is returned, it is converted into speech with a synthetic voice. As the response is spoken, the mouth “moves” by lighting up just the center portion for soft sounds, and the full bar for louder sounds.

The chatbot was given multiple personas by sending different system prompts to the API. Klements has created a mad scientist and a grumpy and sarcastic version of the chatbot, for instance.

If you haven’t built a chatbot yet, you may be one of the last few! Get hacking and show us what you come up with.

Nick Bild
R&D, creativity, and building the next big thing you never knew you wanted are my specialties.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles