This is an old revision of the document!


Automatic Laser Toy for Cats

Introduction

This project is an interactive pet entertainment device built around an ESP32-CAM module, designed to keep cats engaged and active when their owners are away from home. The system combines real-time video streaming with a remotely-controlled pan-tilt camera mount and a laser pointer that can be operated manually or move autonomously in random patterns.

The idea started from a simple idea, that indoor cats often become bored or stressed when left alone for extended periods, and existing solutions (automatic laser toys, pet cameras) are usually expensive.

The project aims to:

  • Provide a live video feed of the cat's environment from any web browser
  • Allow remote control of camera orientation through pan and tilt servos
  • Stimulate the cat's hunting instinct using a controllable laser pointer
  • Enable an autonomous “play mode” with randomized laser movement
  • Monitor environmental conditions (temperature, humidity) for the pet's well-being

The device is useful both for the cat (mental stimulation, exercise) and for the owner (peace of mind, ability to interact with the pet remotely, and a fun way to engage with the animal). The whole system is built from low-cost components and open-source software, making it an accessible alternative to commercial pet cameras.

General Description

The system is built around an ESP32-CAM module which acts as the central controller, handling video streaming, peripheral control, and serving the web-based user interface. The user interacts with the system through any modern web browser over WiFi.

Block diagram

Block diagram

Modules description

  • ESP32-CAM controller | main MCU running the firmware. Hosts an HTTP server on port 80 (control + UI) and a streaming server on port 81 (MJPEG video). Manages all peripherals and exposes a JSON-based API.
  • OV2640 camera | 2MP image sensor integrated with the ESP32-CAM. Provides the live MJPEG video stream and communicates via I2C (SCCB protocol) and parallel data interface.
  • Pan-Tilt servos | 2x SG90 micro servo motors arranged on a 2-axis bracket. The pan servo (horizontal rotation, GPIO 14) and tilt servo (vertical rotation, GPIO 15) are controlled via PWM signals at 50 Hz.
  • Laser pointer (KY-008) | a low-power 650nm red laser module mounted near the camera. Controlled through GPIO 13 as a simple digital output (HIGH/LOW).
  • DHT11 sensor | single-wire digital sensor for temperature and humidity measurement. Connected to GPIO 2. Data is exposed through the web interface for environmental monitoring.
  • Power supply | 5V external supply (separate from the USB programmer) is required because the servos and laser draw current beyond what the USB port can provide reliably.

Interaction flow

The user opens the web interface in a browser. The browser loads the HTML page from the ESP32 and starts receiving the video stream on port 81. When the user presses a control button (move servo, toggle laser, start auto mode), the browser sends an HTTP GET request to the ESP32, which processes it, actuates the corresponding peripheral, and replies with a small JSON status update. The web interface periodically polls the ``/climate`` endpoint to refresh the temperature and humidity readings.

Hardware Design

Bill of Materials

Component Quantity Role Price (RON) Source
ESP32-CAM 1 Main controller, WiFi, video streaming 67.40 RON ESP32-CAM eMAG
OV2640 (2MP) 1 Camera sensor integrated with ESP32-CAM, MJPEG stream - Included with ESP32-CAM
USB-TTL programmer CH340 1 Firmware upload only - Included with ESP32-CAM
SG90 Servo motor 2 Pan and tilt mechanical movement 10.29 RON SG90 ArduShop
KY-008 laser module 1 Visual stimulus for the cat 4.36 RON KY-008 ArduShop
DHT11 sensor module 1 Temperature and humidity monitoring 8.50 RON DHT11 ArduShop
LM2596 Step-down converter 1 9V to 5V voltage regulation 16.90 RON LM2596 ArduShop
USB-C PD 9V power adapter 1 power input 12.74 RON PD-USBC-9V ArduShop
Pan-tilt 2-axis kit 1 Mechanical structure for camera movement <PRET> KIT Pan-Tilt ArduShop
Prototype PCB board 1 Final soldered assembly 3.92 RON PCB ArduShop
mother - father wires 20 Interconnections 8.72 RON MF wire ArduShop
Total ~XXX RON
pm/prj2026/bianca.popa1106/andrei_teodor.dobre.1777884107.txt.gz · Last modified: 2026/05/04 11:41 by andrei_teodor.dobre
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0