Skip to main content

MadaboutKitcars

This is a read-only archive of the old Madabout Kitcars forum. New posts and replies are no longer possible, but every thread is still here to browse and read.

Low Fuel Light Part II

3 Sep 2010, 7:51am
Now that I've been driving Vikki for a while, it's apparent that my carefully researched and constructed low fuel circuit is complete bobbins. :)

It would appear that because the fuel sloshes around in the tank at the slightest provocation, the circuit never gets enough time to realise that it's low and turn the lamp on. Oh, that and the fact that the voltages measured in operation bare no resembalance to those on the bench :doh:

Anyway, I've decicded to have another stab at this, and whilst I'm at it, smooth out the gauge as well - it's quite alarming seeing the needle dance all over the place whilst you're just driving along.

I'm going to attempt to use an Arduino to read the voltages from the sender and then use a moving average to update the gauge. As it's all software based, and can be reprogrammed via a USB cable, if it isn't right first time it can be easily tweaked.

The plan is to hook the sender feed to one of the analog input lines on the arduino, do the processing and then update the level on the dial every 90 seconds or so on one of the PWM (Digital acting as analog) outputs. I'll also check to see if the level has reached a set point, and then send another digital outout high and use it to turn on the lamp via a power transistor.

Will it all work? Dunno. But I'll keep you posted. :D

Further reading:

http://arduino.cc/en/Main/Software
http://arduino.cc/en/Tutorial/AnalogInput
http://arduino.cc/en/Tutorial/Smoothing
http://arduino.cc/en/Tutorial/PWM
http://arduino.cc/en/Tutorial/Fading
6 Sep 2010, 7:34am
Well, I've ordered one of these:

http://www.arduino.cc/en/Main/ArduinoBoardNano

Should be here either today or tommorow. I also did a lot more reading over the weekend, and there's all sorts of things you can do with these things. I particuarly like this:

http://ecomodder.com/wiki/index.php/MPGuino

It works out your tank / average and immediate MPG by taking feeds from the speedo sender and the fuel injection trigger. A bit of maths and bingo - there's your MPG. I assume you could also work out range as well, if you know the size of the tank.

I quite like the idea of a MPG gauge - a retro one, of course. A nice ETB Volt meter with a redressed dial would be nice. Add a toggle switch to make it switch between reading Average or Intermediate, and you have a retro fuel computer. :)
6 Sep 2010, 9:27pm
The Nano arrived today.

It's (to someone who hasn't played with these things before) amazing - in the short time I've been playing with it, I've managed to get the foundation of my smoothing code sorted and loaded on to the thing, and i've been simulating the fuel sender with a pot hooked up to an analog input, with the 'duino writing the values back to the console and the inbuilt LED lighting when a predefined "fuel level" is reached.



I need to hook it up to the gauge via some sort of driving circuitry, but I don't think that it's going to be too difficult.

:)
8 Sep 2010, 6:10pm
Interesting project there Jason.

I've now got used to that gauge showing just about anything. We have a 270deg slip road onto the A303 and you can enter the bend with the tank showing Empty and exit with it showing Full. Only if!

Anyway I now just worry about the fuel when the needle doesn't come of empty, because that is when I've less than a gallon left.
17 Sep 2010, 7:48am
Some progress - I now have the arduino driving the ETB gauge, after a few false starts and an schoolboy error. :)

It's running off one the PWM lines, via a current limiting resistor to the base of an NPN transistor. The transistor collector is hooked up to the the sender terminal, and the gauge is given 12V. The emitter is connected to ground.

Cycling though the different PWM duty cycles gives different readings, and I've currently got a little 5 line program cycling through displaying zero, 1/2 and full. :D

What was the school boy error? Well for the longest time I couldn't get it to do anything. I had assigned digital I/O pin 3 as my PWM source, and hooked everything up and nothing. That's when I realised that I was hooked up to analog In pin 3, not digital pin 3.... :doh: :)

I need to prototype the sender side of the circuit next, which should be fairly straight forward.

Then I just have to get the processing right. But that should be the easy bit, as if it's wrong, I just upload new code.

I'll post some pics up tonight of what it all looks like
14 Oct 2010, 2:44pm
A lot of progress on this now. The circuit has been completely prototyped and tested, and it works. :)

Here's the circuit:

http://www.greatoldone.co.uk/Misc/ArduinoFuel6.jpg

There's a lot of filtering on the power supply and inputs to ensure nothing nasty gets to the Arduino and it's microprocessor, and it's completely de coupled from the outputs to the gauge and the warning lights.






There's now two warning lights ('you ought to refuel' and a 'you really, really neeeeeed to refuel'), both of which can be switched on when a programatically set level is reached.

The Arduino reads the varying voltage from the sender, and converts this into a value between 0 and 1023. Due to the values of the components and resistance range of the sender, this range is reduced to 184 - 841.

The program I currently have loaded onto it takes that range and normalises it into a 0-100 range, and then takes that normalised value and converts it into a PWM duty cycle that will drive the gauge. Future versions of code will have the averaging done against the normalised values before being spat out on the gauge and the lamps. I also plan to map the tank emptying and store the resultant curve, as it's bound not to empty in a linear fashion.

http://www.youtube.com/watch?v=SGbzIPf9z0I

:)
8 Dec 2010, 9:17am
You are going to have more processing power in that fuel gauge than in the ECU! It really would have been much easier if Marlin had put a baffle in the fuel tank.....

Robin
8 Dec 2010, 11:20am
I agree - but this is much more fun. :)