Notices
ECU Flash

JDM Map Sensor and Gauge

Thread Tools
 
Search this Thread
 
Old Aug 29, 2008, 07:02 PM
  #16  
Evolving Member
iTrader: (1)
 
Jazzie604's Avatar
 
Join Date: Jan 2004
Location: Lex, KY
Posts: 234
Likes: 0
Received 0 Likes on 0 Posts
any updates on this guage?
Old Aug 29, 2008, 09:52 PM
  #17  
Evolved Member
iTrader: (9)
 
EatSleepBoost's Avatar
 
Join Date: Jan 2008
Location: Mass
Posts: 971
Likes: 0
Received 0 Likes on 0 Posts
as a side note... that place that the OP put up a link for, DYNO TUNE in massachusetts, is really good. got my wideband with their custom gauge from them.
Old Jan 10, 2009, 11:38 PM
  #18  
Evolved Member
Thread Starter
iTrader: (14)
 
daisaw1219's Avatar
 
Join Date: Apr 2005
Location: South Jersey/Philly
Posts: 874
Likes: 0
Received 1 Like on 1 Post
bump...tephra would it be possible to read the jdm map and output it through a spare ecu pinout and then connect it to a small lcd screen.
Old Apr 12, 2010, 11:03 AM
  #19  
Evolved Member
iTrader: (2)
 
budlong's Avatar
 
Join Date: Oct 2003
Location: norcal / socal
Posts: 512
Likes: 0
Received 0 Likes on 0 Posts
here is my code for the lcd gauge. The boost formula is calibrated to the JDM map sensor.

mind you i am not a full time coder.

//budlong
//2008

////remove warning flags from boost and afr routines.. make own if statement at void setup level that say if over, switch to....

///turn off cursor on display

int thePinval = 0; // variable for reading the button's pin status
int val = 0; // variable to store the value coming from the sensor
int psi = 0; //raw adc data
int psiR = 0;
int psiR2 = 0;
int psiR3 = 0;
int psiR2MAX = 0;
int psiMAX = 0; //max psi does not register negative
int afr =0;
unsigned int afrR = 0;
unsigned int afrR2 = 0;
int Warn_lo = 22; //warning low trigger SET TO 21 before completion
int Warn_hi = 24; //warning high trigger SET TO 24 before completion
int warning;
int calcpressure;
int addOneDisplay =0;
long time;
int boostInput=1;
int afrInput = 5;
int buttonA = 8;
int buttonB = 7;
int analogBoost = 3;
int analogAfr = 6;


void setup() {
pinMode(buttonA, INPUT); // declare button A input 7
pinMode(buttonB, INPUT); // declare button B input 8
pinMode(analogBoost,OUTPUT); ///5v signal simulates BOOST
analogWrite(analogBoost,255); //write full 5v signal to pin 3
pinMode(analogAfr,OUTPUT); ///5v signal simulates AFR
analogWrite(analogAfr,255); //write full 5v signal to pin 5
Serial.begin(9600);
delay (200);
Serial.print(254,BYTE);
Serial.print(1,BYTE);
delay (500);
}

void loop(){
////FORMULAS///
psi = (((0.333 * analogRead(boostInput)) * 14.5)/100)-15.08; ////.333 * ADC value * 14.5 * atmospheric pressure sensor reads from -15 to +34.~~
//////remander still not working correctly
psiR = psi *100 ;
psiR2 =100 *((((0.333 * analogRead(boostInput)) * 14.5)/100)-15.08);
psiR3 = (psiR2 -psiR);
if (psiR3 < 0) psiR3=0;
afr =analogRead(afrInput)/50; ///calculate afr 5v times 10 to move decimal over one space turning 3 int 30???
Peak_val();
/////main routines////////////--------------------------------------------------------------------------------------------------------------------------------
if (psi >= Warn_lo){
Warn();
}
else {
PeakReset();
ChangeDisplay();
}
}
//------------------Routines-------------------------////
///////////////////Display////////////////////////////////////
int clearScreen(){
Serial.print(254,BYTE);
Serial.print(1,BYTE);
delay (100);
}
int topScreen(){
Serial.print(254,BYTE);
Serial.print(128,BYTE);
//delay (100);
}
int botScreen(){
Serial.print(254,BYTE);
Serial.print(192,BYTE);
//delay (100);
}
///////////////////Buttons////////////////////////////////////
int PeakReset(){
thePinval = digitalRead(buttonA); // read input value of buttton A
if (thePinval == LOW) { // check if the input is LOW (button pressed)
/////clear screen and reset peak value
clearScreen();
psiMAX=0;
psiR2MAX=0;
}
}
int ChangeDisplay(){
thePinval = digitalRead(buttonB);
if (addOneDisplay==0){
Boost_dis();
Peak_dis();
if (thePinval == LOW){
addOneDisplay=1;
clearScreen();
delay (500);
}
}
else if (addOneDisplay==1){
Boost_dis();
Boost_graph();
if (thePinval == LOW){
addOneDisplay=2;
clearScreen();
delay (500);
}
}
else if (addOneDisplay==2){
Afr_dis();
Afr_graph();
if (thePinval == LOW){
addOneDisplay=0;
clearScreen();
delay (500);
} ////add more else ifs to have more display selection combinations
}
}
///////////////////Displays////////////////////////////////////
int Boost_dis(){ //after decimal not complete
topScreen();
Serial.print(" psi: ");
Serial.print( psi), BYTE;
Serial.print(".");
Serial.println(psiR3),DEC;
}
int Afr_dis(){ //after decimal not complete
topScreen();
Serial.print(" afr: ");
Serial.print( afr), BYTE;
Serial.print(".");
Serial.println(afrR2),BYTE;
}
int Peak_dis(){
botScreen();
Serial.print(" peak: ");
Serial.print( psiMAX), DEC;
Serial.print(".");
Serial.println(psiR2MAX),DEC;
}
///////////////////Graphs////////////////////////////////////
int Boost_graph(){
int xb;
int xa = psi /2.5;
int xbar;
int c=0;
botScreen();
for( xb = 0;xb <xa;xb++){
Serial.print(5,BYTE); /////character to display as bar in graph
delay (10);
c=c+1;
}
if(c <xa) {
botScreen();
Serial.print(" ");
delay (10);
}
}
int Afr_graph(){//try to add your own characters
int afrCursor;
afrCursor=analogRead(5) *12 / 1020; //divided analog in 5 by 14 slots to fill on the graph to get the cursor position
botScreen();
Serial.print("[ ]");
Serial.print(254, BYTE);
if (afrCursor >8) afrCursor =8; ///keep cursor from moving to far to the right
if (afrCursor <1) afrCursor =0;
Serial.print(194 + afrCursor, BYTE);
if (afr < 12) Serial.print("lean");
else if (afrCursor > 15) Serial.print("rich");
else Serial.print("opti");
delay (100);
}
///////////////////Various////////////////////////////////////
int Peak_val(){
if (psiR2MAX < psiR3 && psiMAX==psi){
psiR2MAX = psiR3;
}
if (psiMAX <psi){
psiMAX = psi;
psiR2MAX = psiR3;
}
}
int Warn(){
if (psi >= Warn_lo && psi < Warn_hi){ //warning triggerd
botScreen();
Serial.print("!!! WARNING !!! ");
delay(300);
botScreen();
Serial.print(" ");
}
if (psi >= Warn_hi){ //OVERBOOST warning triggered
topScreen();
delay (300);
Serial.print("!!! WARNING !!! ");
botScreen();
Serial.print("+ + + B O O S T");
delay (200);
clearScreen();
Serial.print(" ");
botScreen();
Serial.print(" ");
}
}
//// AFR scale... 14.5 cruising 11.5 redline .... scale should read from 8afr to 18afr
Old Apr 13, 2010, 06:17 PM
  #20  
Evolving Member
iTrader: (2)
 
SoCalRedLine's Avatar
 
Join Date: Mar 2007
Location: NorCal
Posts: 298
Likes: 0
Received 0 Likes on 0 Posts
Looking through the code it looks like you have the rich/lean mixed up on the graph portion. Also, Iirc the LC-1 puts out 7.5-21 afr on the analog, although it can be adjusted to whatever you need. Awesome post tho. Thanks or the coding.
Old Apr 13, 2010, 06:31 PM
  #21  
Evolved Member
iTrader: (2)
 
budlong's Avatar
 
Join Date: Oct 2003
Location: norcal / socal
Posts: 512
Likes: 0
Received 0 Likes on 0 Posts
if you want to update the code and repost it, i am sure the community would appreciate it Coding is not my daily job
BUDLoNG
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Noe18
Evo X General
6
Apr 5, 2012 06:49 AM
-Evo Aaron-
Evo Show / Shine
30
Apr 19, 2010 01:21 AM
Bster13
Evo Engine / Turbo / Drivetrain
14
Dec 10, 2008 11:10 PM
wickdaddy
Lancer Show / Shine
4
Sep 12, 2006 03:47 PM
Obsoleteasian
Lancer Audio and Security (All models)
7
Sep 26, 2002 05:42 AM



Quick Reply: JDM Map Sensor and Gauge



All times are GMT -7. The time now is 07:04 AM.