Skip to main content
Version: FILS English

WidowMaker-Pico

A 4 legged 3 degrees of freedom per leg spider robot controlled via WiFi, phone app control, capable of walking in all directions and stabilizing itself.

Description

A 4 legged spider robot controlled via a PC/mobile app over WiFi with a TCP server for real time commands. The robot uses 12 MG90S servo motors (3 per leg) controlled by a PCA9685 PWM 16 channel controller with a Raspberry Pi Pico W running Rust firmware via Embassy-rs. The robot will have a walking pattern with inverse kinematics, will be PC/phone controlled with joystick movement via WiFi, it will have emote animations, faces display and body pose tilting via the MPU6050 gyroscope that I will also use for body orientation sensing and auto leveling.

Motivation

I chose this project because I always was interested in the design and mechanical movement of robots, practically I wanted to combine mechanical design with embedded programming into this project. Building a walking robot would make me learn and understand inverse kinematics, real time control and sensor fusion, all implemented in a Rust microcontroller, also the app should add a practical and fun user interface that makes the robot interactive.

Architecture

Arachne Architecture

The system consists of three main components:

  1. Pico W: Runs Embassy-rs async tasks for WiFi, gait engine, servo control, IMU reading
  2. I2C Peripherals: PCA9685 servo driver, MPU6050 gyroscope, OLED SSD1306 display all on a shared I2C bus
  3. PC App: TCP client with joystick, emote buttons and body pose control

Task Architecture

TaskFrequencyPurpose
wifi_taskEvent-drivenCYW43 WiFi driver background processing
tcp_server_taskEvent-drivenAccept connections, parse JSON commands
gait_task50 HzCompute walking foot trajectories and IK
servo_task50 HzWrite angles to PCA9685 via I2C
imu_task100 HzRead MPU6050, complementary filter
display_taskEvent-drivenRender faces on SSD1306 OLED
emote_taskEvent-drivenPlay pre-defined animation sequences

Tasks communicate via Embassy Channel and Signal primitives

Log

Week 5 - 8

I brainstormed ideas, chose my desired topic and got its approval. I ordered components. Verified Pico W blink and I2C channel.

Week 9

Downloaded Fusion, learned how to use it and designed chassis and legs.

Week 10

Implemented PCA9685 servo control. Calibrated all 12 servos. Implemented inverse kinematics for 3-DOF legs.

Week 11

Implemented trot gait engine. Robot can now walk forward/backward. Started the Wifi TCP server.

Week 12

MPU6050 integration. Body pose control allowing auto-leveling while walking. OLED display with multiple emotion faces.

Week 13

App with joystick control. Robot responds to phone commands. Added emote animations.

Hardware

Components

The system uses a Raspberry Pi Pico W (RP2040) as the main controller and for WiFi, a PCA9685 16-channel as a servo driver, 12 MG90S servos as leg joints, a MPU6050 (GY-521) gyroscope for body orientation sensingm an OLED SSD1306 display and a 7.4V 2S LiPo battery as power source.

Schematics

KiCad Schematic

Pin Connections

Pico W PinGPIOFunctionConnected to
Pin 6GP4I2C0 SDAPCA9685, MPU6050, SSD1306
Pin 7GP5I2C0 SCLPCA9685, MPU6050, SSD1306
Pin 363V3PowerAll I2C device VCC
Pin 39VSYS5V inputBuck Converter output

Power Architecture

7.4V LiPo → Switch → UBEC (3A 5V) → Pico W VSYS
→ Buck Converter (5A 5V) → PCA9685 V+
Pico W 3V3 → PCA9685 VCC, MPU6050 VCC, SSD1306 VCC

Photos

Photo IRL1

Photo Robot

Photo Board

Schematics

KiCad Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico WMain controller64 RON
Pca9685 Servo Driver16 channel PWM I2C servo driver42 Ron (for 2)
MG90S Servo Motor3 DOF movement for walking, rotating and stabilizing200 Ron
MPU6050 Module (GY-521)IMU data20 Ron
OLED SSD1306 Display 128x64Display for the faces15 Ron
7.4V 2S LiPo Battery 1000mAhPower source56 Ron
2s LiPo chargerCharger for battery43 Ron
5V 5A Buck ConverterBuck converter to reduce 7.4V down to 5V for the servos15 Ron
5V 3A UBECBuck converter to reduce 7.4V down to 5V for the RPi24 Ron (for 5)
ProtoboardBoard to solder all the power and communication rails13 Ron (for 5)
SwitchesSwitch for powering on and off12 Ron (for 5)
XT30 pair connectorsTips for wires to connect eachother15 Ron
Pin Headers (male+female)To help soldering the board and components19 Ron
3D Printing FilamentUsed for the custom design of my project100 RON
Wires for power, heat shrinks and jumper wiresSoldering on the board and power insulation70 Ron
Total708

Software

PC Python App

App with 4 tabs:

  1. Move: Virtual joystick for walking direction
  2. Emotes: Grid of emote buttons (wave, dance, bow, etc.)
  3. Faces: Grid of face buttons (happy, sad, angry, etc.)
  4. Pose: Virtual joystick for body pitch/roll control
LibraryCategoryUsage
embassy-executorAsync RuntimeProvides the async task executor to run background routines concurrently
embassy-rpHAL LayerLow level peripheral hardware abstraction layer for the RP2040 (GPIO, I2C, Time-driver)
embassy-timeTimingManages asynchronous timers and clock ticks required for servo PWM adjustments
embassy-syncSynchronizationImplements Channel and Signal blocks to pass data safely between tasks
embassy-netNetworkingTCP/IP network stack handling the embedded TCP socket listener on port 8080
cyw43 and cyw43-pioWireless DriverControls the CYW43439 physical hardware chip on the Pico W for stable Wi-Fi operations
pwm-pca9685Hardware DriverI2C driver used to command the 16-channel PWM controller handling the 12 leg servos
mpu6050-dmpHardware DriverDecodes Digital Motion Processor sensor fusion inputs from the gyroscope for stabilization
ssd1306Hardware DriverI2C interface driver used to control the 0.96" OLED display graphics buffer
embedded-graphicsGraphics UIDraws pixel art, rendering the active emotions animation frames on the OLED
serde and serde-json-coreData ParsingEmbedded no allocation JSON framework to deserialize app movement packets into system data structs
heaplessData StructuresProvides static, fixed size data arrays and rings without requiring memory heap allocations
libmCore MathTrigonometric implementation tracking (sin, cos, atan2, sqrt) required for the Inverse Kinematics math
defmt and defmt-rttSystem LoggingProvides information back to me regarding the robot
panic-probeSafety DiagnosticsIntercepts firmware runtime panic failures and streams the exact file via probe-rs
cortex-m and cortex-m-rtTarget RuntimeAssembly routines and execution initialization for Cortex-M0+ processing hardware

Crate Registries

  1. Embassy
  2. PCA9685 PWM Driver Crate
  3. PCA9685 product data sheet
  4. MPU6050 Gyroscope Driver Crate
  5. SSD1306 OLED Driver Crate
  6. Embedded Graphics Library
  7. Serde JSON Core Crate
  8. Heapless Static Collections
  9. Project inspiration