Project Jarvis · v1.0 · Complete Build Guide
16-DoF Humanoid Robot
from scratch — ₹4,500
Full blueprint, wiring diagrams, servo maps, dimensions, cardboard structure guide, software
stack, and phase-by-phase assembly for a beginner-friendly bipedal humanoid with offline AI voice.
~30cmHeight
16Servos (DoF)
₹4,500Total budget
5Build phases
500gTarget weight
2.5hrBattery life
Jarvis Humanoid — Kinematic tree + intelligence layers
┌─────────────────────────────────────────────────────┐
│ INTELLIGENCE LAYERS (Wi-Fi) │
│ [Gemini API free] [Mobile Phi-3] [Laptop LLaMA] │
└───────────────────────┬─────────────────────────────┘
│ WebSocket / HTTP
▼
┌─────────────────────────────────────────────────────┐
│ HEAD / CAMERA NODE │
│ ESP32-CAM · VC-02 voice AI · 0.96" OLED face │
│ 2× MG90S neck servos ← ch 0 (pan) · ch 1 (tilt) │
└───────────────────────┬─────────────────────────────┘
│
┌─────────────────────────────────────────────────────┐
│ TORSO BLOCK │
│ PCA9685 (16-ch driver) · MPU6050 (gyro) · MB102 (pwr) │
│ Battery pack · TP4056 charger module │
└──────────┬──────────────────────────────┬───────────┘
│ │
┌────────┴──────┐ ┌────────┴──────┐
│ LEFT ARM │ │ RIGHT ARM │
│ ch2 Shoulder │ │ ch5 Shoulder │
│ ch3 Elbow │ │ ch6 Elbow │
│ ch4 Gripper │ │ ch7 Gripper │
│ (3× MG90S) │ │ (3× MG90S) │
└───────────────┘ └───────────────┘
│
┌─────────────────────────────────────────────────────┐
│ PELVIS HIP FRAME │
│ ch8 Hip-Roll LEFT (MG996R) │
│ ch9 Hip-Roll RIGHT (MG996R) │
└──────────┬──────────────────────────────┬───────────┘
│ │
┌────────┴──────┐ ┌────────┴──────┐
│ LEFT LEG │ │ RIGHT LEG │
│ ch10 Hip Pitch│ │ ch13 Hip Pitch│
│ (MG996R) │ │ (MG996R) │
│ ch11 Knee │ │ ch14 Knee │
│ (MG90S) │ │ (MG90S) │
│ ch12 Ankle │ │ ch15 Ankle │
│ (MG90S) │ │ (MG90S) │
│ │ │ │
│ ▓▓▓▓▓▓▓▓▓▓▓▓ │ │ ▓▓▓▓▓▓▓▓▓▓▓▓ │
│ 10cm×6cm FOOT │ │ 10cm×6cm FOOT │
│ IR sensor ↓ │ │ IR sensor ↓ │
└───────────────┘ └───────────────┘
SAFETY: HC-SR04 ultrasonic (front) · 2× IR cliff (feet)
- ESP32-CAM — main MCU + Wi-Fi + camera
- VC-02 — offline speech recognition
- MPU6050 — 6-axis gyro/accelerometer
- PCA9685 — I2C 16-channel servo driver
- 0.96" OLED — face expressions
- 4× MG996R — high-torque hips (11 kg/cm)
- 12× MG90S — all other joints (metal gear)
- Total: 16 servos, 16 DoF
- 2× 18650 Li-ion cells (series = 7.4V)
- TP4056 USB-C charging module
- MB102 → 5V/3.3V logic rail
- Motor rail: direct from battery
- ~2.5 hr normal operation
📐
Scale reference: Jarvis is approximately 2× OnePlus Nord CE in height (~30–32 cm).
All measurements are for cardboard/tin sandwich construction. Adjust ±5mm based on your servo
mounting method.
Side-view skeletal dimensions (all in cm)
┌──────────────┐ ← 6cm wide × 5cm tall × 4cm deep
│ HEAD BOX │ Cardboard box · Camera + OLED inside
└──────┬───────┘
│ neck 1.5cm joint
┌──────┴───────┐ ← 9cm wide × 8cm tall × 5cm deep
│ TORSO │ All electronics inside
│ (ESP32 etc) │
└──────┬───────┘
╔══════╩═══════╗ ← 12cm wide · hip pivot block
║ HIP FRAME ║ 2× MG996R here (Roll joints)
╚═══╤══════╤═══╝
│ │ ← 3.5cm gap between legs
┌─────┴┐ ┌┴─────┐
│THIGH │ │THIGH │ ← 7cm long × 3cm wide each (MG996R pitch)
└──┬───┘ └───┬──┘
│5cm │5cm
┌──┴───┐ ┌───┴──┐
│ SHIN │ │ SHIN │ ← 7cm long × 2.5cm wide (MG90S knee)
└──┬───┘ └───┬──┘
│3cm │3cm
┌──┴────────────┴──┐
│ FEET (flat base) │ ← 10cm × 6cm each · 5mm thick
│ IR sensor below │
└──────────────────┘
ARMS (each):
Upper arm: 5cm long × 2cm wide
Lower arm: 5cm long × 2cm wide
Gripper claw: 4cm × 3cm (scissor-style cardboard)
TOTAL HEIGHT: ~30–33cm
TOTAL WEIGHT TARGET: 450–550g
| Body part |
Width |
Height/Length |
Depth |
| Head box |
6 cm |
5 cm |
4 cm |
| Neck bracket |
3 cm |
1.5 cm |
3 cm |
| Torso block |
9 cm |
8 cm |
5 cm |
| Hip frame |
12 cm |
4 cm |
5 cm |
| Thigh (each) |
3 cm |
7 cm |
2.5 cm |
| Shin (each) |
2.5 cm |
7 cm |
2 cm |
| Foot plate (each) |
10 cm |
6 cm |
0.5 cm |
| Upper arm (each) |
2 cm |
5 cm |
2 cm |
| Lower arm (each) |
2 cm |
5 cm |
2 cm |
| Gripper (each) |
4 cm |
3 cm |
1.5 cm |
Every structural piece = 3–4 layers of cardboard glued together. Single layer will flex and
fail under servo torque. Double-sided tape between layers first, then hot glue edges.
- Head + neck: ~60g
- Torso + electronics: ~120g
- Hip frame + 2 MG996R: ~130g
- Each leg: ~50g × 2 = 100g
- Each arm: ~20g × 2 = 40g
- Total target: ≤ 550g
| Component |
Model |
Qty |
Key specs |
Purpose |
Source |
Price |
| MCU + Camera |
ESP32-CAM |
1 |
240MHz dual-core · 4MB flash · OV2640 · 802.11n · I2C/UART/GPIO |
Main brain, Wi-Fi, visual tracking |
Robu.in |
₹600 |
| Voice AI |
AI-Thinker VC-02 Kit |
1 |
US516P6 32-bit · 2MB SPI flash · 150+ offline cmds · UART · USB-C · Mic + Speaker |
Offline speech recognition — no internet needed |
ESC Labs (₹700) or Robu dev kit |
₹700 |
| Servo driver |
PCA9685 |
1 |
I2C · 16 channels · 12-bit PWM · 5–6V · up to 25 MHz |
Controls all 16 servos from 2 wires (SDA/SCL) |
Robu.in |
₹220 |
| Gyro/IMU |
MPU6050 |
1 |
6-axis (accel + gyro) · I2C · 3.3V/5V · addr 0x68 |
Balance feedback for PID loop |
Local / Robu |
₹110 |
| OLED face |
SSD1306 0.96" |
1 |
128×64 px · I2C · 3.3V/5V · addr 0x3C |
Robot face expressions + status |
Robu.in |
₹200 |
| Hip servo ×4 |
MG996R TowerPro |
4 |
11 kg/cm · Metal gear · 55g · 4.8–7.2V · 180° · 55×20×38mm |
Hip Roll (×2, pelvis) + Hip Pitch (×2, thigh) |
Quartz Components ₹254/pc |
₹1,016 |
| Body servo ×12 |
MG90S (metal gear) |
12 |
2.2 kg/cm · Metal gear · 13.4g · 4.8–6V · 180° · 32×12×29mm |
Neck×2, Shoulders×2, Elbows×2, Grippers×2, Knees×2, Ankles×2 |
Local market / Robu ₹90/pc |
₹1,080 |
| Power module |
MB102 |
1 |
5V / 3.3V dual rail · AMS1117 regulator · breadboard mount |
Clean logic voltage for ESP32, PCA9685, sensors |
Robu.in |
₹70 |
| Battery |
18650 Li-ion × 2 |
2 |
Samsung/LG/Panasonic · 2600–3000mAh · 3.7V each · 65×18mm |
Series = 7.4V, direct motor rail |
Local electronics market |
₹220 |
| Charger |
TP4056 (Type-C) |
1 |
1A charge · overvoltage protect · LED status · micro/USB-C |
Charge robot via phone charger |
Local / Robu |
₹30 |
| Cliff sensor |
IR obstacle ×2 |
2 |
2–30cm · Digital output · 3.3V/5V · adjustable |
Mounted under each foot — stops at table edge |
Local market |
₹70 |
| Front sensor |
HC-SR04 |
1 |
2–400cm · ±3mm accuracy · 5V · TRIG/ECHO pins |
Front obstacle avoidance |
Local market |
₹50 |
| Voice sensor |
TF-LC02 LiDAR (optional) |
0/1 |
3–200cm · VCSEL · 3.3V · UART/I2C · compact |
Optional precision distance for trash-grab task |
Robu.in |
₹867 |
⚠️
MG996R buying test: Lift the motor in your hand — genuine 11 kg/cm metal gear should
feel heavy (~55–60g). Rotate the shaft manually with 2 fingers — it should resist strongly. If it
spins easily, it's a fake. Ask specifically: "MG996R TowerPro, metal gear, 11kg/cm".
- Amazon boxes — double-walled (brown thick type)
- Tin sheet — from old containers / oil tins (for leg bones — more rigid)
- Hot glue gun — structural bonding
- FeviQuick / Cyanoacrylate — layer lamination
- Heavy utility cutter — metal blade type
- Binding wire — backup servo horn mount
- Black electrical tape — wire insulation
- Isopropyl alcohol — remove glue if servo misaligned
🔴
Critical rule: Calibrate ALL servos to 90° in code BEFORE gluing anything.
If you glue a joint at the wrong angle, you'll need IPA to unstick it and redo.
Servo slot cut technique
Step 1: Measure servo body
MG996R: 40mm × 20mm body
MG90S: 23mm × 12mm body
Step 2: Cut slot in cardboard
┌────────────────────────────┐
│ CARDBOARD PIECE │
│ ┌──────────────┐ │
│ │ servo slot │← exact │
│ │ (snug fit) │ match │
│ └──────────────┘ │
└────────────────────────────┘
Step 3: Test fit first (no glue yet)
→ servo should be snug but removable
Step 4: Apply hot glue ONLY on edges
→ Never glue over servo body center
→ Never let glue touch wire exit
Step 5: Horn connection
→ Cardboard limb presses onto horn
→ Hot glue + binding wire loop
→ Screws through horn holes preferred
NEVER hot glue directly on PCBs or
electronic module surfaces.
Use double-sided foam tape instead.
Part-by-part construction guide
🧠 Head box (6×5×4 cm)
- Cut 6 faces from cardboard (3-layer sandwich each)
- Front face: cut 2 circles for eyes (18mm diameter)
- Left eye: black glass marble / dummy lens
- Right eye: ESP32-CAM lens aligned from inside
- Bottom face: cut MG90S slot (pitch servo goes here)
- OLED display slot at "mouth" area (bottom-center front)
- Glue ESP32-CAM inside with foam tape on its PCB back
- Leave top open for air circulation
🔗 Neck bracket (L-shape, 3×1.5×3 cm)
- Cut one L-shaped bracket from 3-layer cardboard
- Top horizontal arm: holds MG90S pitch motor (Up/Down)
- Bottom vertical arm: holds MG90S yaw motor (Left/Right)
- Pitch servo horn → glues to bottom of head box
- Yaw servo body → glues into torso top center slot
- Use binding wire through all horn screw holes
📦 Torso (9×8×5 cm)
- Largest single piece — 4-layer sandwich
- Top center: MG90S yaw servo slot (from neck)
- Front panel: reserved for VC-02 speaker grille
- Inside: mount ESP32-CAM board (foam tape), PCA9685 (foam tape), MB102
- Foam tape > hot glue for PCBs — removable when debugging
- Left/right sides: arm shoulder servo slots (facing outward)
- Bottom: connects to hip frame with 2 long screws or binding wire
🦴 Hip frame (12×4×5 cm)
- Widest structural piece — use tin sheet + cardboard hybrid
- Center-left: MG996R Roll slot (left hip)
- Center-right: MG996R Roll slot (right hip)
- Both MG996Rs face downward, shafts pointing out sides
- Battery pack mounts on rear face of this frame (low CoG)
- TP4056 USB-C port faces rear for easy charging access
🦵 Leg (thigh + shin, 7cm each)
- Thigh: tin strip + cardboard backing (more rigid)
- Top of thigh: MG996R Hip Pitch servo slot
- Bottom of thigh: MG90S Knee servo slot
- Shin: 2-layer cardboard + tin reinforcement
- Bottom of shin: MG90S Ankle servo slot
- Ankle horn connects to foot plate center
👣 Foot plate (10×6×0.5 cm)
- Use 4-layer thick cardboard or thin plywood (preferred)
- Center-rear: ankle servo horn attachment point
- Underside front: IR cliff sensor (flat, facing down)
- Edges: reinforce with electrical tape to prevent fraying
- Width (10cm) gives stability — do NOT make narrower
- Anti-slip: stick small rubber pads or foam pieces on underside
💪 Arm (shoulder + elbow + gripper)
- Upper arm: 5cm strip, MG90S shoulder at top, MG90S elbow at bottom
- Lower arm: 5cm strip, connects from elbow horn
- Gripper: two cardboard "fingers" hinged at center
- Gripper servo pushes one side to create clamping action
- Gripper opening: ~4cm max (enough for small objects)
- Reinforce arm joints with binding wire loops
🎭 Face plate (front of head)
- Cut from black cardboard or paint black
- Two equal eye circles: 18mm diameter, symmetrical
- Left eye: epoxy a black marble or dummy lens in hole
- Right eye: ESP32-CAM lens aligned exactly at hole center
- Mouth slot: 26mm × 14mm for 0.96" OLED
- Optional: black transparent visor (X-ray film strip) over both eyes
🔴
Power isolation rule: Motors and logic MUST share GND but NOT share +V. Motor rail
goes directly from battery → PCA9685 V+. Logic rail goes battery → MB102 → 5V →
ESP32-CAM/VC-02/sensors. Mixing these will cause ESP32 brownouts and random resets.
Complete wiring schematic
┌──────────────────────────────────────────────────────────────────────┐
│ POWER DISTRIBUTION │
│ │
│ [18650 × 2]──+── (+7.4V) ──────────────────── PCA9685 V+ │
│ Series \ │
│ (7.4V) └── (+7.4V) ─── MB102 IN ─── 5V OUT ─── ESP32-CAM │
│ │ │
│ [GND bus] ─────────────────────────────────── MB102 GND │
│ │ │ │
│ └── PCA9685 GND └── 3.3V OUT (NC) │
│ └── ESP32-CAM GND │
│ └── VC-02 GND │
│ └── MPU6050 GND │
│ └── All sensor GNDs │
│ │
│ [TP4056] ── USB-C IN ── Charge 18650s │
└──────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────┐
│ I2C BUS (SDA / SCL) │
│ │
│ ESP32-CAM GPIO21 (SDA) ───────────────────────────────────────── │
│ │ │
│ ├── PCA9685 SDA (addr 0x40 default) │
│ ├── MPU6050 SDA (addr 0x68) │
│ └── OLED SSD1306 SDA (addr 0x3C) │
│ │
│ ESP32-CAM GPIO22 (SCL) ───────────────────────────────────────── │
│ │ │
│ ├── PCA9685 SCL │
│ ├── MPU6050 SCL │
│ └── OLED SSD1306 SCL │
│ │
│ NOTE: Add 4.7kΩ pull-up resistors on SDA and SCL to 3.3V │
└──────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────┐
│ UART BUS (VC-02 Voice) │
│ │
│ ESP32-CAM GPIO1 (TX) ───── VC-02 RX │
│ ESP32-CAM GPIO3 (RX) ───── VC-02 TX │
│ ESP32-CAM 5V ───── VC-02 VCC │
│ GND BUS ───── VC-02 GND │
│ │
│ VC-02 → Speaker (built-in) · Mic (built-in on kit) │
└──────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────┐
│ GPIO PINS (ESP32-CAM) │
│ │
│ GPIO4 → IR sensor LEFT FOOT (digital in) │
│ GPIO13 → IR sensor RIGHT FOOT (digital in) │
│ GPIO14 → HC-SR04 TRIGGER │
│ GPIO15 → HC-SR04 ECHO │
│ GPIO0 → Boot mode (leave HIGH during operation) │
│ │
│ NOTE: GPIO16 is not usable on ESP32-CAM (connected to PSRAM) │
│ NOTE: GPIO12 must be LOW at boot (do not pull HIGH) │
│ NOTE: Flash LED is on GPIO4 — avoid for IR sensor if using flash │
└──────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────┐
│ SERVO SIGNAL WIRES │
│ │
│ ALL SERVO GND ────────────── GND BUS │
│ ALL SERVO V+ ────────────── PCA9685 V+ (7.4V motor rail) │
│ ALL SERVO SIG ────────────── PCA9685 CH0 through CH15 │
│ │
│ Per-servo connector: 3-pin JST/Dupont │
│ Brown/Black = GND │
│ Red = V+ (servo power) │
│ Orange/Yellow = Signal (PWM from PCA9685) │
└──────────────────────────────────────────────────────────────────────┘
Wire-by-wire connection table
PCA9685 Servo Driver connections
PCA9685 VCC→MB102 5V output (for IC logic only)
PCA9685 GND→Common GND bus
PCA9685 SDA→ESP32-CAM GPIO21
PCA9685 SCL→ESP32-CAM GPIO22
PCA9685 V+→Battery (+7.4V) DIRECTLY — this powers all
servos
PCA9685 GND (power row)→Common GND bus
MPU6050 Gyroscope connections
MPU6050 VCC→ESP32-CAM 3.3V pin (NOT 5V)
MPU6050 GND→Common GND bus
MPU6050 SDA→ESP32-CAM GPIO21 (shared I2C bus)
MPU6050 SCL→ESP32-CAM GPIO22 (shared I2C bus)
MPU6050 INT→ESP32-CAM GPIO34 (interrupt,
optional)
OLED SSD1306 connections (face display)
OLED VCC→ESP32-CAM 3.3V or 5V (both work)
OLED GND→Common GND bus
OLED SDA→ESP32-CAM GPIO21 (shared I2C bus)
OLED SCL→ESP32-CAM GPIO22 (shared I2C bus)
VC-02 Voice Module connections (UART)
VC-02 VCC→MB102 5V output
VC-02 GND→Common GND bus
VC-02 TX→ESP32-CAM GPIO3 (RX) — cross-connect
TX→RX
VC-02 RX→ESP32-CAM GPIO1 (TX) — cross-connect
RX→TX
HC-SR04 Ultrasonic (front obstacle)
HCSR04 VCC→5V from MB102
HCSR04 GND→Common GND bus
HCSR04 TRIG→ESP32-CAM GPIO14
HCSR04 ECHO→ESP32-CAM GPIO15 (use 1kΩ+2kΩ voltage
divider — ECHO is 5V, ESP32 is 3.3V)
IR Cliff Sensors (2× under feet)
IR Left VCC→3.3V or 5V
IR Left OUT→ESP32-CAM GPIO4
IR Right VCC→3.3V or 5V
IR Right OUT→ESP32-CAM GPIO13
Both GND→Common GND bus
✅
Debugging tip: Before connecting all servos, connect just ONE servo to PCA9685
channel 0 and run a sweep test. If it moves correctly, then add servos one by one. This isolates
wiring problems early.
All 16 channels mapped. PCA9685 default I2C
address is 0x40. Set PWM frequency to 50Hz for servos.
00
Neck Pan / Yaw
MG90S · Left/Right head turn
01
Neck Tilt / Pitch
MG90S · Up/Down head nod
02
Left Shoulder
MG90S · Arm forward/back
03
Left Elbow
MG90S · Arm bend
04
Left Gripper
MG90S · Claw open/close
05
Right Shoulder
MG90S · Arm forward/back
06
Right Elbow
MG90S · Arm bend
07
Right Gripper
MG90S · Claw open/close
08
Left Hip Roll
MG996R · Lateral balance (pelvis)
09
Right Hip Roll
MG996R · Lateral balance (pelvis)
10
Left Hip Pitch
MG996R · Thigh forward/back swing
11
Left Knee
MG90S · Lower leg bend
12
Left Ankle
MG90S · Foot angle / floor contact
13
Right Hip Pitch
MG996R · Thigh forward/back swing
14
Right Knee
MG90S · Lower leg bend
15
Right Ankle
MG90S · Foot angle / floor contact
ℹ️
PWM values for MG90S/MG996R: 0° = 150 counts (0.5ms pulse), 90° = 375 counts (1.5ms
pulse), 180° = 600 counts (2.5ms pulse). Set PCA9685 frequency to exactly 50Hz using: setPWMFreq(50)
Power flow diagram
[18650 Cell 1] ── series ── [18650 Cell 2]
│
+7.4V (fully charged: +8.4V)
│
┌──────────┼──────────────────────┐
│ │ │
▼ ▼ ▼
[TP4056] [PCA9685 V+] [MB102 IN]
USB-C Motor Rail │
Charging (powers all ┌─┴─┐
16 servos) 5V 3.3V
│ │
│ ┌────┼────┐
│ ESP32 VC02 Sensors
│ CAM
│
[ALL SERVO V+ wires]
COMMON GND: Battery─ connects to PCA9685 GND,
MB102 GND, all sensor GNDs, ESP32 GND
Battery life calculation:
2× 18650 2600mAh in series = 2600mAh total capacity
Average current draw (normal operation): ~1000mA
Light use (mostly standing): ~400mA
Heavy walking: ~1800mA (peak)
─────────────────────────────────────────────────
Normal use: 2600 / 1000 = ~2.6 hours
Light use: 2600 / 400 = ~6.5 hours
Full walk: 2600 / 1800 = ~1.4 hours
- Brand: Samsung 25R, LG HG2, Panasonic NCR
- Capacity: 2600–3000mAh (higher = longer)
- Max continuous discharge: 10A+ (high drain type)
- Buy from known source only — fakes are common
- Get a genuine 18650 holder (with leads) for easy swap
- Never short Li-ion cells — fire risk
- TP4056 auto-cuts at 4.2V per cell (safe charging)
- Never discharge below 3.0V per cell (2 cells = 6.0V cutoff)
- If battery gets warm during use — stop and check
- Use XT30 connectors (not thin dupont) for battery leads
- Arduino IDE + ESP32 board package
- Libraries: Adafruit PCA9685, MPU6050, Wire, SSD1306, WebSocket
- FreeRTOS for multitasking (Core 0 = net, Core 1 = motors)
- FastAPI (Python) or Node.js + Express
- WebSocket server for real-time motor commands
- OpenCV for face/object detection
- Gemini API for AI responses
- Your strength — MERN stack applies here
- Live servo sliders for manual testing
- Camera feed viewer
- Gait sequence editor (dance moves JSON)
ESP32 starter firmware skeleton
// jarvis_firmware.ino — Phase 1 starter
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_SSD1306.h>
#include <WiFi.h>
#include <WebSocketsServer.h>
// ── Servo PWM constants ──────────────────────────
#define SERVO_MIN 150 // 0.5ms → 0°
#define SERVO_MID 375 // 1.5ms → 90°
#define SERVO_MAX 600 // 2.5ms → 180°
// ── Channel assignments ─────────────────────────
#define CH_NECK_PAN 0
#define CH_NECK_TILT 1
#define CH_LSHOULDER 2
#define CH_LELBOW 3
#define CH_LGRIPPER 4
#define CH_RSHOULDER 5
#define CH_RELBOW 6
#define CH_RGRIPPER 7
#define CH_LHIP_ROLL 8
#define CH_RHIP_ROLL 9
#define CH_LHIP_PITCH 10
#define CH_LKNEE 11
#define CH_LANKLE 12
#define CH_RHIP_PITCH 13
#define CH_RKNEE 14
#define CH_RANKLE 15
Adafruit_PWMServoDriver pca = Adafruit_PWMServoDriver(0x40);
Adafruit_MPU6050 mpu;
Adafruit_SSD1306 oled(128, 64, &Wire);
WebSocketsServer ws(81);
// ── Helper: set servo by angle ──────────────────
void setServo(uint8_t ch, int angleDeg) {
angleDeg = constrain(angleDeg, 0, 180);
int pulse = map(angleDeg, 0, 180, SERVO_MIN, SERVO_MAX);
pca.setPWM(ch, 0, pulse);
}
// ── Init neutral stance (all at 90°) ────────────
void standNeutral() {
for (int i = 0; i < 16; i++) setServo(i, 90);
}
// ── Cliff detection (returns true if safe) ──────
bool isSafeGround() {
return digitalRead(4) && digitalRead(13);
}
// ── VC-02 voice command handler ─────────────────
void handleVoiceCommand(byte
cmd) {
switch(cmd) {
case 0x01: standNeutral();
break; // "Stand up"
case 0x02: /* walkForward() */
break;
case 0x03: /* danceMode() */
break;
case 0x04: /* grabObject() */
break;
}
}
void setup() {
Serial.begin(115200);
Serial2.begin(115200); // VC-02 UART
Wire.begin(21, 22); // SDA=21,
SCL=22
pca.begin(); pca.setPWMFreq(50);
mpu.begin();
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
standNeutral(); // Always calibrate first
delay(1000);
WiFi.begin("YourSSID", "YourPassword");
ws.begin(); ws.onEvent(wsHandler);
}
void loop() {
ws.loop();
if (Serial2.available()) {
byte cmd = Serial2.read();
handleVoiceCommand(cmd);
}
if (!isSafeGround()) {
standNeutral(); // Emergency stop on cliff
}
}
✅
Test order: (1) Compile blank sketch — check board detected. (2) Add PCA9685 scan —
check I2C address 0x40 found. (3) Add one servo sweep on ch0. (4) Add MPU6050 — check serial output.
(5) Add VC-02 UART echo. Never add all code at once.
🔴
Golden rule: ALWAYS test code before cutting cardboard for each new part. If
software works → build hardware. If hardware works → glue permanently. Never glue and then test.
Day 1–2: Breadboard test (no cardboard)
- Install Arduino IDE, add ESP32 board package URL
- Connect ESP32-CAM via USB (use USB-to-TTL adapter)
- Upload blink sketch → LED blinks = success
- Wire PCA9685 to ESP32 (SDA=21, SCL=22, 5V, GND)
- Run I2C scanner sketch → confirm 0x40 found
- Wire ONE MG90S to CH0 → run sweep code
- Wire MPU6050 → confirm accelerometer values in serial
- Wire OLED → display "Jarvis Boot" text
- Connect VC-02 → speak "jarvis" → get serial byte response
Day 3–4: Head build
- Cut head box (6×5×4cm) — 3-layer cardboard
- Cut eye holes (18mm circles) — left and right
- Insert dummy lens in left eye (marble/glass)
- Mount OLED at bottom-center front of head box
- Mount ESP32-CAM inside — lens aligned to right eye hole
- Cut L-bracket for neck (3-layer cardboard)
- Code test: run OLED talking wave animation
- Mount pitch MG90S in L-bracket horizontal arm
- Mount yaw MG90S in torso top (don't build torso yet)
- Attach head box to pitch servo horn — test pan+tilt
Day 5–6: Torso + voice
- Cut torso box (9×8×5cm) — 4-layer cardboard
- Foam-tape all boards inside: PCA9685, MB102, ESP32-CAM
- Drill cable holes: I2C, UART, power
- Mount VC-02 speaker grille cutout on front
- Connect all I2C devices on shared bus (SDA/SCL)
- Power test: MB102 → 5V → check all chips boot
- Full voice test: speak all 4 commands, verify serial codes
- Attach neck + head to torso top
Day 7–8: Arms
- Calibrate CH2–CH7 all to 90° via code — confirm in serial
- Cut upper arm strips (5cm × 2cm, tin/cardboard)
- Cut lower arm strips (5cm × 2cm)
- Slot MG90S shoulder (CH2/CH5) on torso sides
- Attach upper arm to shoulder horn
- Slot MG90S elbow (CH3/CH6) at lower end of upper arm
- Attach lower arm to elbow horn
- Build gripper: 2 cardboard fingers, pivot point, MG90S CH4/CH7
- Test arm wave motion in code
Day 9–11: Hip frame + legs (most complex)
- Simulate gait in Webots FIRST before building
- Cut hip frame (12×4×5cm) — tin + cardboard hybrid
- Slot 2× MG996R Roll servos (CH8, CH9) — shafts face down
- Cut 2 thigh pieces (7cm) with Hip Pitch slot + Knee slot
- Slot MG996R Pitch (CH10/CH13) at thigh top
- Cut shin pieces (7cm) with Ankle slot
- Build flat foot plates (10×6cm) — 4-layer thick
- Mount IR sensors flat under each foot
- Calibrate CH8–CH15 to 90° — robot should stand straight
- Add MPU6050 PID balance loop — test static balance
- Test cliff detection: move robot near table edge
Day 12+: Walking + AI integration
- Implement 4-phase gait cycle in code
- Phase 1: shift weight left (hip roll)
- Phase 2: lift right leg (hip pitch + knee)
- Phase 3: swing right leg forward
- Phase 4: place foot, shift weight right
- Tune PID constants Kp, Ki, Kd with MPU feedback
- Start laptop WebSocket server (Python FastAPI)
- Connect Gemini API for voice response generation
- Build Next.js dashboard for manual servo control
- Add ArUco marker detection for navigation
P1
Head + Voice (Week 1–2)
Robot speaks, listens offline, and shows expressions. No legs or arms
yet.
- ESP32-CAM detected by Arduino IDE
- PCA9685 responds on I2C 0x40
- VC-02 decodes "jarvis" and returns command byte via UART
- OLED shows talking wave animation on voice command
- Head pan + tilt working via 2 MG90S servos
- Wi-Fi connected, WebSocket server responding
P2
Arms + Grippers (Week 3)
Robot can wave, extend arms, and grasp objects.
- Both arms sweep 0°–180° on command
- Gripper opens/closes on voice command "grab"
- Dance wave routine working (arm swing animation)
- Gemini API integrated for smart responses
P3
Legs — Static Balance (Week 4–5)
Robot stands upright without falling. PID loop working.
- All 8 leg servos calibrated at 90° — robot stands straight
- MPU6050 tilt data printing to serial at 100Hz+
- PID balance loop maintains upright when pushed
- Cliff detection stops motion at table edge
- Front obstacle detection working
P4
Walking + Navigation (Week 6–8)
Robot walks, turns, and navigates using camera + markers.
- 4-phase gait cycle walking forward 5+ steps
- Turn left/right commands working
- ArUco marker detection — robot follows marker
- Dance routine: full body coordination (bhangra moves)
- Voice commands: walk, turn, dance, stop, grab
P5
AI + Autonomous Tasks (Week 9+)
Robot sees, thinks, and acts. Trash pickup, object tracking, full AI
interaction.
- Camera sends frame to Python → Gemini Vision → detects objects
- Robot autonomously navigates to dustbin and drops wrapper
- Face tracking: camera follows your face as you move
- Next.js dashboard: live camera feed + servo sliders
- Render.com + UptimeRobot: cloud server running 24/7
- Full Android app (Flutter) with mobile automation
| Item |
Qty |
Unit price |
Total |
Source |
Phase |
| AI-Thinker VC-02 Kit (Mic + Speaker) |
1 |
₹700 |
₹700 |
ESC Labs |
P1 |
| ESP32-CAM with OV2640 |
1 |
₹600 |
₹600 |
Robu.in |
P1 |
| PCA9685 16-channel I2C driver |
1 |
₹220 |
₹220 |
Robu.in |
P1 |
| MPU6050 6-axis IMU |
1 |
₹110 |
₹110 |
Robu.in |
P3 |
| 0.96" OLED SSD1306 I2C |
1 |
₹200 |
₹200 |
Robu.in |
P1 |
| MG996R TowerPro Metal Gear (11kg/cm) |
4 |
₹254 |
₹1,016 |
Quartz Components |
P3 |
| MG90S Metal Gear Micro Servo |
12 |
₹90 |
₹1,080 |
Local market / Robu |
P1–P3 |
| MB102 dual power supply module |
1 |
₹70 |
₹70 |
Robu.in |
P1 |
| 18650 Li-ion cells (2600mAh) × 2 |
2 |
₹110 |
₹220 |
Local electronics |
P3 |
| TP4056 Type-C charging module |
1 |
₹30 |
₹30 |
Local market |
P3 |
| IR obstacle sensor (cliff) |
2 |
₹35 |
₹70 |
Local market |
P3 |
| HC-SR04 ultrasonic |
1 |
₹50 |
₹50 |
Local market |
P3 |
| Jumper wires (M-M + M-F ribbons) |
2 packs |
₹50 |
₹100 |
Local market |
P1 |
| Male + Female header pins (berg strips) |
3 strips |
₹10 |
₹30 |
Local market |
P1 |
| General purpose dotted PCB × 3 |
3 |
₹15 |
₹45 |
Local market |
P2 |
| Resistors pack (4.7kΩ, 1kΩ, 2kΩ mix) |
1 pack |
₹30 |
₹30 |
Local market |
P1 |
| Black electrical tape |
1 roll |
₹15 |
₹15 |
Local market |
P1 |
| Double-sided foam tape |
1 roll |
₹40 |
₹40 |
Local market |
P1 |
Total hardware cost
₹4,626
Tools (one-time investment — not robot cost)
| Tool |
Price |
Where to buy |
| Soldron 25W soldering iron (original, black handle) |
₹250–280 |
Lajpat Rai Market or Robu.in |
| XL830L digital multimeter (orange/green rubber cover, buzzer) |
₹180–220 |
Lajpat Rai Market |
| Bharti/Solderite 60/40 solder wire 50g + Quickfix paste |
₹100 |
Local market |
| Hot glue gun 20W + 5 glue sticks |
₹120 |
Local hardware shop |
| Wire cutter + stripper (green/yellow handle) |
₹50 |
Local market |
| ESD-safe tweezers set (1 straight + 1 curved) |
₹45 |
Local market |
| Desoldering wick + iron stand |
₹70 |
Local market |
| Heavy utility cutter (metal body) |
₹35 |
Local hardware shop |
| Tools total |
~₹870 |
|
✅
Phase 1 minimum spend: You can start with just ₹1,400 — ESP32-CAM (₹600) + PCA9685
(₹220) + OLED (₹200) + 2 MG90S (₹180) + wires (₹200). Get voice + display + neck working before
spending on legs.