Skip to main content
Version: ACS CC

Laser Turret

This project rekindles the nostalgic thrill of manually aiming and firing, delivering a classic targeting experience through an intuitive laser turret interface.

info

Author: Neagoe Mario-Alexandru
GitHub Project Link: Laser Turret - Repository

Description

Laser Turret is an interactive system that uses a Raspberry Pi Pico 2W, allowing users to manually control a laser-firing turret through a joystick and button interface, with real-time feedback provided via an LCD display, LEDs, and a buzzer. The turret incorporates servomotors for two-axis movement, a laser module, and an ultrasonic sensor for distance measurement, all integrated using Rust and the Embassy async framework. Some laboratories I found relevent for the project I am implementing, are:

  • Lab 2: GPIO
  • Lab 3: PWM & ADC
  • Lab 5: Interfacing SPI devices

Motivation

My interest in robotics and embedded systems sparked the idea for this laser turret project. It’s a fun and challenging way to bring together my technical skills and curiosity about interactive hardware. I’ve always been drawn to projects that involve physical movement and precise control, and building a turret that tracks and fires offers exactly that. Beyond the technical learning, there's a certain nostalgic appeal to manually aiming and firing, reminiscent of classic arcade games and sci-fi interfaces. Creating this turret gives me a meaningful opportunity to deepen my understanding of real-time systems and hardware-software integration.

Architecture

Diagram

Schematic Diagram

A schematic diagram is provided to illustrate the connections and layout of the components.

Raspberry Pi Pico 2W

  • Role: Acts as the central controller for all functions.
  • Connections:
    • Interfaces with the LCD Display, Ultrasonic Distance Sensor, Servomotors, Buzzer, Laser, LEDs, Buttons and Joystick.

LCD Display

  • Interface: SPI
  • Connections:
  • Role: Displays distance and 'ammunition' left.

Servomotors

  • Interface: PWM
  • Role: Move the turret on two axis.

Laser

  • Interface: GPIO
  • Role: Allow user input for firing the turret.

Buttons and Joystick

  • Interface: GPIO
  • Connections:
    • Connected to various GPIO pins for different controls (e.g., move controls, laser).
  • Role: Allow user input for controlling the turret and the reload mechanism.

LEDs and Buzzer

  • Interface: PWM
  • Role: Provide visual and audio feedback during operation (e.g., sound for shooting, LEDs that display ammo left or the need for reload).

Ultrasonic Distance Sensor

  • Interface: GPIO
  • Role: Provide visual and audio feedback during operation (e.g., sound for shooting, LEDs that display ammo left or the need for reload).

Log

Week 6 - 12 May

Week 7 - 19 May

Week 20 - 26 May

Hardware

The Raspberry Pi Pico 2W serves as the central controller for the laser turret system. The Pico 2W interfaces with a wide range of peripherals such as an SPI LCD display, ultrasonic distance sensor, servomotors for turret movement, a laser firing system, input controls, and both visual and audio feedback components.

The LCD Display connects via SPI and is responsible for displaying key information such as the measured distance to target and remaining ammunition, providing the user with real-time operational feedback.

The servomotors, controlled through PWM, allow precise two-axis movement of the turret, enabling accurate manual or semi-automated aiming.

The laser, activated via a GPIO pin, represents the firing mechanism and responds directly to user input through buttons.

A set of buttons and a joystick, connected to general GPIO pins, form the primary input system. These controls allow the user to move the turret, fire the laser, and trigger reload actions.

LEDs and a buzzer, driven using PWM, offer immersive visual and audio feedback during operation. They signal events such as firing, reload status, and ammo count.

The ultrasonic distance sensor, connected via GPIO, enables the turret to measure the distance to a potential target. This data is used for display purposes and in a real scenario it could be extended for safety or targeting logic in future iterations.

Schematics

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller40 RON x 2
Kit Pan/Tilt + ServomotorsSystem for moving on 2 axis50 RON
Ultrasonic Distance Sensor HC-SR04+Distance to target15 RON
Modul LCD 1.44'' (128x128 px)Data display28 RON
KY-008 Laser ModuleLaser for the turret4 RON
Electronic components: LEDs, buttons, wires resistors, buzzerElectronic Components25 RON

Software

LibraryDescriptionUsage
embedded-halHardware Abstraction Layer for embedded systemsUsed for SPI, GPIO and PWM control
embassy-rpEmbassy HAL for Raspberry Pi Pico (RP2040)Provides support for GPIO, PWM, SPI, and more on Pico 2W
embassyModern, lightweight, and safe async framework for embedded systemsUsed for async task scheduling, timers, and peripheral drivers
st7735-lcdDriver for ST7735 LCD displaysUsed to control the SPI LCD screen
embedded-graphics2D graphics library for embedded systemsUsed for rendering text on display
logLogging facade for RustUsed for logging debug and informational messages
panic-probeA panic handler for embedded systemsUsed for handling panics and debugging
static-cellProvides safe, static storage for data that outlives the main functionUsed for managing static data
fixedFixed-point arithmetic libraryUsed for precise timing calculations