Out of curiosity and for fun, I thought it would be neat to make a digital "dashboard" for my car using a raspberry pi. I originally wanted a way to read and graph information like speed and engine RPM but eventually expanded the features to include temperature, gps, air quality monitoring, etc.
Video demonstration (older version of the app but helps demonstrate the graphing)
The dashboard is a combination of python3 apps which run in the background and send information to web pages that is then displayed to the user. There are two web pages:
The pages are hosted using a node server running on the pi. When the pi is started, an entry in /home/pi/.config/lxsession/LXDE-pi/autostart :
@bash /home/pi/piObdDashboard/startApps.sh
automatically executes a bash script which prepares and starts the background apps and browsers to begin showing data to the user. One of the apps that is started is called obdMisc.py which can optionally detect button presses which can restart and shutdown the pi.
Note that if you want to display both pages, you will need 2 screens. Its also possible to modify the pages to have a button to switch between the pages which i will probably implement at a later date.
There are cleaner ways to implement this but it was the cheapest solution.
Mount the Pi and Display in the car to your liking. The rest of this sections goes over how to connect the various sensors to the pi :))
Attach the OBD extension cable to the car's OBD port. This varies depending on the car but is often around the driver's side footwell area. Next, plug the USB OBD adapter into the extension cable, and then into one of the Pi's usb ports
TODO
TODO
TODO
This section automatically assumes that you have installed and booted into Raspberry Pi OS. Lets first make sure that everything is updated before installing any packages:
$ sudo apt update
$ sudo apt full-upgrade
Next, open up preferences and make sure under the interfaces tab that everything is set to 'Enabled' except for the serial console by going to:
Preferences -> Raspberry Pi Configuration -> Interfaces-> Serial Console (set to off)
The serial console needs to be disabled or it will end up interfering with the gps software. However, if you arent using the GPS then this doesn't matter.
Disable Screen blanking so as the pi is displaying data the screen does not turn off:
Preferences -> Raspberry Pi Configuration -> Display -> Screen Blanking (set to off)
(if you dont have certain sensors, you can just skip that software)
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
$ nvm install stable
$ npm install socket.io
$ npm install express
$ pip3 install obd
$ pip3 install "python-socketio[client]"
$ pip3 install adafruit-circuitpython-bno055
$ pip3 install adafruit-circuitpython-pm25
$ pip3 install adafruit-circuitpython-dht
$ pip3 install gps
$ sudo apt install gpsd gpsd-clients python-gps
$ sudo systemctl stop gpsd.socket
$ sudo systemctl disable gpsd.socket
$ sudo apt install unclutter
Finally, lets clone the dashboard repo:
$ git clone https://github.com/brian03079/piObdDashboard.git
Once inside the repo, you can copy the autostart file to
/home/pi/.config/lxsession/LXDE-pi/autostart
Or if you already have an autostart file there, then simply append
@bash /home/pi/piObdDashboard/startApps.sh
to the end of your existing autostart file. The '@' annotation simply tries to rerun the command if it fails the first time, but isn't required. Note that depending on what apps you want to start or omit, you may need to comment out some of the python files or lines in startApps.sh and restartApps.sh.
At this point you should be able to test if things are working by manually running the '.sh' files. If you want to test running an individual program, run the node server followed by the name of the python program you want to run. Then open a browser and point it to whichever page that that program sends data to. TODO
MIT
$ claude mcp add piObdDashboard \
-- python -m otcore.mcp_server <graph>