# Maths Help Needed

#### neiltechspec

##### Senior Member
Hiya all,

I have a Wideband Lambda Air Fuel Ratio display, the controller also has a linear voltage output which
can be used for logging purposes. Which is what I want to do.

The logging bit I can handle ok using an "openlog" which I have used before for logging hourly solar
inverter stats and have a spare in my junk box.

So,
Volts - AFR
0.00 - 10.0 or less
0.25 - 10.5
0.50 - 11.0
0.75 - 11.5
1.00 - 12.0
1.25 - 12.5
1.50 - 13.0
1.75 - 13.5
2.00 - 14.0
2.25 - 14.5
2.50 - 15.0
2.75 - 15.5
3.00 - 16.0
3.25 - 16.5
3.50 - 17.0
3.75 - 17.5
4.00 - 18.0
4.25 - 18.5
4.50 - 19.0
4.75 - 19.5
5.00 - 20.0 or more
This output is quoted as being linear between AFR 10 - 20.

Obviously I can read this voltage using readadc (255 steps is plenty), but converting this to an AFR
is beyond me at the moment.
Is there a mathematical solution to this or do I have to use look up tables etc...

Any help appreciated.

Neil.

#### marks

##### Senior Member
Hi neiltechspec,
hopefully this is all your after

(steps255 toAFR) *20/51+100 =200

(steps255 toVolts) *100/51 = 500

(Volts500 toAFR) /5+100 =200

#### neiltechspec

##### Senior Member
Brilliant, that's it, thanks.

I knew it would be fairly straight forward, but just couldn't see it.
I'm way out of practice, haven't done anything picaxe for nearly 12 months.

Neil.