Notices
E85 / Ethanol This section is dedicated to tuning with ethanol.

E85 Gauge w/ output for under $100

Thread Tools
 
Search this Thread
 
Old Dec 28, 2017, 08:53 PM
  #181  
EvoM Guru
iTrader: (2)
 
Ayoustin's Avatar
 
Join Date: Jul 2014
Location: Detroit
Posts: 2,894
Received 573 Likes on 431 Posts
Awesome, thanks for posting this up! I'll give it a shot after I've got my car all back together.
Old Apr 5, 2018, 08:35 AM
  #182  
EvoM Guru
iTrader: (2)
 
Ayoustin's Avatar
 
Join Date: Jul 2014
Location: Detroit
Posts: 2,894
Received 573 Likes on 431 Posts
I've gotten some miles on my car over the past couple weeks, maybe around 100. Gauge has worked without issue the entire time, granted I still need to fix the temperature portion of it.
Old Apr 6, 2018, 08:01 AM
  #183  
Newbie
 
bubba2533's Avatar
 
Join Date: Oct 2013
Location: PA
Posts: 2
Likes: 0
Received 2 Likes on 1 Post
I also had a problem with my gauge because I didn't use a voltage regulator, so I would recommend that everyone add a cheap voltage regulator to prevent the Arduino from seeing voltage spikes from the car. Once I added that it works great again.

I made up a simulator to test out my gauge and make sure it was working correctly.

You need another Arduino board, but they are cheap and nice to have around. All you need are a couple potentiometers, or it could be reprogrammed to output a set value if you don't have any.

https://www.tinkercad.com/things/5GuC0ttOOgD

Code from the simulator:


Code:
int percentanalog = A0; // 0-5 Volt input from pot
int tempanalog = A1; // 0-5 Volt input from pot
int outputpin = 8; // output pin assignment
int val = 0; // place holder to read analog inputs
int outputState = LOW; // set output to false
unsigned long previousMicros = 0; // save the last time the output was switched


void setup() {
Serial.begin(9600); // setup serial comms
pinMode(outputpin, OUTPUT); // setup output

}

void loop() {

// convert analog input to flex fuel percent 0-100 %
val = analogRead(percentanalog);
float flexpercent = (val*0.0977517);

// convert analog input to ms of low time for fuel temp 1-5 ms (1ms -40c and 5ms 125c)
val = analogRead(tempanalog);
float fueltemp = (val*0.00391007) + 1;

// calculate period from the frequency (flex percent + 50) and converted to microseconds
float period = (1 / (flexpercent + 50)) * 1000000;

// low time is calculated from the fuel temp and converted to microseconds
float lowtime = fueltemp * 1000;

// subtrack lowtime from the signal period time
float hightime = period - lowtime;

// grab current time in microseconds
unsigned long currentMicros = micros();

// determine the elapsed time since the last time the output was switched
unsigned long elapsedtime = currentMicros - previousMicros;

if (outputState == LOW){
if(elapsedtime >= lowtime){
digitalWrite(outputpin, HIGH); // sets the output high
outputState = HIGH;
previousMicros = currentMicros; // save the "current" time
}
}

else {
if(elapsedtime >= hightime){
outputState = LOW; // "toggles" the state
digitalWrite(outputpin, LOW); // sets the output low
outputState = LOW;
previousMicros = currentMicros; // save the "current" time
}
}

// printing causes timing issues, so these were only used for debugging

// if (outputState)
// Serial.println(1);
// else
// Serial.println(0);

// Serial.println(period,4);
// Serial.println(hightime,8);
// Serial.println(lowtime,8);
// Serial.println(flexpercent);
// Serial.println(fueltemp);

}
Old Jul 21, 2018, 09:24 AM
  #184  
Evolving Member
Thread Starter
 
mrb00st's Avatar
 
Join Date: Jan 2008
Location: Ohio
Posts: 122
Received 15 Likes on 6 Posts
I added this to the code. Sorry for never replying. I sold my evo awhile back and havent had anything to run e85 on. If there is any other info that needs to be changed or added on the main page, please let me know. I think some people were adding regulators and that was fixing alot of issues?

Originally Posted by bubba2533
Don't have an EVO, but I used this to build my own little gauge for my truck so thanks to the OP for the information.

I did a little bit of testing and found the same problem with the temperature. So I read some more about the sensor and how it outputs the temperature reading and looked at the code and didn't think the code made any sense for what I found.

So I coded up my own way to get the temperature and it seems to be correlating correctly with the coolant temp and intake air temp of my truck while in the garage.

Here is just the portion of the code that gets the temperature:

Code:
void getfueltemp(int inpPin) { //read fuel temp

tempPulse = pulseIn(inpPin, LOW, 25000); // Measure the low pulse time (timeout after 25ms if no pulse is detected)
if (tempPulse > 0) { // If we get a pulse then update the temperature measurement
lowTime = tempPulse;
float celsius = ((41.25 * (float(lowTime) / 1000)) - 81.25); // Calculate temp in celsius from lowTime pulse
float fahrenheit = ((celsius * 1.8) + 32); // Convert to fahrenheit
temperature = fahrenheit; // Update temperature with specified unit
}
}
The following users liked this post:
CDrinkH2O (Jul 22, 2018)
Old Jul 25, 2018, 04:31 AM
  #185  
Newbie
 
Guilty1s's Avatar
 
Join Date: Dec 2010
Posts: 1
Likes: 0
Received 0 Likes on 0 Posts
Fuel temp

How possibly would it be to write code to output to another pin the fuel temp with a 0.5-4.5v signal. Is there another pin on the Arduino that can do that?
Old Dec 7, 2019, 02:18 PM
  #186  
Newbie
iTrader: (2)
 
drinky84's Avatar
 
Join Date: Apr 2009
Location: SoCal
Posts: 73
Received 2 Likes on 2 Posts
Deleted

Last edited by drinky84; Dec 7, 2019 at 04:21 PM.
Old Jul 26, 2022, 12:42 PM
  #187  
Newbie
 
Oscar32's Avatar
 
Join Date: Jul 2022
Location: brooklyn
Posts: 22
Likes: 0
Received 0 Likes on 0 Posts
Wow. . . Great, if you can use 3D printing to make a complete bracket and mount it directly on the timer. It would be perfect to make a complete finished product and sell it. . . .
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
tephra
ECU Flash
282
Aug 20, 2019 03:56 AM
xPRimNT
Evo X Engine Management / Tuning Forums
239
Jun 2, 2016 10:40 PM
jcsbanks
ECU Flash
90
Jan 19, 2008 09:01 AM
CrimsonShadow
Vendor Service / Parts / Tuning Review
1
Nov 14, 2007 09:15 PM
Kc2Buk
Evo Engine / Turbo / Drivetrain
61
May 5, 2006 11:39 AM



Quick Reply: E85 Gauge w/ output for under $100



All times are GMT -7. The time now is 02:38 AM.