Skip to content

dubniczky/Racetimer

Repository files navigation

RaceTimer

A Raspberry Pi application for timing races with GPIO inputs and a UI

Technical Specs

  • SOC: Raspberry Pi B+
  • Inputs: 5 buttons connected to GPIO pins
  • Outputs: Horn signal on GPIO pin + HD UI on mini HDMI
  • GPIO Provider: pigpiod system level service as root
  • UI + Logic: ElectronJS as system service
  • Backend: NodeJS v18.10

Technical Overview

Reading information from the GPIO headers requires root privileges on said computer. This means that it's difficult to connect it with traditional UI-based applications which should not be ran as root. This solution utilized the pigpiod service running as the root to provide an interface for other local users to connect via localhost. The ElectronJS application connects to this API and polls the information on an event-driven basis. The applications is added as a service with the name racetimer to start it up with the system.

Usage

  1. Copy the project onto your Raspberry Pi device
  2. Install nvm if not yet installed: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash (v0.40.2 is the latest at the time of this project). Restart the terminal session afterwards
  3. Install NodejS 18: nvm install 18 && nvm use 18
  4. Edit the racetimer.service file and update the racetimer user name in Service.User, Service.WorkingDirectory, and Service.Environment to the user that will be automatically logged in when the device boots up (likely your current user whoami)
  5. Compile and install the service: ./install.sh
  6. Restart the device, and the application should start up automatically in fullscreen mode

GPIO Headers

For this projets a Raspberry Pi B+ was used, but it can be easily reconfigured to work for any by editing the pin configuration in main.js

Physical Pin GPIO Header Unconnected Voltage Logical Function
11 17 LOW Reset Button
12 18 LOW Start Button
13 27 - Horn Output
3 2 HIGH Contestant 1 Button
5 3 HIGH Contestant 2 Button
7 4 HIGH Contestant 3 Button
8 14 HIGH Contestant 3 Button
10 15 HIGH Contestant 4 Button

Sources

About

A Raspberry Pi application for timing races with GPIO inputs and a UI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors