HEre are the factors for Spartan that will convert its narrower than expected voltage range to proper AFR/Lambda:
WB_AFR_b2 , {} , 0x381114, 2, 0x0000, {} , 0, 0, 0.0112338149664641, -9.9154, {WB_AFR_b2}
WB_Lambda_b2 , {} , 0x381114, 2, 0x0000, {} , 0, 0, 0.000774745, -0.68382, {WB_Lambda_b2}
Change name/address as you need.
How did I come up with that? Here are my cliff notes:
;; Spartan I received seems to be defective. I measured 4.400V (averaged) at open air and 2.05V (averaged) at 14.7AFR and 0.053469 (averaged)
;; at 10.00 AFR. It should give 5V at open air and zero at no air.
;;
;; Measured values with voltmeter when connected to ECU (when not connected to ECU it ouputs full 0-5v range - Spartan has some design flaw):
;;
;; Sartan ECU Physical AFR
;; 0.005 0.053469 10 (bag with propane)
;; ~2.05 14.7 (running engine with 1.00 lambda)
;; 5.000 4.400 20 (open air or decel)
;;
;;
;;
;; Curve finder (that's a software you can get for free to find fits for you data).
;; Used 10.00 and 20.00 AFR points as 0.00 and 10.00 respectively with their voltages (voltages obtained empirically by averaging across hundreds of cells):
;;
;; 0.053469 0
;; 2.050 4.7
;; 4.400 10
;;
;; Got linear equation: y = a + bx -> y = -0.0846 + 2.299 * x
;;
;; Calculated 4.7 AFR: 2.08V (due to the software doing the best to fit not so linear curve, there is a little bit of deviation but nothing significant)
;;
;; Good enough!!!
;;
;; Me7 Logger:
;; Spartan is gimped in that it only measures from 0.053469 to 4.400 so it really provides 4.400 - 0.005346953 = 4.394653047V range.
;;
;;
;; Verify that CurveFinder equation makes sense for 0, 4.7 and 10 AFR (before offset):
;; y = -0.0846 + 2.299 * 0.053469 = 0.03AFR - almost zero
;; y = -0.0846 + 2.299 * 2.050 = 4.63 - close enough, it osciallates a lot anyway when idling
;; y = -0.0846 + 2.299 * 4.400 = 10.031 - spot on
;;
;; Verification complete and the equation is a pretty good fit considering empirical nature of arriving at it.
;;
;; We can obtain ME7 factor in two ways... determining divider which will define ratio of nominal 5V to narrower voltage ECU sees which is 4.394653047V or
;; using the function's 2.29 * x factor, they should be equivalent...
;; O2 volt variable holds 1024 discrete values for 0-5v voltage level. Since O2 WB measures 10AFR difference in that range, then 10/1024= 0.009765625
;; for one 1 unit in variable. That's stock but you need this to understand where the 1024 comes from.
;;
;; 10 / (1024 / (5V/4.394653047V)) = 0.0112338149664641
;; 10 / (1024 / (2.29V/2V)) = 0.011181640625
;;
;; There is 0.46% (one is 1.0046 larger than the other) difference between the two, you can use either one without much difference in output.
;; At 12AFR the error between the two will be 0.01 (one hundreth!) AFR and we usually measure well below 12AFR anyway so actual AFR error will be even smaller.
;;
;; Grand finale!!!
;;
;; ME7Logger values for 0x381114/0x381116 for POS Spartan O2 meter:
;; AFR
;; Offset: 10 - 0.0846 = 9.9154
;; Factor: 0.0112338149664641
;; Final Values: 0.0112338149664641, -9.9154
;; Lambda:
;; Offset: 9.9154/14.5 = -0.68382
;; Factor: 0.0112338149664641 / 14.5 = 0.000774745
;; Final Values: 0.000774745, -0.68382
WB_AFR_b2 , {} , 0x381114, 2, 0x0000, {} , 0, 0, 0.0112338149664641, -9.9154, {WB_AFR_b2}
WB_Lambda_b2 , {} , 0x381114, 2, 0x0000, {} , 0, 0, 0.000774745, -0.68382, {WB_Lambda_b2}
WB_Volt_b2 , {} , 0x381114, 2, 0x0000, {V} , 0, 0, 0.004883, 0, {WB_Volt_b2}