Skip to content

bobster316/RaspberryDisplay

Repository files navigation

Raspberry Pi Animated Display

This project creates an animated display for Raspberry Pi with an LCD screen that shows:

  1. System stats for 20 seconds at boot
  2. Raspberry Pi logo that transitions from red to green
  3. Matrix digital rain effect during the green phase

Features

  • 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)

Installation

1. Install Required Python Packages

sudo apt-get update
sudo apt-get install -y python3-pip python3-pil python3-numpy fonts-noto-cjk
sudo pip3 install evdev pillow numpy

2. Copy Files to Raspberry Pi

Copy the following files to /home/pi/:

  • display.py - Main display manager
  • matrix.py - Matrix digital rain effect
  • raspberry_animation.py - Raspberry logo animation
  • stats.py - System stats display (from your original setup)
  • raspberry.png - Red raspberry logo image
  • raspberry_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/

3. Verify LCD Library Path

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')

4. Enable SPI

sudo raspi-config

Navigate to: Interface Options → SPI → Enable

5. Set Up Autostart (Optional)

To run the display automatically at boot:

sudo nano /etc/systemd/system/display.service

Add 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.target

Enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable display.service
sudo systemctl start display.service

Usage

Manual Run

cd /home/pi
python3 display.py

Check Service Status

sudo systemctl status display.service

View Logs

tail -f /home/pi/display.log

Or with systemd:

sudo journalctl -u display.service -f

Stop the Service

sudo systemctl stop display.service

Timing Configuration

You 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

Troubleshooting

Display doesn't work

  1. Check SPI is enabled: lsmod | grep spi
  2. Check wiring connections
  3. Verify LCD library is installed correctly

Images don't load

  1. Verify image paths in raspberry_animation.py
  2. Check file permissions: ls -l /home/pi/raspberry*.png
  3. Make sure PIL can read the images: python3 -c "from PIL import Image; Image.open('/home/pi/raspberry.png')"

Matrix characters not displaying correctly

  1. Install Japanese fonts: sudo apt-get install fonts-noto-cjk
  2. Alternative fonts will be tried automatically if the primary font isn't available

Service won't start

  1. Check logs: sudo journalctl -u display.service -n 50
  2. Test manually first: python3 /home/pi/display.py
  3. Verify all file paths are correct

File Structure

/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

Animation Timeline

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]

Customization

Change Colors

Edit the blending in raspberry_animation.py to create custom color transitions.

Adjust Matrix Density

In matrix.py, modify:

  • self.columns - Number of falling streams
  • Stream activation probability in the update loop

Different Images

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)

Credits

Based on the original Raspberry Pi LCD display code with enhancements for animation and matrix effects.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors