neiltechspec
Senior Member
Yet again I seem to be struggling with maths.
Built a Wideband AFR guage that displays 0v to 5v as 10 to 20 AFR.
This used,
It worked well enough.
Now I have changed the Lambda Controller.
This gives from 0v to 5v as 7.35 to 22.39 AFR, supplier says to convert Volts to AFR use - V*15.04/5+7.35.
So I have tried, afr = adc * 10 / 51 * 15 / 5 + 73 max 199
But this seems to give large jumps between readings.
Any suggestions on the maths.
Have subsequently come up with this below, untested on H/W yet though
Built a Wideband AFR guage that displays 0v to 5v as 10 to 20 AFR.
This used,
Code:
readadc sens,adc
afr = adc*20/51+100 max 199 'max value limited to 19.9
bintoascii afr,b10,b11,b12
Now I have changed the Lambda Controller.
This gives from 0v to 5v as 7.35 to 22.39 AFR, supplier says to convert Volts to AFR use - V*15.04/5+7.35.
So I have tried, afr = adc * 10 / 51 * 15 / 5 + 73 max 199
But this seems to give large jumps between readings.
Any suggestions on the maths.
Have subsequently come up with this below, untested on H/W yet though
Code:
readadc10 sens,adc
afr = adc / 2 * 15 / 5 + 735 max 1999
bintoascii afr,b10,b11,b12,b13,b14
'sertxd(#adc," ",b11,b12,b13,cr,lf)
Last edited: