{"id":27245587,"url":"https://github.com/kuhlwasstolen/e92dashmodender3display","last_synced_at":"2025-04-10T21:28:30.989Z","repository":{"id":272432417,"uuid":"916557825","full_name":"KUHLwasStolen/E92dashModEnder3Display","owner":"KUHLwasStolen","description":"Uses an old LCD from an Ender 3 (Pro) to display additional real-time information from KCAN on the dash of a BMW E92/E90/E91/E93","archived":false,"fork":false,"pushed_at":"2025-03-25T18:10:37.000Z","size":22854,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-03-25T19:24:23.867Z","etag":null,"topics":["arduino","bmw","can-sniffer","canbus","car-modifications","ender3","esp32"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KUHLwasStolen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-01-14T10:32:37.000Z","updated_at":"2025-03-25T18:10:41.000Z","dependencies_parsed_at":"2025-02-23T00:22:52.040Z","dependency_job_id":"d92d190e-7edc-4217-842e-1b10c9e5a758","html_url":"https://github.com/KUHLwasStolen/E92dashModEnder3Display","commit_stats":null,"previous_names":["kuhlwasstolen/e92dashmodender3display"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KUHLwasStolen%2FE92dashModEnder3Display","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KUHLwasStolen%2FE92dashModEnder3Display/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KUHLwasStolen%2FE92dashModEnder3Display/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KUHLwasStolen%2FE92dashModEnder3Display/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KUHLwasStolen","download_url":"https://codeload.github.com/KUHLwasStolen/E92dashModEnder3Display/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248300722,"owners_count":21080769,"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","bmw","can-sniffer","canbus","car-modifications","ender3","esp32"],"created_at":"2025-04-10T21:28:30.516Z","updated_at":"2025-04-10T21:28:30.967Z","avatar_url":"https://github.com/KUHLwasStolen.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# E92dashModEnder3Screen\nChaotic name, simple mission.  \nI have the old LCD from my Creality Ender 3 Pro, which I don't need anymore, because I'm running it headless with Klipper and I want to use it to display some additional information on the dash of my BMW E92.  \nAdditionally the project comes with an optional/modular data logger addon, to record the sniffed telemetry data.  \n\nThe project should be compatible with all cars from the E9x series, but I only have access to an E92, which is why I named the repository like that.  \n\nOn the left you can see the receiver/LCD module mounted in the car and on the right the sender/logging module mounted in the trunk of my E92.  \n\u003cimg src=\"pictures/receiverMountTest.jpg\" alt=\"picture of the receiver module mounted in the car\" width=\"350\"/\u003e \u003cimg src=\"pictures/SenderInstalledTrimHanger.jpg\" alt=\"picture of the installed sender module\" width=\"350\"/\u003e  \nThe sender is responsible for sniffing the CAN-messages and converting them into numbers and the receiver displays those numbers. Various different pages with different numbers/representations are offered.  \nThe data is sent via ESP-NOW.  \nThe sender module is also responsible for logging the data if wished.  \nThe project is somewhat modular, as you can choose to omit logging capabilities and the LED ring on the encoder knob. You can still use the same code.  \n\nHere is some logged sample data.  \nThe x-axis represents the time in seconds from when the drive started and the y-axis is longitudinal acceleration in m/s².\n\u003cimg src=\"pictures/accelLongPlot.png\" alt=\"plot of longitudinal acceleration\"/\u003e  \n*(newer plots will automatically mark min/max values, see below)*\n\nAnd this is a small part of an engine-power plot in kW.  \n\u003cimg src=\"pictures/enginePowPlot.png\" alt=\"plot of engine power data\"/\u003e  \nNotice the annotated minimum and maximum values.  \nThe data plotter program will automatically do this for you and will also automatically not do this for plots where a min/max value makes no sense.  \nAlso notice how the minimum value is negative. This is not an error and means that the engine is slowing down the car which typically happens when you are in gear and no throttle is applied.  \n\n## !!!Disclaimer!!!\nModifying the electrical system of your car can be **dangerous** and may void your warranty!  \nDangerous not only for your car, but also for your health!  \nBefore attempting any of the described modifications in this repository, **fully** read and **fully** understand everything in this README.  \nI do **not** take responsibility for any type of damages, that may occur as a result of the modifications shown here.  \nDo this at your own risk.\n\n## Additions to the ecosystem  \nMy plan is to eventually extend this system with more devices in the car.  \nOnce these projects are started I will link them here.  \nPlanned (in that order):  \n- Wireless \"scroll wheel\"\n    - *BMW iDrive*-inspired controller for the LCD\n    - uses a magnetic encoder to \"replace\" the low-quality one on the LCD\n    - dedicated media buttons\n- Bluetooth audio adapter\n    - Bluetooth to AUX media player\n    - optionally integrates into the system to be controlled by other devices and even the car (through the other devices/detected buttons presses/...)\n    - (will most-likely require the \"scroll wheel\" for integration into the system as we cannot use Bluetooth and ESP-NOW at the same time)\n- Lap timer\n    - standalone lap timer using GPS\n    - can record tracks, provide real-time time-delta, etc.\n    - integration into system possible\n\n## Plan\nThe plan is to tap into the CAN-bus somewhere on the vehicle to gather interesting information.  \nFrom my research it seems the best bus to tap into is the KCAN (Karosserie-CAN = Body-CAN), because it contains the most interesting information.  \nThe speed of the bus is 100 kbit/s and it can be recognized by its twisted pair of orange/green and green wires, where OR/GN stands for CAN-HIGH and GN for CAN-LOW.  \n\nOn my vehicle the easiest place to tap into KCAN seems to be by the rear PDC (park distance control) module.  \nThis module might not be installed on your car.  \nAlternatives include the iDrive and ultrasonic overhead alarm sensor, which are both not installed nor pre-wired on my car.  \nThe only problem with the PDC is that it is mounted in the trunk of the car and I want the information on the dash of my car...  \n\nTo solve this problem I want to have an ESP32 in the trunk of the car attached to the KCAN to collect data.  \nThen I want another ESP32 with the LCD on the dash of the car.  \nCommunication between them is handled via ESP-NOW.  \nThis solution avoids having to run long wires through the car and enables us to mount the CAN-sniffer in the best place in each individual car.  \nAnother advantage is that this allows us to expand the network of devices in the car pretty easily, as we just have to add another receiver which can then handle the data as wished.  \nFrom my testing during development, this approach has been very reliable and also responsive. I have also found similar projects using ESP-NOW, which seems to support my findings.  \n\n#### Relevant information from KCAN\n| CAN-ID | Description | Successful? |\n|---|---|---|\n| 0x0A8 | Engine torque to compute power, brake and clutch status | **Yes** |\n| 0x0AA | Throttle position, engine RPM | **Yes** |\n| 0x0C8 | Steering wheel angle/position | **Yes** |\n| 0x0CE | Wheel speeds | **Yes** |\n| 0x1A0 | Vehicle speed, acceleration | **Yes** |\n| 0x1C2 | PDC (park distance control) sensors | **Yes** |\n| 0x1D0 | Engine-temperature, (intake) air pressure | **Yes** |\n| 0x1D6 | Steering wheel buttons, as not all of them do something in my car | **Yes**, except for disk button (not a top priority though) |\n| 0x2F8 | Time and date information | **Yes** |\n| 0x330 | Range | **Yes** |\n| 0x349 | Fuel level sensors (car has two) | **Yes** |\n| 0x362 | Average fuel consumption, avg. speed | **Yes** |\n| 0x3B0 | Reverse gear status | to be tested |\n| 0x3B4 | Battery voltage | **Yes** |\n\n## Execution of the plan\nTapping into the KCAN in the trunk of the car was successful.  \nI have received all of the expected IDs and the data seems to be accurate/converted properly, which I still have to verify in more detail.  \n**Tip:** If you are attempting the same procedure as me, remove the trim panels in the battery area, not only the battery cover.  \nI did not and it was *very* tedious due to the space constraints (2 hours for splicing 2 wires).  \n**ALSO: Keep away from the black/yellow twisted pair cables going to the battery. They are there for disconnecting the battery in an emergency and should not be messed with!**\n\nAt the moment I get the power for the ESP32 with the MCP from the 12V connector in the trunk.  \nThis connector is on when the ignition is on.  \nThis is a very convenient solution, but not perfect.  \nBecause of the (optional) logging system it would be an advantage if the ESP could stay on for a bit after the car is turned off to close the log file.  \nAdditionally I would like to display a summary of the drive after the car is turned off.  \nI know that there are power lines in the BMW that stay on for a while after the car is locked, but I couldn't find much information about this.  \nBut for now, losing at max a few seconds at the end of the log is fine.  \nAn alternative would be a small battery backup that keeps the ESP alive for a moment after the car is stopped.  \nI'm not a fan of an actual battery, but capacitors might do the trick(?).  \n\n**Attention:** When I first tried to access the KCAN the car was throwing **all** sorts of error messages at me.  \nI assume that the cause for this was, that the ESP was sending acknowledgement messages to the car when a message was received.  \nSeemingly the car does not like this **at all**. Setting the MCP mode to listen-only seems to fix this though.\n\n## Schematic\nThe KiCAD schematic in this repository serves a purely symbolic purpose!  \nI am not an expert at designing circuits and just want to give you a general idea about the correct wiring.  \nAny constructive input on how to improve the schematic is greatly appreciated!\n\n## 3D Models\n3D-printable enclosures and accessories can be found [here](cad/exports).  \n(Yes, most slicers are able to use .step files, most people are not aware of this).  \nAll of the models are in their perfect printing orientation and do not *need* supports.  \nThe only place where you might need a tiny bit of support is [this](cad/exports/SenderModels/Enclosure_bottom.step) model, on the small, straight overhang for the screw terminal.  \n\u003cimg src=\"pictures/Enclosure_bottom_supports.png\" alt=\"Enclosure_bottom support example\" width=\"300\"/\u003e  \n\nThe models include a lot of screw holes which are made to be tapped.  \nIdeally you would use a thread tap for this, but you can also probably just cut the thread by screwing in the bolt that is supposed to go there.  \nTapped threads in 3D-prints are surprisingly strong and durable. They are a great way to easily put threads in all kinds of places/orientations.  \n\n## Logging\nAs mentioned above, the project offers optional logging capability.  \nData is stored to a SD-card in .csv format. For space reasons non-floating-point values in HEX, so not really human readable or ready to easily plot.  \nThe project offers a C++ program to convert the data back into decimal form, which is located [here](logging).  \n\n*Usage:*  \n```\n# first compile the program (only needed once)\ng++ dataConverter.cpp -o dataConverter\n\n# then convert your log\n./dataConverter [your_log.csv]\n```\n\nThen you can plot the converted data into a PDF with the python script in the same folder.  \nThe x-axis will always be the time in seconds since the drive started.  \n\n*Usage:*\n```\n# index: 0 -\u003e time(s), 1 -\u003e clutchPressed, 2-\u003e brakePressed, ...\npython dataPlotter.py [your_log_converted.csv] [column index to plot on y]\n\n# or to plot all columns and export them into separate files\npython dataPlotter.py [your_log_converted.csv] all\n```\n\n## Hardware\nHere you can find a list of materials needed for the project.  \nNote that this list always reflects the current state of the project and might change over time.  \nAlso note that links to products are only meant as a guide what to look for and what/where ***I*** bought them.  \nDepending on your location/preference there might be better/cheaper alternatives.  \nYou can buy the components wherever you want as long as they are the same/similar enough.  \nI am in no way affiliated with the linked sellers and can in no way guarantee their reliability!  \n\n| Description | Quantity | Notes | Link |\n|---|---|---|---|\n| ESP32-WROOM-32 dev module | 2 | most other ESPs should also work, just connect everything to the right GPIOs | https://www.az-delivery.de/en/products/esp32-developmentboard?_pos=1\u0026_psq=esp32+n\u0026_ss=e\u0026_v=1.0 |\n| MCP2515 CAN bus module | 1 | yes, odd choice in combination with ESP32, I just use what I already had | https://www.az-delivery.de/en/products/mcp2515-can-bus-modul?_pos=1\u0026_psq=MCP2515\u0026_ss=e\u0026_v=1.0 |\n| Ender 3 (Pro) LCD | 1 | also an odd choice but, again, I already had one from my 3D printer; I will not leave a link where to buy one as this doesn't make much sense, it would be easier/cheaper to just implement support for other types of displays, which is also planned for the future! | |\n| (SD card module) | (1) | OPTIONAL: this is an optional feature to log the collected telemetry, this can also be added later and doesn't need a code update | https://www.velleman.eu/products/view/sd-card-logging-shield-for-arduino-2-pcs-vma304/?id=435522\u0026lang=en (I have exactly these, didn't buy them there though) |\n| (SD card) | (1) | if you want to use the optional data logger you will need an SD card |  |\n| (WS2812 LED ring 8 pixels) | (1) | OPTIONAL: used to light up the encoder knob on the LCD and play animations | https://www.az-delivery.de/en/products/led-ring-ws2812-5050-rgb?variant=44246024978699 |\n| 10k Ohm resistor | 3 | used as pullups, similar values may also work |  |\n| 560 Ohm resistor | 2 | used for the transistors, similar values may also work |  |\n| (330 Ohm resistor) | 1 | used for the optional LED ring, similar values also work |  |\n| BC547 transistor | 1 | used to switch LCD on/off, can be replaced by a similar NPN |  |\n| S8550 transistor | 1 | used to switch LCD on/off, can be replaced by a similar PNP |  |\n| M3x6 bolts | 0-4 | Depending on config: used to mount the trim hook, SD card cover on the bottom |  |\n| M3x8 bolts | 4-7 | Depending on config: used for the SD card breakout board, mounting the MCP |  |\n| M3x10 bolts | 0-2 | Depending on config: used to hold SD card cover |  |\n| M3x12 bolts | 4-5 | Used for attaching the sender lid and the optional LED ring cover/holder |  |\n| M3 hex nuts | 0-9 | Depending on config: used for the SD card breakout board, accessory mounting |  |\n| (Jumper) wires | 1 metric ton | jumper wires for testing on a bread board |  |\n| Perf board + accessories |  | for the final implementation in the enclosures in the car | https://www.amazon.com/Smraza-Soldering-Electronic-Compatible-Prototype/dp/B07NM68FXK/ref=sr_1_3 (I bought something similar) | \n\n## References\nHere you can find some links with useful information in relation to this project.  \n\n**CAN bus related**\n| Description | Link |\n|---|---|\n| This thread contains **A LOT** of information about the E9x KCAN, but it is also kind of all over the place so you have to dig a bit | https://www.e90post.com/forums/showthread.php?t=177272 |\n| Awesome work on decoding the BMW K-CAN bus system. But watch out, this work wasn't done on an E9X so CAN IDs and formulas *may* differ but should largely be the same. | https://www.loopybunny.co.uk/CarPC/k_can.html |\n| Another project decoding the BMW CAN bus, although it says PT-CAN I found a lot of overlap between the K- and PT-CAN | https://github.com/HeinrichG-V12/E65_ReverseEngineering |\n| A table I found with CAN bus IDs of the E9X and their meanings | https://github.com/kmalinich/node-bmw-ref/blob/master/canbus/e90-tool32-ids.csv |\n\n**Hardware related**\n| Description | Link |\n|---|---|\n| My source for the Ender3 LCD pinout | https://github.com/rfblock/ender3-lcd-arduino |\n| Library used to drive LCD (can be downloaded via Arduino IDE) | https://github.com/olikraus/u8g2 |\n| Library used to drive MCP2515 module (can be downloaded via Arduino IDE) | https://github.com/Seeed-Studio/Seeed_Arduino_CAN |\n| Library used to drive the LED ring (can be downloaded via Arduino IDE) | https://github.com/adafruit/Adafruit_NeoPixel |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuhlwasstolen%2Fe92dashmodender3display","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuhlwasstolen%2Fe92dashmodender3display","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuhlwasstolen%2Fe92dashmodender3display/lists"}