My first post here as a newbie to microcontrollers and the like, but I'm keen to learn.
I'm converting a Yamaha XSR155 to electric and I would like to keep the original dashboard/speedometer as it's quite 'pretty'.
The first challenge is to convert the battery voltage to resistance to mimic the tank fuel sender resistance. I'm sure it's done before.
The tank fuel sender shows 12 ohms when empty and 270 ohms when full. (Yamaha PN B7D-H5752-00) it has two wires going to it. (green/black +12v and orange/black earth) from the speedometer.
The battery range is 60v empty and 84v fully charged (cells are LG21700M50T connected 20S8P)
The gauge has 6 bars,. Bar 1 flashes when near empty, so effectively 7 in total.
Bar 1 flashing = below 66v =12-55ohms
Bar 2 66-69v = 55-98ohms
Bar 3 69-72v = 98-141ohms
Bar 4 72-75v = 141-184ohms
Bar 5 75-78v = 184-227ohms
Bar 6 78-81v = 184-227ohms
Bar 7 81v-84v = 227-270ohms
I would like to find a way with an Arduino (I presume UNO) and without to figure out this little challenge. I would like to use TinkerCAD or other software to prove out the design.
Following the above, I would also like to use the speed read out to take it's input form the motor hall sensor pulse 0.6 to 4.8v twice for each wheel revolution.
And for the 0-13 RPM scale to show 0-130amps draw, taking a two wire output from a 0,35mOhm shunt to . But these two additional projects I'll post as new topics and link here once I've studied more and have more data.
I'm sure I've missed some information eek. Thank you in advance for any help you have to offer.
What you need to do is make a voltage divider for the tank sender , and read the voltage in .
You then need to work out a profile for the resistance verses rank contents ( use a curve fit in a spreadsheet ) , then use a PWM output, via a transistor to drive the gauge .
Historically car fuel gauges consisted of a variable resistor in series with a relatively insensitive moving iron ammeter connected to the 12V battery.
As the tank emptied the current would vary from around 1 Amp (full) to say 0.1 Amp (empty).
The resistance values that you have quoted seem to indicate that a similar system is still in place, probably for backwards compatibility. (I've never had a motorcycle with a fuel gauge - I'm used to taking the filler cap off and peering into the tank to check the level).
Using an internal combustion engine, with a dynamo/alternator to keep the battery topped up, you can afford to 'waste' an Amp to indicate that your tank is full.
When you are talking about an electric vehicle with a limited charge in the battery, I don't think that you can spare an amp just to indicate full charge.
I think that you need to see if the display that you have does draw the magnitude of current that I am suggesting, and if so, see if it can be modified to work (say by removing a meter shunt) at a much lower current.
I work in a moving company (mudanzas-df.com) I want to implement an idea of a hose with a Arduino that measures the polarity inside the hose, that when it changes it detects the pus and can give the level of the tank, I will make a drawing to understand my ide, but I think it can work.
I don't have much knowledge, but I am passionate about electronics.
hammy:
What you need to do is make a voltage divider for the tank sender , and read the voltage in .
You then need to work out a profile for the resistance verses rank contents ( use a curve fit in a spreadsheet ) , then use a PWM output, via a transistor to drive the gauge .
Battery voltage may cause some errors
Hi @hammy, a super thank you very much . I've looked into a voltage divider and made one using a couple resistors 30ohm and 500ohm. From 84v I get 4.75v and from 66v I get 3.74v, this is only about 1v difference.
Is this enough voltage range for the Arduino? I was hoping to bigger voltage 'spread' say 1 to 4.5v. I guess this would be non linear, is there a way to do this?
Also, any direction on what specific part number of transistor would do the job? @JohnLincoln thank you too for your thorough reply . I didn't consider the current draw at 'empty', ouch :o . It's annoying that a modern bike (2020 MY) is so 'inefficient' with fuel measurement . I shall tinker with the meter to check the draw.
Thank you again for your time and knowledge.
devpanch: @JohnLincoln thank you too for your thorough reply . I didn't consider the current draw at 'empty', ouch :o . It's annoying that a modern bike (2020 MY) is so 'inefficient' with fuel measurement . I shall tinker with the meter to check the draw.
Thank you again for your time and knowledge.
I'm afraid that I have no direct knowledge of motorcycle fuel gauges, but was just taking an educated guess based on what has been used historically in the automotive industry , and the desire to keep things backwards compatible.
What I said may or may not be true - I don't know whether anyone else is able to confirm or deny my assumptions?
Those resistor values are far too low.
Start with 1k as the bottom resistor in your divider .
There will be only a small change in voltage , whatever the divider as the battery voltage only changes by around 25%, so you can only expect the same % drop at the divider output . You still get around 100 points of resolution - more than enough for a fuel gauge.
You also need some protection on the analog input - I would put a 5v1 zener across it as a minimum .