Skip to content

Module to read the ethanol percentage of a standard 50hz to 150hz ethanol content sensor

License

Notifications You must be signed in to change notification settings

justinbaur/ethanol-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ethanol-module

Module to read the ethanol percentage of a standard automotive 50hz to 150hz ethanol content sensor

Description

The goal of this project was to build an affordable way to read ethanol for cars being tuned on e85. The code is built with the purpose of being installed onto an Arduino based device that receives input from an OEM ethanol content sensor.

Reference

This is a cleaned up example I put together to integrate with a Raspberry Pi and Adafruit Trinket. Credit for the original idea and code can be tied back to the user Dala on the sr20 forums and referenced through other various forums from NASIOC and evolutionm. The code was included in snippets across forums and were specific to displaying on an small LCD but this project returns data over I2C SDA/SCL to the Raspberry Pi.

Usage

An example of interacting with the module using Python and the smbus-cffi library.

import smbus
import time

I2C_ADDRESS = 0x04
ETHANOL_DATA_IDENTIFIER = 0x01
DEVICE_DELAY = 0.1

bus = smbus.SMBus(1)

bus.write_byte_data(I2C_ADDRESS,0x00,ETHANOL_DATA_IDENTIFIER)
time.sleep(DEVICE_DELAY)
fuelContent = bus.read_byte(I2C_ADDRESS)

The full picture of how this can be implemented and pinned.

pin out diagram

Pin out pictures pulled from https://pinout.xyz and https://learn.adafruit.com/introducing-pro-trinket/pinouts

About

Module to read the ethanol percentage of a standard 50hz to 150hz ethanol content sensor

Topics

Resources

License

Stars

Watchers

Forks

Languages