Skip to main content
Version: ACS CC

Crane Controller

Mini crane system using Raspberry Pi Pico 2W.

info

Author: Stanciu Vlad-Mihai
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-StanciuVlad1


Description

The project consists of a mini crane built using a Raspberry Pi Pico 2W, capable of:

  • Rotating the crane arm left and right using a servo motor (SG90) controlled by a joystick.
  • Raising and lowering the load using a stepper motor (28BYJ-48 + ULN2003 driver).
  • Managing multiple motors asynchronously using Rust and Embassy.
  • Controlling the servo motor via a biaxial joystick for precise horizontal and vertical movements.
  • Being powered independently by external 9V batteries to avoid overloading the controller.

This setup simulates the mechanical behavior of a real crane, combining both rotation and lifting functionalities.


Motivation

I wanted to build a mechanical system that combines precise motion control and hardware interaction through an embedded controller.
The project allows practice with PWM signals, motor driving, and simple automation using Rust on the Raspberry Pi Pico.


Architecture

The Raspberry Pi Pico 2W acts as the brain of the system:

  • Joystick: Controls the servo motor that rotates the crane arm horizontally (left/right).
  • SG90 Servo Motor: Moves the crane arm based on joystick input.
  • 28BYJ-48 Stepper Motor + ULN2003 Driver: Raises or lowers the load by winding a string or cable.
  • External 9V Batteries: Supply power to motors to protect the Pico board.
  • Header Pins: Simplify wiring connections.

Data flow:

  • The joystick sends analog signals, with one axis controlling the left/right rotation and the other adjusting the vertical lifting.
  • Based on joystick direction, Pico adjusts the servo’s PWM signal to rotate the arm or control the lifting mechanism.
  • Up/down commands trigger sequences sent to the stepper motor driver.

Block Scheme

diagram

Log

Week 5 – 11 May

TO DO

Week 12 – 18 May

TO DO

Week 19 – 25 May

TO DO

Components

ComponentPurposeDetails
Raspberry Pi Pico 2WMain controllerRuns firmware and manages motors
Micro Servomotor SG90Arm rotationControlled horizontally with joystick
28BYJ-48 Stepper Motor + ULN2003 DriverLoad liftingRaises or lowers the crane's load
9V Battery HoldersExternal motor powerSeparate power source for motors
Header Pins (2x40p)WiringClean motor and sensor connections

Hardware Overview

  • The joystick is connected to analog input pins of the Pico.
  • Based on joystick movement, the Pico sends PWM commands to the SG90 servo for left/right rotation.
  • The stepper motor is controlled through step sequences sent to the ULN2003 driver board.
  • Motors draw their power from external batteries to ensure safe operation.
  • Header pins make the prototyping easier and cleaner.

Schematics

diagram

Bill of Materials

Product CodeDeviceUsagePrice
5056561803975Raspberry Pi Pico 2WMain controller39,66 lei
0104110000022578Micro Servomotor SG90 180°Arm rotation (controlled by joystick)11,99 lei
0104110000008091Set Motor Pas cu Pas 28BYJ-48 + Driver ULN2003Load lift system16,97 lei
01042100000133449V Battery HolderMotor power supply1,29 lei
0104210000035186Header de Pini Mamă 2x40p 2.54 mmWiring connections2,99 lei × 2 = 5,98 lei

Software

LibraryDescriptionUsage
embassy-rpRP2040 HALAsync GPIO, PWM (servo), timers
embedded-hal-asyncHAL Traits (async)Abstracție pentru GPIO, PWM, input polling
embedded-halHAL Traits (sync)Control basic devices like stepper, joystick, buttons
stepperStepper motor driverControl of stepper motor movement
servo-pwm (sau direct PWM din embassy)Servo motor controlGenerare semnal PWM pentru controlul poziției servomotorului
defmt + defmt-rttLogging FrameworkReal-time embedded debugging over RTT
panic-probePanic HandlerDiagnostic panic messages compatibile cu defmt