Arduino ...

An alchemy of sparks, copper wire and earth

Moderators: User administrators, Moderators

User avatar
BertieWells
Registered user
Posts: 202
Joined: 27 Mar 2014, 14:03
80-90 Mem No: 13372
Location: Wrexham, North Wales

Re: Arduino ...

Post by BertieWells »

Thats very cool, if i had a diesel van then i would be building a system for them rather than petrol it comes down to how easily i can test and develop the thing. No bias against diesel ... honest :)

I think i will try both HT lead and a sensor on the crankpully. And if the latter turns out to be simple to impliment then so much the better :ok
1985 1.9 DG

User avatar
BertieWells
Registered user
Posts: 202
Joined: 27 Mar 2014, 14:03
80-90 Mem No: 13372
Location: Wrexham, North Wales

Re: Arduino ...

Post by BertieWells »

I dont think it would be difficult to have the update speed dependant on the speed of the engine. For example when on tick over you only need a slow update speed. When i get a chance i will have a look in the engine bay and see if its possible to mount a sensor near the crank pulley. It would be good to see some pictures of this particular area of your van (petrol and diesel) to see if this is the way to go.
1985 1.9 DG

User avatar
Hacksawbob
Registered user
Posts: 4444
Joined: 11 Oct 2005, 07:11
80-90 Mem No: 1168
Location: Lancs UK member 1168

Re: Arduino ...

Post by Hacksawbob »

add a fuel flow meter and get mpg figures?
member 1168

User avatar
BertieWells
Registered user
Posts: 202
Joined: 27 Mar 2014, 14:03
80-90 Mem No: 13372
Location: Wrexham, North Wales

Re: Arduino ...

Post by BertieWells »

Cracking idea
1985 1.9 DG

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Arduino ...

Post by CJH »

Hacksawbob wrote:add a fuel flow meter and get mpg figures?

Good idea. How does a fuel flow meter work, given that there's a return line to the tank? Is the flow rate back to the tank so low that it can be ignored, or does the meter measure the difference between flow and return?
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

User avatar
BertieWells
Registered user
Posts: 202
Joined: 27 Mar 2014, 14:03
80-90 Mem No: 13372
Location: Wrexham, North Wales

Re: Arduino ...

Post by BertieWells »

The meters i have seens you connect in series with a hose pipe or something similar. The flow rotates a disk connected to a hall sensor. You can then interperate the number of turns of the disk as an amoun fo fluid passing :) Different sensors might work differently ofcourse.
1985 1.9 DG

User avatar
Hacksawbob
Registered user
Posts: 4444
Joined: 11 Oct 2005, 07:11
80-90 Mem No: 1168
Location: Lancs UK member 1168

Re: Arduino ...

Post by Hacksawbob »

There's a mpguino project out there that might be worth a look. I cant find any info after a quick look on fuel flow meters. One method is to calibrate your system on brim measurements.
member 1168

User avatar
mrhutch
Registered user
Posts: 1112
Joined: 09 Jun 2006, 09:27
80-90 Mem No: 2698
Location: Herefordshire & all over

Re: Arduino ...

Post by mrhutch »

flow rate is not the best way to do this..

you would have to measure flow from fuel pump and also the return line.. Fuel rail stays pressurised to allow injectors to "pop"

If you know the pressure of the fuel rail, and the length of pulse for injection, plus the size of nozzles you should be able to work out volume of liquid injected . So pressure sensor on fuel rail would be needed.
1981 Vanagon Westy Burning oil as fuel...  

irish.david
Registered user
Posts: 54
Joined: 31 Jul 2006, 04:14
80-90 Mem No: 3347
Location: Belfast

Re: Arduino ...

Post by irish.david »

Hi,

Next year i've got all sorts of plans to add a more modern control and feedback system to my van using lots of Arduinos dedicated to various functions (heating control, eber control, engine readouts, etc) and linking them all usings their built in I2C bus. Got a few sketches on the go already but still have a bit of a way to go.

BertieWells code looks pretty good but a slight improvement might be to change the formula that calculates the RPM to include the static value for Interval, which would look like this.

RPM = (((spikecount * (1000 / Interval)) / 2) * 60);

or to reduce the calculations for the Arduino slightly:

RPM = ((spikecount * (500 / Interval) * 60);

This way, if you wanted to muck about with different time intervals, all you'd need to do is change the value of interval at the top and everything would work with the new interval.


Another approach could be to use the interrupt function built into the Arduino to count a set number of spikes over a time period and work out the RPM from that. That way the all you'd need to do is figure out how many spikes you need for an accurate reading and then the display would update quicker the higher you revved.

Dave

User avatar
BertieWells
Registered user
Posts: 202
Joined: 27 Mar 2014, 14:03
80-90 Mem No: 13372
Location: Wrexham, North Wales

Re: Arduino ...

Post by BertieWells »

Irish.David,

That looks good andis more or less along the lines what i was thinking. Because the accuracy of the reading varys over different engine speeds (which way depends how you calculate it) i was going to have "interval" vary using fuzzy logic. ie if the engine speed is between this and that then interval should = this. Or i guess the map function could be used to creat a more continious variable. It would calculate what interval should be from the last reading made of engine speed.
1985 1.9 DG

irish.david
Registered user
Posts: 54
Joined: 31 Jul 2006, 04:14
80-90 Mem No: 3347
Location: Belfast

Re: Arduino ...

Post by irish.david »

My inital thought was to do some sort of variable interval based on the previous reading of the RPM, or try to measure the time between the first two spikes and set the timing interval based on that, but when you think about what's actually going on it's just a roudabout way of trying to collect a minimum amount of spikes to get an accuate reading. By using a longer interval for slower engine speeds you're catching more spikes to get a more accurate reading, so why not just say that you need a minimum of 10 spikes for an accurate reading and go from there.

You could use something like this for the sketch:

//

(declaring variables)

int MinSpikes = 10;

(loop)

Interval = EndTime - StartTime;

RPM = ((MinSpikes * 60000) / 2) / Interval;

//

EndTime and startTime are the millis values recorded at the first spike and the final spike after the MinSpikes counter has reached the chosen value. If you find it's not accurate enough you just increase the value of the MinSpikes variable at the top of the sketch, or if you want it to update faster you decrease the value and everything works from there

I think either method will need to use the interrupt method of measuring the input as the duration of the spikes is pretty short and the program loop speed might not be fast enough to catch it without an interrupt.

Dave

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Arduino ...

Post by CJH »

mrhutch wrote:flow rate is not the best way to do this..

you would have to measure flow from fuel pump and also the return line.. Fuel rail stays pressurised to allow injectors to "pop"

If you know the pressure of the fuel rail, and the length of pulse for injection, plus the size of nozzles you should be able to work out volume of liquid injected . So pressure sensor on fuel rail would be needed.

Not sure this would be applicable to a carbed setup though. I can't really see an alternative to fitting two flow meters - one in the supply side and one in the return side - and subtracting the return from the flow. I've no idea what these meters would cost, so maybe this makes it a bit impractical, but on the plus side they could both be mounted near the corresponding tank spigots so the wiring to the dash would be quite short. And it would be a common setup whatever fuelling system you have.
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Arduino ...

Post by CJH »

CJH wrote:I can't really see an alternative to fitting two flow meters - one in the supply side and one in the return side - and subtracting the return from the flow.

Hold on - I suppose the flow rate on the supply side is directly proportional to the rpm for a mechanical pump, isn't it? Or does the flow rate go down if there's some back pressure? If it's a fixed relationship with rpm, it should be possible to measure/calibrate that once, and thereafter just measure the amount being returned to the tank.
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

User avatar
tonytech
Registered user
Posts: 1194
Joined: 11 Oct 2005, 06:40
80-90 Mem No: 477
Location: Liverpool

Re: Arduino ...

Post by tonytech »

For fuel economy just have a sensor on throttle position....
Closed = good fuel economy.
Open = awful fuel economy.
Simple.

Actually I had a golf with an eco meter that sensed manifold vacuum.
Not sure how that worked, but an idea.
There are 10 kinds of people. those who understand Binary and those who dont

User avatar
BertieWells
Registered user
Posts: 202
Joined: 27 Mar 2014, 14:03
80-90 Mem No: 13372
Location: Wrexham, North Wales

Re: Arduino ...

Post by BertieWells »

Hi Guys,

A bit of an update. Really nothing useful here but i now have installed in my van variable colour/brightness dash lights.

When you turn your lights on a little start up routine plays. After that you have control over brightness and colour using a single momentary button.
Colours at the moment are:
Red, Green, Blue, Purple, Turquoise, Yellow, White.
Brightness:
Off, 3 stages of on and full on.
A short click changes the brightness where as a slightly longer press (>1/5 sec) changes the colour.

Here is a video of them working

I was wondering if you guys have any feed back on them?

Things i plan on changing is:
Have the brightness changeable from the original brightness variable resistor.
Being able to save your last colour and brightness settings when the lights are off to be loaded up when you turn your lights back on.

Enjoy

Rob

If there is interest for having one of these please pm me :)
1985 1.9 DG

Post Reply