A complete photobooth system with Arduino-controlled LED countdown, Python backend, and web applications.
photobooth/
βββ arduino/ # Arduino LED countdown controller
β βββ photobooth/
β β βββ photobooth.ino
β βββ README.md
βββ python/ # Python serial communication backend
β βββ photobooth.py
β βββ Pipfile
β βββ README.md
βββ laravel/ # Laravel image gallery with real-time updates
β βββ app/
β βββ resources/views/ # Gallery interface
β βββ routes/ # API endpoints
β βββ database/ # Migrations
β βββ README.md
βββ README.md # This file
This photobooth system consists of three integrated components:
- Controls a button and 4 LEDs for a visual countdown
- Sends "START" command via serial when button is pressed
- Receives countdown commands ("3", "2", "1", "GO") to control LEDs
- Hardware countdown provides visual feedback
- Long-running script that listens for "START" from Arduino
- Sends countdown sequence to Arduino: "3" β "2" β "1" β "GO"
- Can trigger photo capture and upload to Laravel API
- Uses
pyserialfor serial communication
- Image Upload - PNG and GIF support (up to 10MB)
- REST API - Upload, list, and delete endpoints
- Real-time Updates - Server-Sent Events (SSE) for live gallery updates
- Simple Frontend - Responsive gallery with automatic updates
- Local Storage - Images stored in filesystem with database tracking
- Arduino IDE - for uploading Arduino sketch
- Python 3.x - for running the backend
- PHP 8.2+ - for Laravel application
- Composer - PHP dependency manager
- pipenv - Python dependency management (
pip install pipenv)
# Navigate to Arduino project
cd arduino
# Open photobooth/photobooth.ino in Arduino IDE
# Connect your Arduino via USB
# Select board and port in Arduino IDE
# Upload the sketchWiring:
- Button: Pin 2 β GND (uses internal pull-up)
- LED 1 (Red): Pin 8 β GND (with 220Ξ© resistor)
- LED 2 (Yellow): Pin 9 β GND (with 220Ξ© resistor)
- LED 3 (Yellow): Pin 10 β GND (with 220Ξ© resistor)
- LED 4 (Green): Pin 11 β GND (with 220Ξ© resistor)
See arduino/README.md for detailed wiring diagram.
# Navigate to Python project
cd python
# Install dependencies
pipenv install
# Activate virtual environment
pipenv shell
# List available serial ports to find your Arduino
python photobooth.py --list-ports
# Run the controller (auto-detects port)
python photobooth.py
# OR specify port manually
python photobooth.py --port /dev/cu.usbmodem14101See python/README.md for more options and troubleshooting.
# Navigate to Laravel app
cd laravel
# Install dependencies
composer install
# Start the development server
php artisan serve
# Open http://localhost:8000The application is pre-configured with SQLite database and ready to use. See laravel/README.md for API documentation and advanced configuration.
- User presses button on the Arduino
- Arduino sends
"START"command via serial to Python - Python script receives START and begins countdown sequence
- Python sends countdown commands back to Arduino:
"3"β LED 1 turns on (red)"2"β LEDs 1-2 turn on (red + yellow)"1"β LEDs 1-3 turn on (red + 2 yellows)"GO"β LED 4 turns on (green), then all LEDs turn off
- System resets and waits for next button press
Arduino β Python:
START- Button pressed, begin countdown
Python β Arduino:
3- Display countdown "3" (LED 1 on)2- Display countdown "2" (LEDs 1-2 on)1- Display countdown "1" (LEDs 1-3 on)GO- Display GO signal (LED 4 on, then all off)RESET- Turn off all LEDs and reset
Settings:
- Baud Rate: 9600
- Line Ending: Newline (
\n)
POST /api/images- Upload image (PNG/GIF)GET /api/images- List last 50 imagesDELETE /api/images/{id}- Delete image by IDGET /api/events- Server-Sent Events stream for real-time updates
- Real-time gallery updates via SSE
- Drag-and-drop image upload
- Responsive grid layout
- Connection status indicator
- Smooth animations
See laravel/README.md for complete API documentation and usage examples.
- Upload Arduino sketch and open Serial Monitor (9600 baud) to verify it's working
- Run Python controller - it should connect and print "Connected to Arduino"
- Press the button - you should see:
- Arduino Serial Monitor:
START - Python terminal: Countdown sequence
- LEDs: Sequential countdown pattern
- Arduino Serial Monitor:
- Start Laravel app - visit
http://localhost:8000to view the gallery
Each project has its own README with detailed instructions:
- Arduino: See
arduino/README.md - Python: See
python/README.md - Laravel: See
laravel/README.md
The Laravel application can be deployed to various platforms:
- Laravel Forge - Automated Laravel deployment
- Ploi - Modern hosting platform
- DigitalOcean App Platform - Easy deployment
- AWS/Heroku - Traditional cloud platforms
Build for production:
cd laravel
php artisan config:cache
php artisan route:cache
php artisan view:cacheSee laravel/README.md for detailed deployment configuration.
- Laravel image gallery with real-time updates
- REST API for image management
- Server-Sent Events for live updates
- Python integration to upload photos after countdown
- Camera capture triggered by Arduino countdown
- Live countdown display synchronized with LEDs
- Photo filters and effects
- Print queue management
- Social media sharing
- Multiple language support
- Check USB connection
- Verify correct port in Arduino IDE
- Ensure no other program is using the serial port
- Try unplugging and reconnecting
# List ports
python photobooth.py --list-ports
# Use the correct port
python photobooth.py --port /dev/cu.usbmodem14101- Check wiring connections
- Verify LED polarity (longer leg = anode/+)
- Test LEDs with a simple Arduino blink sketch
- Check resistor values (220Ξ© recommended)
- Ensure PHP 8.2+ is installed:
php -v - Check storage permissions:
chmod -R 775 storage bootstrap/cache - Clear cache:
php artisan cache:clear - Re-create storage link:
php artisan storage:link
This project is open source. Feel free to use and modify as needed.
Built with: