Skip to content

Code and details of a Raspberry PI based laser pointer turret

Notifications You must be signed in to change notification settings

mampersat/laser-pointer

Repository files navigation

laser-pointer

Laser mounted on servo turret to point to interesting locations on a map

Description

I have a large map (9ft x 6ft) in my home office. It's a triumph of cartography really. You can get it here for $100. Installation is the same as wall paper.

I had some servos (from R/C airplane hobby) and an extra raspberry pi and was inspired by an online tutorial (can't find link) in which the creator used hot glue to stick the servos and laser together... so now I have a thing which points a laser at my map.

Future goal is to have it read news stories from an API, figure out their location and point the laser at them. Like this weeks story about the ship stuck in the Suez canal.

Communications

sequenceDiagram
    participant Browser as Web Browser
    participant Hub as MQTT Hub <br> broker.hivemq.com
    participant Turret as Laser Turret Device

    Browser->>+Hub: Publish "target coordinates"

    Hub->>+Turret: Forward "target coordinates"

    Turret->>+Turret: Point laser to coordinates
Loading

Wiring

flowchart
    servo1 -- black(-) --> pico38[pico pin 38]
    servo1 -- red(+) --> pico36[pico pin 36]
    servo1 -- white --> pico22[pico pin 22]

    servo2 -- black(-) --> pico38[pico pin 38]
    servo2 -- red(+) --> pico36[pico pin 36]
    servo2 -- white --> pico24[pico pin 24]

    laser -- black(-) --> pico38[pico pin 38]
    laser -- white --> pico16[pico pin 16]
Loading

Parts

Parts

Part Price Link
Raspberry PI pico W $10 Amazon 2 pack
2 Servo's (futaba S3107 for now... might update for more accuracy) $1.87 Amazon 10 pack
Laser $1.05 Amazon 5 pack
Hot glue
A base (block of wood for me)
Wiring (I have tons of wiring stuff from other projects)
A map $100 National Geographic NatGeo 9'x6'

I tried to get this working with an ESP8266, but getting 5V to the servos was proving to be a PITA and the project was sitting next to a raspberry pi so I switched. Then another project had me buying pi pico's so I switched again.

Callibration

Point to a well known point and allow user to adjust with keyboard

Detecting keyboard input is IMPOSSIBLE I think. pygame + pynput require a display to be connected

Honalulu Brisbane

Projection / Linear Extrapolation

Not 100% perfect, but here's the plan

  1. Manually locate a bunch of points using calibration setup
  2. To project a new point, find the 2 closest and extrapolate along a line between them

Raspberry PI pico setup

installint umqtt library

import mip
mip.install("umqtt.simple")

Proposed Enhancements

  • Mount camera as well
  • Facial Recognition
  • Target people by name (spin the bottle type action)
  • Recognize things in the room
  • Target things

2024-06-16

x and y range is 0 to 1000

servo x left = 970000 right = 470000

servo y top = 1370000 bottom = 1670000

About

Code and details of a Raspberry PI based laser pointer turret

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published