Skip to content

pcs-electronics/bird-meter-rpi-lcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bird Meter Raspberry Pi LCD

Display live Bird 5019 meter readings on a Raspberry Pi framebuffer LCD with large, easy-to-read values.

Tested with a Raspberry Pi Zero 2 W microcomputer and a 640x480 Waveshare LCD.

Many Bird wideband power sensors come with outdated drivers, so they do not connect cleanly to modern operating systems. Using the RS-232 interface and a Raspberry Pi LCD avoids that dependency and provides a simple standalone display.

This is why we need to make our own indicator instead of throwing away expensive hardware.

Bird Meter LCD Screenshot

Overview

bird_meter_lcd.py connects to a Bird 5019 / 5012-family sensor over RS-232, reads live measurement data, and renders a full-screen dashboard to /dev/fb0.

In most cases, the script automatically detects the serial port and keeps handling device connection and removal by retrying when the adapter or sensor disappears and reconnecting when it comes back.

The dashboard shows:

  • forward power
  • reflected power
  • peak power
  • burst power
  • temperature
  • SWR
  • selected filter bandwidth in the header line
  • ACK status
  • active serial port

If no serial adapter is found, or the sensor does not respond, the script switches to a full-screen error message and keeps retrying.

Features

  • full-screen framebuffer output for small Pi LCDs
  • large numeric display for live RF power readings
  • configurable Bird filter bandwidth from the command line
  • automatic serial-port detection for /dev/ttyUSB* and /dev/ttyACM*
  • optional PNG snapshot saving for debugging
  • continuous reconnect behavior after serial or sensor failures

Repository Layout

  • bird_meter_lcd.py: main LCD dashboard script
  • bird-meter-lcd.service: example systemd service file for automatic startup
  • README.md: setup and usage guide
  • LICENSE: MIT license
  • AGENTS.md: repository-specific editing guidance

Requirements

Hardware

  • Raspberry Pi with a working /dev/fb0 framebuffer LCD
  • Bird 5019 or compatible 5012-family meter
  • external 7-18 VDC power for the Bird sensor
  • real USB-to-RS-232 converter cable

Do not use a USB-to-TTL adapter for the Bird meter. You need a USB-to-RS-232 9-pin adapter, not just a USB-to-serial TTL adapter. You will also most likely need a micro-USB to USB-A adapter cable for the Raspberry Pi.

Software

  • Python 3
  • pyserial
  • Pillow
  • the sibling bird-meter-hack folder next to this repository

This project imports the Bird protocol implementation from ../bird-meter-hack/bird_5019_serial_read.py.

Bird's original Series 5000 GitHub repository:

https://github.com/Bird-Technologies/RF-Power-Sensors/tree/main/Series%205000

Installation

Install the Python dependencies on the Pi:

sudo apt-get update
sudo apt-get install -y python3-serial python3-pil

Before running the program, install and configure the LCD framebuffer drivers according to the Waveshare manual:

https://www.waveshare.com/wiki/3.5inch_DPI_LCD

Download or copy the required folders to the Pi so they sit next to each other under /home/pi:

  • /home/pi/bird-meter-rpi-lcd
  • /home/pi/bird-meter-hack

If you are using Git, clone your copies of the repositories into /home/pi:

cd /home/pi
git clone https://github.com/pcs-electronics/bird-meter-rpi-lcd 
git clone https://github.com/pcs-electronics/bird-meter-hack

If you are copying the files manually instead, keep the same folder names and locations because bird_meter_lcd.py imports ../bird-meter-hack/bird_5019_serial_read.py.

Usage

Run with the default detected serial port:

python3 bird_meter_lcd.py

Run with an explicit serial port:

python3 bird_meter_lcd.py --port /dev/ttyUSB0

Select a filter bandwidth:

python3 bird_meter_lcd.py --filter 4k5
python3 bird_meter_lcd.py --filter 400khz
python3 bird_meter_lcd.py --filter 10mhz

Enable PNG snapshot saving:

python3 bird_meter_lcd.py --save-snapshot

Use a different framebuffer device:

python3 bird_meter_lcd.py --fb /dev/fb1

Automatic Startup

To start the program automatically when the Raspberry Pi boots, install the included systemd service.

Install the included service file:

sudo install -m 0644 /home/pi/bird-meter-rpi-lcd/bird-meter-lcd.service /etc/systemd/system/bird-meter-lcd.service

The included service runs:

  • /usr/bin/python3 /home/pi/bird-meter-rpi-lcd/bird_meter_lcd.py
  • as user pi
  • with FBDEV=/dev/fb0
  • with automatic restart enabled

Reload systemd, enable the service, and start it:

sudo systemctl daemon-reload
sudo systemctl enable bird-meter-lcd.service
sudo systemctl start bird-meter-lcd.service

Check service status:

sudo systemctl status bird-meter-lcd.service

View the service log:

journalctl -u bird-meter-lcd.service -f

If you want to pass fixed command-line options such as a specific serial port or --save-snapshot, add them to the ExecStart= line in the service file.

Remote Development And Debugging

This project is easy to develop remotely on the Raspberry Pi by using a local VS Code setup together with AI tools, like GPT-5.4.

To avoid typing the SSH password every time, copy your public key to the Pi once:

ssh-copy-id pi@<raspberry-pi-ip-address>

If ssh-copy-id is not available, append the contents of your public key file (for example ~/.ssh/id_rsa.pub or ~/.ssh/id_ed25519.pub) to /home/pi/.ssh/authorized_keys on the Raspberry Pi.

If you want to work on the Raspberry Pi files through a local folder, install sshfs on your PC and mount the Pi home directory:

sudo apt-get install -y sshfs
mkdir -p ~/zero2w
sshfs pi@192.168.1.112:/home/pi ~/zero2w

This maps the Raspberry Pi /home/pi folder to the local ~/zero2w folder.

When using AI tools for remote work, tell the AI how to access the Raspberry Pi command line. For example:

ssh pi@192.168.1.112

Typical workflow:

  1. Open the Pi files from your PC by using VS Code Remote-SSH or an SSH-mounted filesystem.
  2. Edit the Python files locally in VS Code while the files stay on the Pi.
  3. Use AI tools, like GPT-5.4, to help inspect the code, suggest patches, explain errors, update the README, or generate service files.
  4. Run checks on the Pi from the VS Code terminal, for example:
python3 -m py_compile bird_meter_lcd.py
python3 bird_meter_lcd.py

For service-based debugging:

sudo systemctl status bird-meter-lcd.service
journalctl -u bird-meter-lcd.service -f

If you want to test the script interactively while the service exists, stop the service first:

sudo systemctl stop bird-meter-lcd.service
python3 /home/pi/bird-meter-rpi-lcd/bird_meter_lcd.py

When testing is finished, start the service again:

sudo systemctl start bird-meter-lcd.service

This approach lets you keep the comfort of a local editor while still working directly on the Raspberry Pi hardware, display, and serial device.

Filter Bandwidth Values

The following values are accepted:

  • 4k5, 4.5khz, or 4500
  • 400k, 400khz, or 400000
  • 10m, 10mhz, or 10000000

If --filter is omitted, the default is 4.5 kHz.

Note: the Bird dataset field on this meter can continue to report 4500 Hz even after a different filter is configured. The LCD displays the configured command-line filter value so the screen reflects the selected mode.

The default filter is 4.5 kHz, and the default LCD update and retry delays are both zero, so the display refreshes again immediately after each completed meter read.

Command-Line Options

Use --help to see all available command-line parameters:

python3 bird_meter_lcd.py --help

License

This project is licensed under the MIT License. See LICENSE for details.

The program was created by using GPT-5.4

About

Display live Bird 5019 meter readings on a Raspberry Pi framebuffer LCD with large, easy-to-read values.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages