Error in calculating fuel consumption.

AdamK24:
So what could be better from Digitalread?

You could read the port directly. You would lose some flexibility and portability, but gain spare.