This project creates an animated display for Raspberry Pi with an LCD screen that shows:
- System stats for 20 seconds at boot
- Raspberry Pi logo that transitions from red to green
- Matrix digital rain effect during the green phase
- Stats Display: Shows system information for 20 seconds after boot
- Animated Logo: Smooth color transition between red and green Raspberry Pi logos
- Matrix Rain: Digital rain effect (all green characters, reduced by 30%) appears behind the logo during green phase
- Continuous Loop:
- 30 seconds red logo
- 30 seconds transition to green (matrix rain starts)
- 30 seconds green logo with matrix rain
- 30 seconds transition back to red (matrix rain stops)
sudo apt-get update
sudo apt-get install -y python3-pip python3-pil python3-numpy fonts-noto-cjk
sudo pip3 install evdev pillow numpyCopy the following files to /home/pi/:
display.py- Main display managermatrix.py- Matrix digital rain effectraspberry_animation.py- Raspberry logo animationstats.py- System stats display (from your original setup)raspberry.png- Red raspberry logo imageraspberry_matrix_large.png- Green raspberry logo image
# Copy the images
cp raspberry.png /home/pi/
cp raspberry_matrix_large.png /home/pi/
# Copy the Python files
cp display.py /home/pi/
cp matrix.py /home/pi/
cp raspberry_animation.py /home/pi/Make sure your LCD library is installed at:
/home/pi/LCD_Module_RPI_code/RaspberryPi/python
If it's in a different location, update the path in display.py:
sys.path.append('/home/pi/LCD_Module_RPI_code/RaspberryPi/python')sudo raspi-configNavigate to: Interface Options → SPI → Enable
To run the display automatically at boot:
sudo nano /etc/systemd/system/display.serviceAdd the following content:
[Unit]
Description=Raspberry Pi Display Manager
After=multi-user.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi
ExecStart=/usr/bin/python3 /home/pi/display.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetEnable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable display.service
sudo systemctl start display.servicecd /home/pi
python3 display.pysudo systemctl status display.servicetail -f /home/pi/display.logOr with systemd:
sudo journalctl -u display.service -fsudo systemctl stop display.serviceYou can adjust the timing in the respective files:
display.py:
STATS_DISPLAY_TIME = 20- How long to show stats at boot (seconds)
raspberry_animation.py:
DISPLAY_TIME = 30- How long to hold each color before transitioning (seconds)TRANSITION_TIME = 30- How long each transition takes (seconds)
matrix.py:
self.columns = 20- Number of matrix rain columns (reduced by 30% from ~28)self.update_interval = 0.05- Speed of matrix animation
- Check SPI is enabled:
lsmod | grep spi - Check wiring connections
- Verify LCD library is installed correctly
- Verify image paths in
raspberry_animation.py - Check file permissions:
ls -l /home/pi/raspberry*.png - Make sure PIL can read the images:
python3 -c "from PIL import Image; Image.open('/home/pi/raspberry.png')"
- Install Japanese fonts:
sudo apt-get install fonts-noto-cjk - Alternative fonts will be tried automatically if the primary font isn't available
- Check logs:
sudo journalctl -u display.service -n 50 - Test manually first:
python3 /home/pi/display.py - Verify all file paths are correct
/home/pi/
├── display.py # Main display manager
├── matrix.py # Matrix rain effect
├── raspberry_animation.py # Logo animation handler
├── stats.py # System stats (existing)
├── raspberry.png # Red logo
├── raspberry_matrix_large.png # Green logo
├── display.log # Log file
└── LCD_Module_RPI_code/ # LCD library
└── RaspberryPi/
└── python/
└── lib/
└── LCD_1inch69.py
Boot
│
├─► [0-20s] Stats Display
│
├─► [20-50s] Red Raspberry Logo (static)
│
├─► [50-80s] Transition to Green + Matrix Rain Starts
│
├─► [80-110s] Green Raspberry Logo + Matrix Rain (static)
│
├─► [110-140s] Transition to Red + Matrix Rain Stops
│
└─► [Loop back to 20s]
Edit the blending in raspberry_animation.py to create custom color transitions.
In matrix.py, modify:
self.columns- Number of falling streams- Stream activation probability in the update loop
Replace raspberry.png and raspberry_matrix_large.png with your own images. They should be:
- PNG format with transparency (RGBA)
- Similar aspect ratio
- Clear subject matter (will be scaled to 80% of display height)
Based on the original Raspberry Pi LCD display code with enhancements for animation and matrix effects.