I'm in the middle of creating a can-bus display, the fuel gauge, however, is analog-based. It is a simple potentiometer floater. 10 ohms when empty and 100 ohms when full. I thought of a simple voltage divider should do the trick, but I also wanted to keep safety in mind. The last thing I want is a fire. So I came up with the following values. Hopefully, it all makes sense and any suggestions will help me learn.
I am also thinking about how to proceed with the wiring. I came up with two schematics. Note, that the Arduino is going to be powered and grounded by the vehicle's source.
The first schematic is grabbing one wire from the sender to the Arduino while the other end of the sender will be grounded to the chassis in the trunk.
The second schematic is grabbing both wires from the sender and bringing them to the Arduino, one side will receive the voltage and the other side will be grounded to the Arduino pin.
What would be the most optimal and safest way to wire?
Either of your circuits is acceptable (i.e. lower power than the OEM circuit) assuming the arduino ground and vehicle ground are the same.
However... There is a potential safety issue if it is accidentally miswired. Why not leave the current wiring as it is and just read the 12V and the level sender resistor output. Connect with a 2k or so and you are safe for sure.
I realized you drawing is for conceptual communications, but have you considered the fact that the wire coming into the arduino will have a LOT of electrical noise on it?
It doesn't really matter but is the vehicle gas or diesel? For your safety concern gas is safer.
Are you sure? By 'gas' I assume you mean gasoline; petrol in my part of the world. Gas / petrol is easily ignited with a spark, diesel is not. I suggest diesel is safer.
If you are using the existing fuel gauge in the tank, there should be no safety concerns with either of your circuits. In older cars, the potentiometer connected to the float was a wire-wound resistor with a swiper arm connected to the float, and was not a sealed assembly. The voltage regulator was a simple on-off control that pulsed the full battery voltage on and off to give an average of 6 volts. The fuel gauge on the dash worked by heating a bi-metalic spring, being heated off the current flow through the tank gauge.
Sounds incredibly dangerous, but works because the gas fumes inside the tank are so concentrated that it cannot ignite.
Are you sure? By 'gas' I assume you mean gasoline; petrol in my part of the world
Yes I'm sure. Remember the fuel tank is an enclosed environment. Petrol is so volatile that at "normal" temperatures the internal tank vapor space is so far from stoichiometric that it is literally impossible to ignite the fumes. Diesel on the other hand has such a low vapor pressure that a normal environmental temperature it can have a stoichiometric mix of vapor and air.
Of course if you cut off the top of the tank.....everything changes, at least for Petrol.
JohnRob:
Yes I'm sure. Remember the fuel tank is an enclosed environment. Petrol is so volatile that at "normal" temperatures the internal tank vapor space is so far from stoichiometric that it is literally impossible to ignite the fumes. Diesel on the other hand has such a low vapor pressure that a normal environmental temperature it can have a stoichiometric mix of vapor and air.
That makes sense. It also suggests there is a balance between 2 different safety factors; petrol is easier to ignite when the mixture with air is correct, but diesel is more likely to have the correct mixture in the closed environment of a fuel tank.
PerryBebbington:
That makes sense. It also suggests there is a balance between 2 different safety factors; petrol is easier to ignite when the mixture with air is correct, but diesel is more likely to have the correct mixture in the closed environment of a fuel tank.
Quick study !
You might also be interested in the fact that the fuel (either) passes through the electric fuel pump. As in around the armature, through the brush / commutator and out the top. I was a little taken aback when I first learned that but once you get into the details its easier to understand.
I do know something about chemistry and physics and engines!
You might also be interested in the fact that the fuel (either) passes through the electric fuel pump. As in around the armature, through the brush / commutator and out the top. I was a little taken aback when I first learned that but once you get into the details its easier to understand.
I didn't know that but I'm not surprised, especially diesel as it is oily and would lubricate everything.