What is DAC analog output and do I need it?

DAC stands for Digital-to-Analog Conversion, and is only needed for devices that require smooth precise analog signal. Chances are if you’re doing simple data logging it is not needed.  If you’re planning on using the analog output for engine calibration/tuning, then it may be needed if the receiving device performs rapid sampling without averaging.  Personally, I’d recommend using DAC for any engine calibration purposes just for the sake of precision.  Cobb requires it as per this fantastic tuning guide Mike McGinnis put together under the section “Ethanol Content Measurement and Analog Input Considerations”.

The 0-5v (or 0.5-4.5v) analog DAC is not to be confused with the native flex-fuel sensor PWM output signal.  Most advanced engine management units will accept the native flex-fuel sensor PWM signal (50hz-150hz), ECMLink on DSM platforms is one example.

We leverage the MCP4725 chipset (12-bit resolution) to provide the DAC output.

Why not use Arduino for precise analog out?
Because by default it doesn’t support it.  When using output on A & D pins are pulsed, the longer the pulse, the higher the output voltage.  When the pulse is 100% duty cycle, then you’ll see a smooth 5V output, but anything in between will look like a square wave which makes great EDM music.  The example below shows the PWM analog output on pin D9 (red) compared to DAC out driven by the MCP4725(blue).  Both have similar Mean voltage, however since the PWM analog is pulsed, it’s low and high range from 0 to 5V.  This is why some devices which lack averaging over time will have issues.  When using PWM analog, unintelligent devices may grab a microsecond sized sample and see it’s either 5volt, and the next microsecond could be 0 volts.

What about using a filter (capacitor)?
This works *most of the time*.  But when it doesn’t work, it can be a headache.  The voltage is skewed in certain ranges, delayed, and almost always still have a fluctuation, not by much, but can still be problematic.  Lots of complex maths are required to rewrite code to adjust for such madness, and giving up is far easier.

Using a filter capacitor pulled to ground, the PWM analog out(red) is dampened drastically, but isn’t nearly as stable as DAC(blue).

How do I wire in the DAC chipset?
VCC on the DAC goes to 5V pin on the Arduino
GND on the DAC goes to the GND on the Arduino
SDA on the DAC goes to the A4 on the Arduino
SCL on the DAC goes to the A5 on the Arduino
OUT on the DAC goes to your engine management input.  Optionally GND next to the OUT on the DAC can go to the GND on engine management input if it requires a related ground signal.

How do I program for the DAC?
You shouldn’t need to.  Firmware v1.4+ supports the DAC chipset and is coded to use 0-5V, alternatively hardware 50.4+ supports 0.5v-4.5v plus certain error conditions above and below that range specific for Cobb.  We program the DAC eeprom to provide 0.1v on instant powerup until Arduino is able to calculate ethanol content.  Note, if purchasing a random DAC from the e-interwebs, they may have a different i2c address, if that’s the case you’ll need to either configure the DAC jumpers to use address 0x60 , or update the source code to reflect the DAC address “this line–> dac.begin(0x60);” , and then flash the update to the Arduino.  If purchasing any parts/DiY/assembled kits from us, everything will work together.

Additional notes:
Firmware v1.4+
DAC normal range 0-5V
Instant power up DAC sets output voltage to 0.1v until ethanol content can be calculated.
If flex-fuel sensor is disconnected, last ethanol content calculation is maintained on the DAC output voltage.

Firmware v50.4+ (Cobb specific compatibility and error conditions)
DAC normal range 0.5-4.5V
2 second splash screen delay eliminated.
Instant power up DAC sets output voltage to 0.1v until ethanol content can be calculated.
If flex-fuel sensor is disconnected, DAC output voltage is set to 0.1v.
If ethanol content is less than 0%, DAC output voltage is set to 4.8v.
If ethanol content is greater than 100%, DAC output voltage is set to 4.9v.

Since we provide all source code to the public, you may alter the allowed ranges as you wish.  For example, if you never plan on running more than 85% ethanol, the “fuel error code” range can be updated if it exceeds 85%.  Alternatively we can program a custom firmware with different ranges upon request.

Thoughts on operation, fuel and ethanol calculation:
Water will skew it towards the higher ethanol percentage.  If your fuel is old, think twice about trusting the readings.  Alcohol attracts water.  Fuel detergents and additives also skew the readings.  Air pockets in fuel lines will cause a rapid drop in ethanol readings.  It’s best to key-on and wait for a few seconds before “start” or cranking.  This will give fuel sufficient time to stabilize in the sensor, and the unit start calculating a proper ethanol content.  It’s best to wire into a switched circuit that’s hot during key-on and “start” so ethanol content percent is provided to the engine management during cranking.  This is a real-time gauge/output device, we don’t average results, although if the temp or content is drastically out of range, up to 2 consecutive results will be tossed out until an error is produced.  Intelligence must be in the engine management whether to trust sensor readings. The flex-fuel sensor datasheet states there’s a +-5% tolerance.  Please tune conservative.