Git Product home page Git Product logo

migmartinez / piobddashboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brian03079/piobddashboard

0.0 1.0 0.0 3.17 MB

WIP Dashboard application that collects and displays realtime car telemetry information such as speed, rpm, throttle, etc using a raspberry pi. A short clip of it running can be found here: https://www.youtube.com/watch?v=rTwZY9AT3mg&ab_channel=BrianChan

License: MIT License

HTML 61.83% JavaScript 4.26% Python 27.59% CSS 4.12% Shell 2.20%

piobddashboard's Introduction

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:

  1. 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.
  2. Raspberry pi running raspberry pi os Link
  3. SD card
  4. External display Link
  5. HDMI to micro HDMI cable or adapter
  6. Power cable for the pi
  7. Way to power the pi (ie. power bank, cigarette to usb car plug adapter)

Optional hardware:

  1. (Optional) DHT22/11 temp and humidity sensor Link
  2. 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:

  1. nodejs
  2. npm
  3. plotly js
  4. python-OBD
  5. socketio (js and python3)
  6. python3
  7. express >= 4
  8. adafruit_dht (if you are using the DHT22/11 sensors)

How to run:

  1. Make sure your car is on with the engine running
  2. Make sure the OBD2 cable is plugged into the pi and car
  3. Launch the server app using the command: node index.js
  4. Launch the python OBD logger app using the command: python3 obdDash.py
  5. (Optional) If you have a DHT22/11 sensor hooked up to the pi, launch the python temperature/humidity logger app: python3 tempMonitor.py
  6. 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.
  7. Open a web browser and navigate to the web app localhost:3000
  8. 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:

  1. This is WIP, so there will be lots of bugs :). For example there needs to be error handling and reconnection logic.
  2. Did I mention bugs :)))?
  3. Code will be cleaned and refactored as more work is being done
  4. 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.
  5. 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.
  6. 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.

piobddashboard's People

Contributors

brian03079 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.