ASTRO: Animatronic AI Robot Head That Talks and Makes Faces
Summary: ASTRO is an innovative, open-source animatronic robot head that combines AI-powered conversation with realistic facial expressions and smart-home capabilities. Built affordably using an ESP32-S3 and 13 servos, this project provides a comprehensive guide for makers to create their own interactive, talking robot companion.
Key Takeaways
- Affordable & Open-Source: Build a sophisticated AI robot head with real facial expressions for under $50, leveraging open-source hardware and software.
- Advanced AI Integration: Utilize an ESP32-S3, custom AstroOS firmware, and an AI Brain (OpenAI Realtime) for natural voice conversations and expressive reactions.
- Comprehensive Control Suite: Employ Control Studio for live servo control, expression building, animation timelines, and guided calibration, simplifying complex animatronic programming.
- Smart Home & Multilingual Capabilities: Integrate with Blynk for voice-controlled smart-home automation and enable multilingual interactions (English, Hindi, Marathi, Hinglish).
Detailed Overview
ASTRO, short for Animatronic Speaking Thinking Robotic Operator, is a remarkable DIY AI talking robot head designed to exhibit real facial expressions. Built for under $50, ASTRO integrates 13 servos to articulate eyes, eyelids, eyebrows, lip corners, jaw, and neck, allowing it to react dynamically during conversations. It supports multiple languages and functions as a voice-controlled smart-home assistant.
The project is entirely open source, including firmware, Control Studio web app, AI Brain, case files, and step-by-step documentation. It's based on the FRITZ open-source animatronic robot head, with significant internal rebuilds and enhancements.

Core Components & Architecture
ASTRO's intelligence and motion are driven by:
- An ESP32-S3 microcontroller running custom firmware, AstroOS, which features a 100 Hz motion engine.
- A PCA9685 board to precisely control all 13 servos.
- Control Studio, a web application for live control, expression building, animation timelines, and guided calibration.
- An AI Brain running on a computer, facilitating voice conversations via the OpenAI Realtime API (with optional Sonex Labs voices).
- Blynk integration for seamless smart-home control.
- A 3D-printable case to house the electronics neatly.
The necessary files, including a supplies list, can be downloaded from the project's GitHub repository.
Building the Animatronic Head
The physical structure of ASTRO's face utilizes the FRITZ mechanism, employing 13 servos to move different facial parts via short linkages.
- Acquire Parts: Obtain the FRITZ head files from the original project (github.com/XYZbot/Fritz) and either laser-cut or 3D-print the components.
- Assemble Frame: Construct the main frame, eye mechanisms (two servos per eye for left/right and up/down movement), eyelids, eyebrow levers, lip corners, and jaw.
- Mount Neck Servos: Attach a micro servo for left/right head rotation and a strong MG996R servo for up/down tilt, as it bears the head's weight.
- Initial Assembly: Do not tightly attach servo horns yet; calibration will be performed later. Note that the two eyebrow servos are mounted as mirror images, which is corrected in software.

Wiring the ESP32-S3 to the PCA9685
Connecting the ESP32-S3 to the PCA9685 requires only four wires, ensuring no servo power is connected during this step.
- ESP32 3V3 -> PCA9685 VCC
- ESP32 GND -> PCA9685 GND
- ESP32 GPIO8 -> PCA9685 SDA
- ESP32 GPIO9 -> PCA9685 SCL
- PCA9685 OE -> GND (or leave unconnected)
Tips: Keep SDA and SCL wires short to prevent glitches. The OE pin should be tied to GND or left unconnected. Servos should be plugged into channels 0-12 in a specific order for proper mapping.

Proper Servo Power Management
Reliable servo power is crucial for smooth robot operation.
- Separate Power Supply: Use a dedicated 5-6 V supply with at least 6 A capacity for the servos. A phone charger or the ESP32's USB is insufficient.
- Wiring: Connect the servo supply to the PCA9685's V+/GND screw terminal via a fuse and switch.
- Capacitor: Install a 1000-2200 uF capacitor across V+ and GND at the terminal, observing polarity.
- Grounding: Ensure all grounds (supply minus, PCA9685 GND, ESP32 GND) are connected.
- ESP32 Power: Power the ESP32 separately, typically from your computer's USB.
This setup prevents common issues like servo twitching or ESP32 restarts due to power fluctuations.

Firmware & Software Setup
AstroOS, the custom firmware, manages Wi-Fi, USB communication, safety features, and the motion engine on the ESP32-S3.
- Install ESP-IDF 5.4:
mkdir -p ~/esp && cd ~/esp git clone -b v5.4.1 --recursive https://github.com/espressif/esp-idf.git cd esp-idf && ./install.sh esp32s3 - Get Code and Keys:
git clone https://github.com/chiragbadhe/ASTRO.git cd astro/local-services && npm install && npm run provision - Configure Wi-Fi and Token: Copy
astroos/sdkconfig.secrets.exampletoastroos/sdkconfig.secretsand fill in your 2.4 GHz Wi-Fi credentials and a random robot token (e.g., generated byopenssl rand -hex 24). - Build and Flash:
Look for "Wi-Fi connected, IP ..." and "PCA9685 ready at 0x40" in the log. If flashing fails, hold BOOT, tap RST, release BOOT, and retry.. ~/esp/esp-idf/export.sh cd astro/astroos idf.py set-target esp32s3 idf.py build idf.py -p /dev/cu.usbmodem* flash monitor
Setting Up Control Studio
Control Studio is the web application used to interact with ASTRO.
- Start Helper Services:
cd astro/local-services && npm start - Start Studio:
cd astro/studio && npm install && npm run dev - Connect Studio: Open
http://localhost:3210, navigate to Settings > Connection, and configure:- Mode: Robot (Wi-Fi)
- Robot address:
ws://astro.local/wsorws://<IP from the log>/ws - Robot token: The same token from
sdkconfig.secrets - "Use the USB cable when plugged in": On Press Connect. Remember to press "Arm servos" in the top bar after every restart, and use the red "Emergency stop" button (or Esc key) for immediate disarming.

Servo Connection & Calibration
Connect and test servos one by one to prevent damage.
- Individual Servo Test: With the servo horn removed, turn on the servo supply with only one servo plugged in. In Studio, press "Arm servos," go to "Part test," select the part, and run a "gentle Sweep."
- Repeat and Attach: Repeat for all servos, then loosely attach horns and linkages.
- Pair Testing: Test pairs (eyes, eyebrows, lip corners) to ensure synchronized movement.
If a part moves incorrectly, the next step will address it.

Guided Calibration for Facial Movements
The Guided calibration wizard in Control Studio helps set each servo's unique rest position, limits, and direction.
- Access Wizard: Open Calibration > Guided calibration.
- Rest Position: Nudge the part to its desired rest position and press Space.
- Limits: Press Space when the servo reaches its travel limits.
- Direction: Answer the direction question (e.g., "Did the jaw OPEN?") to automatically set the servo's direction.
- Save: Calibration settings are stored on the robot.
Ensure the jaw's rest position is fully closed. After calibration, tighten all horns and linkages.

Bringing ASTRO to Life: Expressions & Animations
This is where ASTRO gains its personality.
- Expressions: A library of pre-defined faces (neutral, happy, sad, etc.). You can edit servo targets, timing, and easing, mirror movements, or capture current poses.
- Live Control: Manually move individual servos with sliders or steer the head using the neck pad.
- Animation Studio: A keyframe timeline for creating complex routines, which can be stored on the robot for standalone playback.
- Idle Motion: (In Settings) Adds natural blinking and subtle movements when ASTRO is not actively engaged.

Integrating AI for Voice Interaction
The AI Brain service on your computer enables ASTRO to engage in spoken conversations.
- Start AI Brain:
cd astro/brain && npm install && npm start - Configure in Studio: In Studio > AI Brain:
- Paste your OpenAI API key and test it.
- Paste the robot token and set the robot address (
ws://astro.local/ws). - Choose a speaking voice and preview it (OpenAI or Sonex Labs voices).
- Toggle "Robotic voice" effect.
- Define ASTRO's personality (name, character, speaking style, language).
- Start Conversation: Open AI Simulation, set "Who moves" to "Real head too," and press "Start talking."
During conversations, ASTRO's jaw syncs with its voice, expressions match the mood, and it performs gestures like nodding or laughing. For safety, the AI can only use named expressions and gestures, never raw servo commands.

Smart Home Control Integration
ASTRO can control smart appliances via Blynk.
- Blynk Setup: In Studio > Home > Set up, add your Blynk device by specifying the server region and pasting the device's auth token. Test the connection.
- Find Pins: Press "Find pins" to retrieve virtual pins from your Blynk device.
- Add Appliances: Add each appliance with a name, room, virtual pin, and type (On/off, Level). Include alternative names (e.g., "tube light").
- Safety Features: For risky appliances, enable "Ask me first" to require verbal confirmation.
- Save and Interact: Save the home configuration and start a new conversation.
ASTRO will confirm actions only after Blynk confirms them, and has a rate limit of 20 switches per minute for safety.

3D Printing the Electronics Case
A custom 3D-printed case keeps the ESP32-S3, PCA9685, switch, and fuse organized and protected within the robot head's base.
- Files:
hardware/case/astro_case_base.stlandastro_case_lid.stlfrom the repository. - Assembly: The ESP32 fits in the front pocket, PCA9685 in the back, and switch/fuse holder in the right wall.
- Hardware: Requires 4 x M3 x 10 mm screws for the lid, a 9 mm grommet for the power cable, and foam tape for securing boards.
- Customization: The
astro_case.pyscript allows for editable model adjustments.
A window in the lid provides access to the ESP32's BOOT and RST buttons.

Troubleshooting Common Issues
Here are solutions to common problems encountered during ASTRO's construction:
- All servos twitch/shake: Power issue. Use a stronger supply (6-10 A), add the 1000-2200 uF capacitor, and ensure all grounds are joined.
- ESP32 restarts: Supply sag. Keep ESP32 on USB and provide a separate, robust supply for servos.
- Nothing moves: Press "Arm servos." Check servo power to V+ terminal and PCA9685 response in Diagnostics.
- Part moves wrong way: Rerun "Guided calibration" for that part and correct direction.
- Mouth open when armed: Set jaw's rest position to fully closed in "Guided calibration."
- Servo spins 360 degrees: It's a continuous servo; swap for a 180-degree one.
- Flashing fails: Hold BOOT, tap RST, release BOOT, and use a data USB cable on the correct port.
- Studio can't connect: Verify token, use IP instead of
astro.local, and ensure 2.4 GHz Wi-Fi. - AI says "Body offline": Set robot address and token in AI Brain, confirm robot Wi-Fi connection.
- Blynk says "dataStream doesn't exist": Press "Find pins" and use a listed virtual pin.
A more detailed troubleshooting guide is available in docs/troubleshooting.md in the repository.

Conclusion & Resources
The ASTRO project offers an exciting journey into animatronics, AI, and smart home integration, demonstrating how accessible advanced robotics can be. With its open-source nature, ASTRO provides a fantastic platform for learning, customization, and community contributions. Future enhancements could include camera integration for visual interaction, more diverse expressions, additional languages, and new smart-home integrations.
- GitHub Repository: github.com/chiragbadhe/ASTRO
- Original Project Source: Instructables: Animatronic AI Robot Head That Talks and Makes Faces