SaPin is an interactive and festive project based on two Raspberry Pi devices, designed to capture the spirit of Christmas through lights, music, and animations. It combines technology and creativity to create a magical and immersive experience.
-
🎅 Two operating modes:
-
Mode 1: Lights always on, music (Jingle Bells) played through a buzzer, and a sparkling animation on an 8x8 LED matrix.
-🎵 New! Music and lights are now synchronized for a more immersive experience!
-
Mode 2: Lights and the servo motor activate only in the dark, thanks to a light sensor.
-
-
✨ Animated decoration: A servo motor moves a festive decoration.
-
💡 WS2811 addressable LED string: LED lights controlled independently through a TCP connection.
-
🔌 TCP connection: Communication between two Raspberry Pi devices for distributed management of features.
- 2 Raspberry Pi devices (one server, one client)
- Digital Push Button Keystudio
- Keystudio Photocell Sensor with ADS1115 module
- Keystudio Passive Buzzer
- WS2811 Digital LED String (50 LEDs)
- Micro Servo 9G
- Keystudio 8x8 LED Matrix (KS0522)
- External power supply for the LED string
Before the installation you need to :
$ sudo apt update -y
$ sudo apt upgrade -y
Instruction will be available soon for i2c device Client : Library adafruit-circuitpython-ht16k33
$ pip3 install adafruit-circuitpython-ht16k33 --break-system-packages
Server : Library rpi_ws281x
$ sudo apt install python3-pip python3-dev build-essential
$ sudo pip3 install rpi_ws281x
GPIO Pin | Component | Description |
---|---|---|
GPIO 17 | Servo motor | Movement control |
GPIO 18 | Passive buzzer | Music playback |
GPIO 27 | Push button | Mode switching |
SDA/SCL | 8x8 LED matrix and ADS1115 | I²C communication |
ADS1115 | Photocell sensor | Light intensity measurement |
GPIO Pin | Component | Description |
---|---|---|
GPIO 12 | WS2811 LED string | Light control |
On the Raspberry Pi controlling the LED string, run the server script:
$ python3 tcp_serveur.py
On the second Raspberry Pi, run the client script:
$ python3 main.py
- Mode 2 (default): Automatically activates in the dark. The lights and servo motor will only work when the photocell sensor detects low light.
- Mode 1: Press the button to activate all features, including:
- Constantly lit lights
- Music playback (Jingle Bells), now synchronized with the LED lights
- Sparkling animation on the 8x8 LED matrix
To stop the program:
- Stop the client script:
Ctrl+C
- Then stop the server script:
Ctrl+C
- ht16k33 Library (8x8 LED matrix): Adafruit HT16K33 Matrix8x8 API
- WS281 Library (LED string): rpi-ws281x-python GitHub
- Musical note frquencies: Musical note frequencies
- Jingle bell: Jingle bell - Beginner version
- Python Threads Tutorial: Multithreading in Python - Set 1
🎥 Watch SaPin in action! Now with music synchronized with the LED lights!
🎶 In this updated version, the LED lights are now synchronized with the music in Mode 1 for an even more immersive experience.
🔔 This was the first version of SaPin before the music0light synchronization update. It's still available if you want to see how the project evolved!
This project is developed as part of the course PROGRAMMATION DE PLATEFORMES EMBARQUÉES | 420-314-MV.
Copyright © [2024] @Loulouplou and @KarolannMauger.
All rights reserved. Redistribution, modification, and commercial use are strictly prohibited.
🎅 Happy holidays from the saPin team!