WIP raspberry-pi dashboard app that pulls and displays data from a car's OBD2 port. Currently is able to display speed, rpm, throttle %, cabin temp and humidity. More functionality and stability will be added as I continue working on it.
Helpful links: https://github.com/autopi-io/py-obd https://dash.plotly.com/ https://socket.io/get-started/chat
Required hardware:
- OBD usb cable Link -bluetooth ones should work, but I opted for a usb cable for better security, reliability, and not having to worry about battery drain -I used an OBDLink EX FORScan OBD Adapter. Others may also work.
- Raspberry pi running raspberry pi os Link
- SD card
- External display Link
- HDMI to micro HDMI cable or adapter
- Power cable for the pi
- Way to power the pi (ie. power bank, cigarette to usb car plug adapter)
Optional hardware:
- (Optional) DHT22/11 temp and humidity sensor Link
- PiJuice HAT uninterruptible power supply Link - This will prevent hard shutdowns on the pi when the car is turned off. I am also tweaking start/shutdown scripts to automate everything.
Dependencies:
- nodejs
- npm
- plotly js
- python-OBD
- socketio (js and python3)
- python3
- express >= 4
- adafruit_dht (if you are using the DHT22/11 sensors)
How to run:
- Make sure your car is on with the engine running
- Make sure the OBD2 cable is plugged into the pi and car
- Launch the server app using the command: node index.js
- Launch the python OBD logger app using the command: python3 obdDash.py
- (Optional) If you have a DHT22/11 sensor hooked up to the pi, launch the python temperature/humidity logger app: python3 tempMonitor.py
- After launching obdDash.py, you should see "Connected to node server!" and the light on the OBD adapter should be blinking green, signifying that communication is happening between the car, obd adapter, and pi.
- Open a web browser and navigate to the web app localhost:3000
- Data should start populating. The axes on the graphs auto resize based on the speed, rpm, and time. Each graph also has adjustment options if you hover over the top right of each.
Notes:
- This is WIP, so there will be lots of bugs :). For example there needs to be error handling and reconnection logic.
- Did I mention bugs :)))?
- Code will be cleaned and refactored as more work is being done
- I have set the polling rate of the web app to .3 seconds. Any faster and the pi will begin to lag and the data will no longer be realtime. Most of the cpu cycles are taken up by plotting the two graphs.
- This dashboard app can also be used in conjunction with the raspberry pi dashcam I made in my other repository: https://github.com/brian03079/piDashcam . The pi 4 seems to handle running both at the same time fine.
- You can adjust most of the code without having to be at your car by running the mockObdGenerator.py in place of the piObd.py. This will run a simulation instead.