I just wanted to see what’s going on sensor-wise so that I might build a better “Fumes” indicator, perhaps brighter, louder, send me a text, or even an audio message from my mother about procrastinating, etc. – whatever to get my attention.
This is a pretty short post; I’m glossing over connecting to the message bus, and a bunch of other steps – these were covered in my post about my first foray into CAN-sniffing. Please see the references below, including the Arduino source code. The real trick here was to try and figure out what CAN bus Message ID was the one indicating fuel level – these aren’t published online. It took quite a bit of time studying message traffic at different fuel levels to figure it out…and the only message I found seemingly correlating to fuel level is ID #217.
The procedure here was to mount an LCD with the Arduino in the dash junk tray, and I took a reading whenever the gas gauge pointer was on a 1/16 tank tick mark. I used a pencil to take the reading. It was a #2 pencil. Measuring the data was a little problematic, since the Jeep’s float bounces around quite a bit, so I could not grab a reliable number. You’ll see in the code that periodically I accumulate the average reading, so the chart reflects that with it’s stepped appearance.
You see a slight curvature to the data, and that reflects the configuration of the float mechanism. Gas level is the linear height of the liquid in the tank, and the float is on a armature that swings an arc; it’s connected to a potentiometer. So the relationship between gas level and #degrees the pot turns is not linear. When the gas gets lower, the float swings out a wider arc than it does at fuller levels and varies the pot’s resistance by a wider amount. Why is there an inflection point near 3/4? IDK the answer to that one, maybe the float armature goes up past horizontal? It’s like asking the question: Who killed a hooker? It doesn’t matter. My concern is mostly at the bottom end of the scale in the Fumes region.
I had intended to build an alert or something when the reading gets into the Fumes, you can see from the chart that the reading starts to increase more rapidly as fuel is running out. Sweat like Kramer when the reading is 225.
After all this work I scrapped this project, deciding instead to change my gas-filling habits, and my girlfriend didn’t like all the wires all over the dash and as usual: she was right. I hope you can use something from this post! I’m happy to answer any questions you have.
Several CAN coding libraries can be found by Googling: can-utils, Cory J Fowler, Stephen McCoy’s SparkFun library
Adblock