{"id":15059421,"url":"https://github.com/powerbroker2/elmduino","last_synced_at":"2025-05-15T04:05:04.411Z","repository":{"id":36390315,"uuid":"185312477","full_name":"PowerBroker2/ELMduino","owner":"PowerBroker2","description":"Arduino OBD-II Bluetooth Scanner Interface Library for Car Hacking Projects","archived":false,"fork":false,"pushed_at":"2025-04-02T22:23:51.000Z","size":704,"stargazers_count":760,"open_issues_count":8,"forks_count":131,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-05-15T04:04:58.407Z","etag":null,"topics":["arduino","car","carhacking","elm","elm327","heads-up-display","hud","obd","obd2","obdii","obdii-library","vehicle"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerBroker2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-07T03:15:41.000Z","updated_at":"2025-05-05T08:36:43.000Z","dependencies_parsed_at":"2022-08-03T08:15:40.506Z","dependency_job_id":"d5c20b16-df88-45e2-9a6a-59b391f88554","html_url":"https://github.com/PowerBroker2/ELMduino","commit_stats":{"total_commits":247,"total_committers":9,"mean_commits":"27.444444444444443","dds":0.2834008097165992,"last_synced_commit":"636aa957f6f7d6ff01bf41fbfce004c1efc5883c"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerBroker2%2FELMduino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerBroker2%2FELMduino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerBroker2%2FELMduino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerBroker2%2FELMduino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerBroker2","download_url":"https://codeload.github.com/PowerBroker2/ELMduino/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270643,"owners_count":22042859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","car","carhacking","elm","elm327","heads-up-display","hud","obd","obd2","obdii","obdii-library","vehicle"],"created_at":"2024-09-24T22:43:24.544Z","updated_at":"2025-05-15T04:04:59.395Z","avatar_url":"https://github.com/PowerBroker2.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ELMduino\n[![GitHub version](https://badge.fury.io/gh/PowerBroker2%2FELMduino.svg)](https://badge.fury.io/gh/PowerBroker2%2FELMduino) [![arduino-library-badge](https://www.ardu-badge.com/badge/ELMDuino.svg?)](https://www.ardu-badge.com/ELMDuino)\u003cbr /\u003e\u003cbr /\u003e\nThis is a simple yet powerful library to effortlessly interface your Arduino with an ELM327 OBD-II scanner. With this library, you can query any and all OBD-II supported PIDs to collect a wide variety of car data (i.e. speed, rpm, engine temp, etc). Also, you can use ELMduino to view and clear your car's trouble codes - no need to go to AutoZone anymore!\n\n# Example Project:\n\n[![youtube](https://user-images.githubusercontent.com/20977405/102416634-2fa0ab80-3fc8-11eb-8baf-d24a6a27bd3f.PNG)](https://www.youtube.com/watch?v=JxBvukUipc4\u0026feature=youtu.be)\n\n# Install:\nInstall ELMduino using the Arduino IDE's Libraries Manager (search \"ELMduino.h\")\n\n# Available Features:\nSee the contents of ELMduino.h for lists of supported OBD PID processing functions, OBD protocols, standard PIDs, and AT commands. The associated functions are documented in \"doc strings\" in ELMduino.cpp.\n\n# Note:\nIf you're having difficulty in connecting/keeping connection to your ELM327, try using 38400 baud instead of 115200. If you still have trouble, try all other possible bauds. Lastly, if using BluetoothSerial on an ESP32, try using the ELM327's MAC address instead of the device name \"OBDII\" and [remove paired devices using this sketch](https://github.com/espressif/arduino-esp32/blob/master/libraries/BluetoothSerial/examples/bt_remove_paired_devices/bt_remove_paired_devices.ino).\n\n# Concept of Execution\nThe library is non-blocking. This means when you query a PID e.g. `myELM327.rpm()`, the code does not wait around for the response, which would block your other code in the main loop from executing. With ELMDuino, your main loop can continue do other tasks. To make this work, you need to repeatedly call the PID query function and check the non-blocking receive state (`myELM327.nb_rx_state`) until it is equal to `ELM_SUCCESS`. If the status is not `ELM_SUCCESS`, the library could still be waiting for a response to be received. This is indicated by `myELM327.nb_rx_state` being equal to `ELM_GETTING_MSG`. If the status is not equal to either of these values (ELM_SUCCESS or ELM_GETTING_MSG), it indicates an error has occurred. You can call `myELM327.printError()` to check what the problem was. See the simple example below which queries the engine speed in RPM.\n\nJust to be clear, do not try to query more than one PID at a time. You must wait for the current PID query to complete before starting the next one.\n\n# Example Code:\n```C++\n#include \"ELMduino.h\"\n\n\n\n\n#define ELM_PORT Serial1\n\n\n\n\nconst bool DEBUG        = true;\nconst int  TIMEOUT      = 2000;\nconst bool HALT_ON_FAIL = false;\n\n\n\n\nELM327 myELM327;\n\n\n\n\ntypedef enum { ENG_RPM,\n               SPEED } obd_pid_states;\nobd_pid_states obd_state = ENG_RPM;\n\nfloat rpm = 0;\nfloat mph = 0;\n\n\n\n\nvoid setup()\n{\n  Serial.begin(115200);\n  ELM_PORT.begin(115200);\n\n  Serial.println(\"Attempting to connect to ELM327...\");\n\n  if (!myELM327.begin(ELM_PORT, DEBUG, TIMEOUT))\n  {\n    Serial.println(\"Couldn't connect to OBD scanner\");\n\n    if (HALT_ON_FAIL)\n      while (1);\n  }\n\n  Serial.println(\"Connected to ELM327\");\n}\n\n\n\n\nvoid loop()\n{\n  switch (obd_state)\n  {\n    case ENG_RPM:\n    {\n      rpm = myELM327.rpm();\n      \n      if (myELM327.nb_rx_state == ELM_SUCCESS)\n      {\n        Serial.print(\"rpm: \");\n        Serial.println(rpm);\n        obd_state = SPEED;\n      }\n      else if (myELM327.nb_rx_state != ELM_GETTING_MSG)\n      {\n        myELM327.printError();\n        obd_state = SPEED;\n      }\n      \n      break;\n    }\n    \n    case SPEED:\n    {\n      mph = myELM327.mph();\n      \n      if (myELM327.nb_rx_state == ELM_SUCCESS)\n      {\n        Serial.print(\"mph: \");\n        Serial.println(mph);\n        obd_state = ENG_RPM;\n      }\n      else if (myELM327.nb_rx_state != ELM_GETTING_MSG)\n      {\n        myELM327.printError();\n        obd_state = ENG_RPM;\n      }\n      \n      break;\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerbroker2%2Felmduino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowerbroker2%2Felmduino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerbroker2%2Felmduino/lists"}