Go Back   EcoModder Forum > EcoModding > Instrumentation > OpenGauge / MPGuino FE computer
Register
Now


Reply
 
Submit Tools LinkBack Thread Tools
Old 06-12-2008, 01:56 PM   #21 (permalink)
EcoModding Lurker
 
Join Date: Jun 2008
Location: NC
Posts: 30

Cxy Hatch - '92 Civic CX

0ftlbs - '05 S2000
for just an inst. mpg reading the 16x2 LCD is over kill. that was the thought at least.


(Support Ecomodder.com & get rid of these annoying ads!)      
 
  Reply With Quote
Old 06-12-2008, 03:03 PM   #22 (permalink)
EcoModding Lurker
 
Join Date: Jun 2008
Posts: 3
Quote:
Originally Posted by MilesPerTank View Post
for just an inst. mpg reading the 16x2 LCD is over kill. that was the thought at least.
It certainly was *my* thought - I was also wondering if a single readout like that needs the full processor power, or if some simpler device can do {2 inputs+some basic math=an instantaneous mpg number}. Just have to adjust for 2 variables and one calculation, as far as my Luddite mind can tell.
  Reply With Quote
Old 06-12-2008, 06:02 PM   #23 (permalink)
dcb
Master EcoModder
 
dcb's Avatar
 
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,235

pimp mobile - '81 gs 250 t
90 day: 96.29 mpg (US)
I really like the big numbers idea, it just hasn't bubbled to the top of the stack yet. Here is a quick example of what I had in mind (no hardware change necessary):


Also note that we are/will be using the trip functions for calibrating the gauge.

Last edited by dcb; 06-12-2008 at 08:24 PM.
  Reply With Quote
Old 06-12-2008, 06:09 PM   #24 (permalink)
EcoModding Lurker
 
Join Date: Jun 2008
Location: NC
Posts: 30

Cxy Hatch - '92 Civic CX

0ftlbs - '05 S2000
That looks great. Send me that software version !
  Reply With Quote
Old 06-12-2008, 06:38 PM   #25 (permalink)
dcb
Master EcoModder
 
dcb's Avatar
 
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,235

pimp mobile - '81 gs 250 t
90 day: 96.29 mpg (US)
I'm glad you like it It is just a mockup, it doesn't do anything and has not been integrated to the mpguino codebase, but here is the code if you are interested. I basically build the numbers with 5 custom block shaped characters (will need to get rid of the current custom characters for this)

PHP Code:
//GPL Software  

byte brightness[]={0,42,85,128}; //middle button cycles through these brightness settings    
#define brightnessLength (sizeof(brightness)/sizeof(byte)) //array size    
byte brightnessIdx=2;    
#define contrast 15    

//LCD Pins    
#define DIPin 4 // register select RS    
#define DB4Pin 7     
#define DB5Pin 8     
#define DB6Pin 12     
#define DB7Pin 13    
#define ContrastPin 6    
#define EnablePin 5     
#define BrightnessPin 9    
#define lcdpowerPin 15


//LCD prototype    
class LCD{    
public:    
  
LCD( ) ;    
  
void gotoXY(byte xbyte y);    
  
void print(char string);    
  
void init();    
  
void tickleEnable();    
  
void cmdWriteSet();    
  
void LcdCommandWrite(byte value);    
  
void LcdDataWrite(byte value);    
  
byte pushNibble(byte value);    
};    


//main objects we will be working with:    
LCD lcd;    

void setup (void){     
  
pinMode(lcdpowerPin,OUTPUT);    
  
digitalWrite(lcdpowerPin,LOW);
  
pinMode(BrightnessPin,OUTPUT);    
  
analogWrite(BrightnessPin,255-brightness[brightnessIdx]);    
  
delay(500);
  
digitalWrite(lcdpowerPin,HIGH);
  
lcd.init();    
  
pinMode(ContrastPin,OUTPUT);    
  
analogWrite(ContrastPin,contrast);    

  
lcd.LcdDataWrite(3);   lcd.LcdDataWrite(2);   lcd.LcdDataWrite(3); lcd.LcdDataWrite(32); 
  
lcd.LcdDataWrite(3);   lcd.LcdDataWrite(2);   lcd.LcdDataWrite(3); lcd.LcdDataWrite(32);  
  
lcd.LcdDataWrite(0);   lcd.LcdDataWrite(0);   lcd.LcdDataWrite(3); lcd.LcdDataWrite(32);  
  
lcd.print("INST");  
  
lcd.gotoXY(0,1);    
  
lcd.LcdDataWrite(1);   lcd.LcdDataWrite(1);   lcd.LcdDataWrite(3);  lcd.LcdDataWrite(32);  
  
lcd.LcdDataWrite(3);   lcd.LcdDataWrite(1);   lcd.LcdDataWrite(3);  lcd.LcdDataWrite(4);  
  
lcd.LcdDataWrite(32);   lcd.LcdDataWrite(32);   lcd.LcdDataWrite(3);  lcd.LcdDataWrite(32);  
  
lcd.print("MPG");  
  
}     

void loop (void){     
  while(
true){}    
}     



//LCD functions    
LCD::LCD(){    
}    
//x=0..16, y= 0..1    
void LCD::gotoXY(byte xbyte y){    
  
byte dr=x+0x80;    
  if (
y==1)     
    
dr += 0x40;    
  if (
y==2)     
    
dr += 0x14;    
  if (
y==3)     
    
dr += 0x54;    
  
lcd.LcdCommandWrite(dr);      
}    

void LCD::print(char string){    
  
byte x 0;    
  
char c string[x];    
  while(
!= 0){    
    
lcd.LcdDataWrite(c);     
    
x++;    
    
string[x];    
  }    
}    


//do the lcd initialization voodoo    
void LCD::init(){    
  
pinMode(EnablePin,OUTPUT);     
  
pinMode(DIPin,OUTPUT);     
  
pinMode(DB4Pin,OUTPUT);     
  
pinMode(DB5Pin,OUTPUT);     
  
pinMode(DB6Pin,OUTPUT);     
  
pinMode(DB7Pin,OUTPUT);     
  
delay(500);    

  
LcdCommandWrite(B00000010);  // 4 bit operation      

  
LcdCommandWrite(B00101000);// 4-bit interface, 2 display lines, 5x8 font     
  
LcdCommandWrite(B00001100);  // display control:     
  
LcdCommandWrite(B00000110);  // entry mode set: increment automatically, no display shift     


  
LcdCommandWrite(B01000000);  // set cgram    
  //create some custom characters    
  
byte chars[]={
    
B11111,B00000,B11111,B11111,B00000,
    
B11111,B00000,B11111,B11111,B00000,
    
B00000,B00000,B00000,B11111,B00000,
    
B00000,B00000,B00000,B11111,B00000,
    
B00000,B00000,B00000,B11111,B00000,
    
B00000,B00000,B00000,B11111,B01110,
    
B00000,B11111,B11111,B11111,B01110,
    
B00000,B11111,B11111,B11111,B01110};
        
    for(
byte x=0;x<5;x++)      
      for(
byte y=0;y<8;y++)      
          
LcdDataWrite(chars[y*5+x]); //write the character data to the character generator ram     

  
LcdCommandWrite(B00000001);  // clear display, set cursor position to zero       

  
LcdCommandWrite(B10000000);  // set dram to zero     

}      

void  LCD::tickleEnable(){     
  
// send a pulse to enable     
  
digitalWrite(EnablePin,HIGH);     
  
delayMicroseconds(1);  // pause 1 ms according to datasheet     
  
digitalWrite(EnablePin,LOW);     
  
delayMicroseconds(1);  // pause 1 ms according to datasheet     
}      

void LCD::cmdWriteSet(){     
  
digitalWrite(EnablePin,LOW);     
  
delayMicroseconds(1);  // pause 1 ms according to datasheet     
  
digitalWrite(DIPin,0);     
}     

byte LCD::pushNibble(byte value){     
  
digitalWrite(DB7Pinvalue 128);     
  
value <<= 1;     
  
digitalWrite(DB6Pinvalue 128);     
  
value <<= 1;     
  
digitalWrite(DB5Pinvalue 128);     
  
value <<= 1;     
  
digitalWrite(DB4Pinvalue 128);     
  
value <<= 1;     
  return 
value;    
}    

void LCD::LcdCommandWrite(byte value){     
  
value=pushNibble(value);    
  
cmdWriteSet();     
  
tickleEnable();     
  
value=pushNibble(value);    
  
cmdWriteSet();     
  
tickleEnable();     
  
delay(5);     
}     

void LCD::LcdDataWrite(byte value){     
  
digitalWrite(DIPinHIGH);     
  
value=pushNibble(value);    
  
tickleEnable();     
  
value=pushNibble(value);    
  
tickleEnable();     
  
delay(5);     

  Reply With Quote
Old 06-12-2008, 10:07 PM   #26 (permalink)
EcoModding Lurker
 
Join Date: Jun 2008
Posts: 3
Quote:
Originally Posted by dcb View Post
I'm glad you like it It is just a mockup, it doesn't do anything and has not been integrated to the mpguino codebase, but here is the code if you are interested. I basically build the numbers with 5 custom block shaped characters (will need to get rid of the current custom characters for this)
Now all you need is a gumstick-size board to slip behind the display and it'll fit just about anywhere! With all the creative programming, your next feat will be a scrolling display!
  Reply With Quote
Old 06-13-2008, 09:03 AM   #27 (permalink)
dcb
Master EcoModder
 
dcb's Avatar
 
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,235

pimp mobile - '81 gs 250 t
90 day: 96.29 mpg (US)
With all those pins sticking out of the nano, and given the size of the LCD, it would actually be a little larger than the custom efforts, i.e. http://ecomodder.com/forum/showthrea...3692#post33692

And I felt enough like Myron Reducto when I was making that

"I'll make you fun sized!"

Last edited by dcb; 06-13-2008 at 10:10 AM.
  Reply With Quote
Old 06-13-2008, 09:16 AM   #28 (permalink)
EcoModding Apprentice
 
awillard69's Avatar
 
Join Date: Feb 2008
Location: Streamwood, IL
Posts: 105

Dakota - '00 Dakota Club Cab, Sport
90 day: 20.1 mpg (US)

Jeep - '01 Wrangler TJ Sport
90 day: 17.49 mpg (US)
That looks great. That would make it easier to read without having to be too distracted. Plus, a big, glaring number would maybe encourage your to drive "better"!

Have it show a steady reading, or cycle through several settings every second or so, or wish, wish, wish, wish...

Keep in mind the 100+MPG people... maybe they won't need the tenths?

Accuracy and reliability before eye candy, though.
__________________

  Reply With Quote
Old 06-13-2008, 09:52 AM   #29 (permalink)
dcb
Master EcoModder
 
dcb's Avatar
 
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,235

pimp mobile - '81 gs 250 t
90 day: 96.29 mpg (US)
Quote:
Originally Posted by awillard69 View Post
Keep in mind the 100+MPG people... maybe they won't need the tenths?
Agreed, the formatter should drop the decimal point if the number is over 99.9

Quote:
Originally Posted by awillard69 View Post
Accuracy and reliability before eye candy, though.
Exactly
  Reply With Quote
Old 06-18-2008, 05:37 PM   #30 (permalink)
EcoModding Lurker
 
Join Date: Mar 2008
Location: indiana
Posts: 80

Iwishthiswasamanual - '98 Escort ZX2
90 day: 38.75 mpg (US)
Just trying to keep main thread clean.

Does this still work with EOC coasting or neutral coasting? How does it work in that situation. If i shut my car off , and turn key back to on. mpguino would lose power in my car.
  Reply With Quote
Old 06-18-2008, 10:26 PM   #31 (permalink)
dcb
Master EcoModder
 
dcb's Avatar
 
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,235

pimp mobile - '81 gs 250 t
90 day: 96.29 mpg (US)
the mpguino NEEDS to be connected to the 12 volt battery so if there are any vss pulses or injector pulses it will still count them. If you EOC without an ignition kill switch then you might not get readings while the key is off, but only because the car stopped sending them. The readings should return when the key is turned back on.
  Reply With Quote
Old 06-18-2008, 11:23 PM   #32 (permalink)
MP$
 
Join Date: Jan 2008
Location: Ohio
Posts: 476
Send a message via MSN to diesel_john
Smile

My VSS gives a signal whenever turning with or without a car hooked to it.

My KEL injector based computer switches to gal per hr if it sees no VSS signal.

Problem is during EOC it turns off because the injection signal is what turns it on and keeps it on. Instead of sensing either signal. ithink, i better double check that.

Last edited by diesel_john; 06-18-2008 at 11:32 PM.
  Reply With Quote
Old 06-18-2008, 11:33 PM   #33 (permalink)
dcb
Master EcoModder
 
dcb's Avatar
 
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,235

pimp mobile - '81 gs 250 t
90 day: 96.29 mpg (US)
Switching to GPH is an interesting idea...

Technically we typically tap into an ECU speed signal, my saturn has a hall sensor vss, but the ECU converts it to a 12 volt signal. The metro has a switch in the speedo.
  Reply With Quote
Old 06-21-2008, 09:26 PM   #34 (permalink)
dcb
Master EcoModder
 
dcb's Avatar
 
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,235

pimp mobile - '81 gs 250 t
90 day: 96.29 mpg (US)
I was thinking about if/what to do if vss pulses is 0 and injector isn't on the guino. A big part of me wants to set off a 200 decibel alarm if that situation persists for more than 10 seconds
  Reply With Quote
Old 06-30-2008, 06:55 PM   #35 (permalink)
EcoModding Lurker
 
Join Date: Mar 2008
Location: indiana
Posts: 80

Iwishthiswasamanual - '98 Escort ZX2
90 day: 38.75 mpg (US)
Trying to keep main thread clean again...

Plan on ordering parts tomorrow...

What information on pulse rates or something do i need to find out? and how can i find them out?
  Reply With Quote
Old 06-30-2008, 07:10 PM   #36 (permalink)
dcb
Master EcoModder
 
dcb's Avatar
 
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,235

pimp mobile - '81 gs 250 t
90 day: 96.29 mpg (US)
I updated post 1 under the installation notes for some online sources of vss info. on rostra it lists your zx2 as 8000 (probably really 8208) pulses per mile and gives some details how to find it on the ecu plug.

Last edited by dcb; 08-01-2008 at 08:49 AM.
  Reply With Quote
Old 07-01-2008, 07:33 AM   #37 (permalink)
EcoModding Lurker
 
Join Date: Apr 2008
Location: Ireland
Posts: 30

Baz - '93 106
90 day: 62.39 mpg (US)
Has anyone else used one on an older European diesel yet?
__________________


Goal: 3L/100KM
  Reply With Quote
Old 07-01-2008, 07:38 AM   #38 (permalink)
dcb
Master EcoModder
 
dcb's Avatar
 
Join Date: Feb 2008
Location: 3rd rock
Posts: 1,235

pimp mobile - '81 gs 250 t
90 day: 96.29 mpg (US)
I haven't heard of any. It will take a little extra sensor hardware. Diesel John has had some luck with an old flow meter: mileage computer for a carbureted engine
  Reply With Quote