Ethanol Content Sensor

Hey Guys,

The shop I work at uses a lot of e85 flex fuel for racing purposes. The big problem is, here in AZ, flex fuel from the pump can be anywhere from 54% to 85% ethanol. This makes tuning quite a headache, so we test each car we see. I thought it would be a cool idea to build a rig that has a self contained sensor, pump, power supply etc, so we can pour a little sample into it and get a readout.

The problem is, I can't seem to get accurate data to display, even though we've tested the sensor itself and it's working. Right now I'm using Freqmeasure to just try and display the hz that the sensor is outputting. it seems to be low, the test sample was tested at ~55% ethanol (105hz), but the arduino is reading 64hz. We scoped the sensor and confirmed it's outputting 105 - 110 htz consistently.

I'm using the example script that comes with the freqmeasure library with no other changes and using D49 on my ATmega 2560 as instructed.

Please help, I'm clearly a car guy and NOT a programmer...


Why don't you link us to the library and post the example you're using so you don't have to wait for someone who knows already that library. They might not be coming any time soon. But with links to what you have and your code I bet any number of people could probably help.

A schematic would probably be a good idea too.

Thanks Delta,
Here is the link to the library:

Here is the example:

#include <FreqMeasure.h>

void setup() {

double sum=0;
int count=0;

void loop() {
  if (FreqMeasure.available()) {
    // average several reading together
    sum = sum +;
    count = count + 1;
    if (count > 30) {
      float frequency FreqMeasure.countToFrequency(sum / count);
      sum = 0;
      count = 0;

Not sure if I’ll be able to get a schematic, but it’s quite simple, the sensor is 3 wires, 12v in, signal out and ground. I powered the sensor using a jump box, ran signal to digital pin 49 as per the instruction of the library and used serial monitor to see the result

float frequency FreqMeasure.countToFrequency(sum / count);

That line doesn't look right. There should be an equal sign in there somewhere.