PROJECT NEXARA AI HEAD - Master Release
PROJECT NEXARA AI HEAD - Master Release v1.6 / V3 Fixed
C.SWART | 2 SERVOS ONLY | 16-LED | STAR GROUND | ISOLATED POWER | NEXUS AI CORE™ | SA 🇿🇦
What is it?
An edge-AI animatronic head built from the ground up for low-cost humanoid robotics. Uses ESP32-CAM (AI-Thinker) as the vision brain, PCA9685 as the servo driver, MG995 13KG for Base Pan (CH0), SG90 9G Micro for Mask Tilt (CH1), and a 16-LED WS2812B ring for eye illumination & status feedback.
Why did I build it?
To create a robust, replicable AI head platform that solves common maker pitfalls: servo jitter, ground loops, and ESP32 brownout crashes. This V3 architecture implements a dedicated CENTRAL STAR GROUND and ISOLATED POWER distribution network.
How does it work?
- ESP32-CAM handles vision processing + servo logic
- I2C Control: SDA GPIO15 (Yellow) / SCL GPIO14 (Green) to PCA9685
- WS2812 NeoPixel Data: GPIO12 (Blue) with 330Ω inline resistor + 470µF rail cap + 10kΩ pull-down for safe boot
- Power Architecture: 7.4V LiPo -> Buck-Boost regulated to 5V 4A -> THICK RED heavy-gauge wire directly to PCA9685 V+ screw terminal. Logic powered via clean +5V breadboard rail. All grounds converge at one central star ground hub.
- Servos safely center on boot (90°), followed by a smooth pan sweep (40°-140°) with coordinated tilt and breathing blue LED ring activity.
Features (V1.6 Master Gold):
- 2-Servo streamlined architecture (high stability)
- Verified 16-LED count in left eye aperture
- Split pulse calibration: MG995 (120-620) / SG90 (150-600)
- Safe-boot logic: Green = Ready, Red = Error, Blue = Breathing
- Fully isolated high-current power rail (no servos drawing from ESP32 pins.
BOM - 12 PARTS VERIFIED:
1x ESP32-CAM AI-Thinker Module
1x PCA9685 16CH PWM Driver
1x MG995 13KG Metal Gear Servo (Base Pan - CH0)
1x SG90 9G Micro Servo (Mask Tilt - CH1)
1x 16-LED WS2812B NeoPixel Ring (Left Eye)
1x DC-DC Buck-Boost Converter 5V 4A Output
1x 7.4V LiPo Battery Pack
1x 470µF 16V Decoupling Capacitor
1x 330Ω Resistor (Data Line Protection)
1x 10kΩ Resistor (GPIO12 Safe-Boot Pull-down)
1x HKD Mini Breadboard + Ardu Proto Shield
1x C.SWART Hard Hat & Steampunk Gas Mask Chassis Assembly
Build Instructions:
1. Calibrate Buck-Boost output to EXACTLY 5.0V using a multimeter before connecting logic boards.
2. Wire per V3 Master Diagram: GPIO14 -> SCL, GPIO15 -> SDA, GPIO12 -> DI (via 330Ω resistor). Wire PCA9685 VCC and ESP32 5V to the +5V logic rail. Wire thick heavy-gauge red wire from Buck-Boost OUT+ directly to PCA9685 V+ screw terminal.
3. Centralize Star Ground: Connect Buck-Boost OUT-, PCA9685 GND, ESP32 GND, NeoPixel GND, and Battery IN- to a single star ground point.
4. Libraries Required: Adafruit PWM Servo Driver, Adafruit NeoPixel, and ESP32 Board Manager v2.0.14.
5. Flash Master Release v1.6 code (Select board: "AI Thinker ESP32-CAM", Partition: "Huge APP 3MB").
Files Included:
- V3 Master Wiring Diagram (Isolated Power & Star Ground)
- V1.6 Master Ensemble Sheet (Exploded Assembly & BOM)
- Master Release v1.6 C++ INO Code
Cpp
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#include <Adafruit_NeoPixel.h>
#include "esp_camera.h"
// ===== PROJECT NEXARA AI HEAD - MASTER RELEASE v1.6 / V3 Fixed =====
// C.SWART Hard Hat - 2 SERVOS ONLY - 16-LED - STAR GROUND - ISOLATED POWER
// PIN DEFINITIONS - V3/V4 WIRING MATCH
#define I2C_SDA 15 // Yellow -> PCA9685 SDA
#define I2C_SCL 14 // Green -> PCA9685 SCL
#define LED_PIN 12 // Blue -> WS2812 DI
#define LED_COUNT 16 // 16-LED ring confirmed
// PCA9685 channels - 2 SERVOS ONLY
#define SERVO_PAN 0 // MG995 13KG - Base Pan - CH0
#define SERVO_TILT 1 // SG90 9G Micro - Mask Tilt - CH1
// Servo pulse limits
#define MG995_MIN 120
#define MG995_MAX 620
#define SG90_MIN 150
#define SG90_MAX 600
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40);
Adafruit_NeoPixel ring(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setServo(uint8_t ch, int angle) {
angle = constrain(angle, 0, 180);
uint16_t pulse;
if (ch == SERVO_PAN) {
pulse = map(angle, 0, 180, MG995_MIN, MG995_MAX);
} else {
pulse = map(angle, 0, 180, SG90_MIN, SG90_MAX);
}
pwm.setPWM(ch, 0, pulse);
}
void centerServos() {
setServo(SERVO_PAN, 90); // Center pan
setServo(SERVO_TILT, 90); // Center tilt
}
void setRingColor(uint8_t r, uint8_t g, uint8_t b) {
for (int i = 0; i < LED_COUNT; i++) ring.setPixelColor(i, ring.Color(r, g, b));
ring.show();
}
void breatheBlue(int speed = 12) {
static int brightness = 0;
static int direction = 1;
brightness += direction;
if (brightness >= 255 || brightness <= 0) direction = -direction;
setRingColor(0, 0, brightness);
delay(speed);
}
void setup() {
Serial.begin(115200);
delay(500);
Serial.println("\nPROJECT NEXARA AI HEAD v1.6 - C.SWART - 2 SERVO - 16-LED - NEXUS AI CORE");
Wire.begin(I2C_SDA, I2C_SCL);
pwm.begin();
pwm.setPWMFreq(50); // 50Hz for analog servos
delay(10);
// Safe-boot - star ground + 10k pulldown protection
centerServos();
ring.begin();
ring.setBrightness(80);
setRingColor(0, 0, 40); // Dim blue = booting
// Camera init - AI-Thinker
camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = 5; config.pin_d1 = 18; config.pin_d2 = 19; config.pin_d3 = 21;
config.pin_d4 = 36; config.pin_d5 = 39; config.pin_d6 = 34; config.pin_d7 = 35;
config.pin_xclk = 0; config.pin_pclk = 22; config.pin_vsync = 25;
config.pin_href = 23; config.pin_sscb_sda = 26; config.pin_sscb_scl = 27;
config.pin_pwdn = 32; config.pin_reset = -1;
config.xclk_freq_hz = 20000000;
config.pixel_format = PIXFORMAT_JPEG;
config.frame_size = FRAMESIZE_VGA;
config.jpeg_quality = 12;
config.fb_count = 1;
if (esp_camera_init(&config) != ESP_OK) {
Serial.println("Camera init failed");
setRingColor(80, 0, 0); // Solid Red = Error
return;
}
Serial.println("Nexara AI Head Ready!");
setRingColor(0, 80, 0); // Solid Green = System Ready
delay(500);
}
void loop() {
static int pan = 90;
static int dir = 1;
// Pan sweep sequence
pan += dir;
if (pan >= 140 || pan <= 40) dir = -dir;
setServo(SERVO_PAN, pan);
setServo(SERVO_TILT, 90 + (pan - 90) / 4); // Slight synchronized tilt
breatheBlue(12);
delay(20);
}
Best regards,
Coenraad Swart
Founder & Lead Architect | Nexus AI Core (Pty) Ltd
Polokwane, South Africa
+27 834011107
Apply for sponsorship >>- Comments(1)
- Likes(0)