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

Reply  Post New Thread
 
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 Honda Civic CX

0ftlbs - '05 Honda S2000
Thanks: 0
Thanked 0 Times in 0 Posts
for just an inst. mpg reading the 16x2 LCD is over kill. that was the thought at least.

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 06-12-2008, 03:03 PM   #22 (permalink)
EcoModding Lurker
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location:
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 157
Thanked 264 Times in 207 Posts
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.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!

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 Honda Civic CX

0ftlbs - '05 Honda S2000
Thanks: 0
Thanked 0 Times in 0 Posts
That looks great. Send me that software version !
  Reply With Quote
Old 06-12-2008, 06:38 PM   #25 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location:
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 157
Thanked 264 Times in 207 Posts
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);     

__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 06-12-2008, 10:07 PM   #26 (permalink)
EcoModding Lurker
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location:
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 157
Thanked 264 Times in 207 Posts
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!"
__________________
WINDMILLS DO NOT WORK THAT WAY!!!

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 Dodge Dakota Club Cab, Sport
90 day: 18.57 mpg (US)

Jeep - '01 Jeep Wrangler TJ Sport
90 day: 18.46 mpg (US)
Thanks: 0
Thanked 1 Time in 1 Post
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
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location:
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 157
Thanked 264 Times in 207 Posts
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
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 06-18-2008, 05:37 PM   #30 (permalink)
EcoModding Apprentice
 
Join Date: Mar 2008
Location: indiana
Posts: 233

Iwishthiswasamanual - '98 Ford Escort ZX2
90 day: 32.95 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply  Post New Thread


Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
MPGuino release one workspace dcb OpenGauge / MPGuino FE computer 1060 09-27-2016 10:56 PM
Gas scooter questions raddevon Motorcycles / Scooters 12 06-06-2011 09:34 AM
wheel airdam - deflector - strake? design questions lunarhighway Aerodynamics 14 04-02-2009 12:45 PM
Misc pumping losses questions tasdrouille General Efficiency Discussion 11 03-27-2008 08:14 PM



Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com