DIY EGT display approx $16

pkhoury

That guy with the goats
Joined
Nov 30, 2010
Location
Medina, TX
TDI
2013 JSW, 2003 Jetta Ute, 2 x 2002 Golf, 2000 Golf
Now I have a question relating to the project itself. Since the OLED display only has 4 pins, do you think I could probably wire it up using USB connectors? I thought of using a mini-USB cable or something, so I could have the display on the dash, and the logic board elsewhere. I'm probably making things too complicated, but I don't know what else I could use to enclose the whole thing.
 

Aknovaman

Well-known member
Joined
Sep 26, 2016
Location
Tecumseh
TDI
2001 golf tdi
Usb would be fine. I have looked at plumbing caps with smoked lense and also just simple plastic trim that go is around Formica to make it very slim. To be honest, I need to hit Lowes to see what I can find.

For the gasoline guys, I worked on my Flex Fuel coding last night. It's all done as the ethanol % reads perfect except I want to add fuel temperature to the display. It reads too erratic, now.
 
Last edited:

bwk9087

Veteran Member
Joined
Mar 23, 2016
Location
MI
TDI
2007 Jeep JKU 1.9 ALH
Has anyone come up with an idea for an enclosure yet? I'm still waiting on my arduino boards to arrive, but have the other components.
This is probably a dumb question, but where exactly would I attach the thermocouple on the car?
Ok, after Asking this question myself, I searched and found somebody had made a cover, and a back plastic plate for these displays. I uploaded them into 3d builder which is included in windows 10 for free, and then sent them off to a 3d printer, right thru the program, pretty easy, and they seem decent. I can't upload attachments, yet, so they are on my dropbox. I have included pics, and a screenshot of 3d builder, and the files. Thank you to Aknovaman for sharing this, there are so many possiblities for guages now.
https://www.dropbox.com/s/806ph6sofcku2kj/pic of 3d builder with oled files.jpg?dl=0
https://www.dropbox.com/s/j6lig8udig2faga/back.stl?dl=0
https://www.dropbox.com/s/zqmi7opri9owh7f/front_with_ears.stl?dl=0
https://www.dropbox.com/s/ibirbsh4zu4hcse/2017-02-17 09.17.46.jpg?dl=0
https://www.dropbox.com/s/1sl8tsa5nqniqmm/2017-02-17 09.15.09.jpg?dl=0
 

pkhoury

That guy with the goats
Joined
Nov 30, 2010
Location
Medina, TX
TDI
2013 JSW, 2003 Jetta Ute, 2 x 2002 Golf, 2000 Golf
Agreed, but still a nice way to mount it. I don't use Windows 10 in production (staying with Win 7 Embedded until support ends in 2023), so I can't use 3d builder (nor would I probably know what to do with it).

And yes, thanks Aknovaman for the whole idea in the first place. Glad I found out about it through my thread.

Another dumb question -where could I order 4 pin header with wires already in it? I think that would be the best route for me, so if the display ever fails, just plug in a new one.
 

Aknovaman

Well-known member
Joined
Sep 26, 2016
Location
Tecumseh
TDI
2001 golf tdi
I removed the header to save space. 4 wires are easy to solder. I have run these displays for about a year 24/7 without failure. Velcro mount cause i dont want any screws showing or holes in my dash. I know zero about how to do any 3d cad.
.Waiting on the larger 1.3 inch displays to arrive for my old weary eyes.
 
Last edited:

chapelhill

Veteran Member
Joined
Aug 19, 2005
Location
Scotland
TDI
03 Ibiza pd13- 2260vk Turbo etc.., Merc E280cdi
Here is my version of this. My old McNally gauge has the usual problem of display numbers not showing properly and since I changed to 4 bar boost it was not calibrated right so this looked like just the job to replace it.


Someone else will be able to make a much better job, but tis is my starting point. Since screen is thin rather than putting in a box I have just used Velcro to attach to dashboard, but not you have to keep cable short to Arduino or it will not be able to communicate, I have around 1m.

EMP in bar on left (yes seem to be a bit off at atmospheric pressure, but could be EMP line close to clogging), boost in bar on right. Smaller decimal point and numbers squeezed together, negative is thin line at top left you would recognise it if you see it, to get numbers big enough for my old eyes.


Bottom section has two bar graph representations of pressure, top is boost and bottom emp up to maximum of 4 both on the same scale. The overwrite the max hold numbers.

Numbers in the bottom section are emp max, boost max, then emp max and boost max reset every two minutes.


Quick video with car stationary but you have to use high definition to see numbers and bar graph.
https://www.youtube.com/watch?v=vRJ54EaGNHk

Quick video showing the two minute reset working.
https://www.youtube.com/watch?v=NmGcb2yb3mw

Arduino nano, OLED 128x64, Bosch 4 bar sensor, MacNally 75psi sensor for EMP.


My rough code:
Code:
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
int OLED_RESET = 4;
Adafruit_SSD1306 display(OLED_RESET);
float Vcc_Per_ADC = 0;
void setup() {
Serial.begin(9600); //To comunicate with the PC
display.begin(SSD1306_SWITCHCAPVCC); //To supply the 3.3V power supply
pinMode(0, INPUT); //Set analog pin 0 as an input from the sensor
pinMode(1, INPUT); //Set analog pin 1 as an input from the sensor
display.clearDisplay(); //Clear the display and ram
Vcc_Per_ADC = readVcc()/1024.0; //initialise the calbration of ADC voltage
delay(500);
}
void loop() { // Start loop 
static int raw_bst = 0; // Setup raw boost sensor value
static int raw_emp = 0; // Setup raw emp sensor value
static int peak_raw_bst = 0; // Setup peak boost value
static int peak_raw_emp = 0; // Setup peak emp value
static int peak_raw_bst_st = 0; // Setup peak boost value last two minutes
static int peak_raw_emp_st = 0; // Setup peak emp value last two minutes
static int grphboost = 0; // Setup value for boost bar
static int grphemp = 0; // Setup value for boost bar
static int bst_bar = 0; // Setup boost value
static int emp_bar = 0; // Setup boost value
static int bst_barpeak = 0;
static int emp_barpeak = 0;
static int bst_barpeak_st = 0;
static int emp_barpeak_st = 0;
static int x = 0; //counter
static int samples = 20;
static int sample_interval = 8;
static unsigned long lasttime = 0;  //time value to reset peak every two minutes
Vcc_Per_ADC = (9*Vcc_Per_ADC + readVcc()/1024.0)/10.0 ; //calibrate the ADC voltage with a running average to smooth noise
raw_bst = analogRead(0); // Read MAP sensor raw value on analog port 0
raw_emp = analogRead(1); //Read MAP sensor raw value on analog port 0
delay(sample_interval);  //wait as per following routine between raedings
for(x = 0; x <= (samples-2); x++) { //loop to average a few readings
raw_bst += analogRead(0);
raw_emp += analogRead(1);
delay(sample_interval);
}
raw_bst =  int ((raw_bst/samples)+0.5); //get avergage and convert to integer
raw_emp = int ((raw_emp/samples)+0.5); //get average and convert to integer
//vw 4 bar sensor p bar = V volts x 0.85261 + 0.1581 bar
//vw 4 bar formula = raw x 0.003911 + 0.1581
bst_bar = int (((raw_bst*Vcc_Per_ADC*0.85261/1000) + 0.1581)*10-10+0.5); // Calculate manifold bar from raw value
//Mcnally 75psi p bar = V volts x 1.293 - 0.647bar //think 500mV=0mBar absolute, 4500mV=75psi
//Mcnally raw x 6.743 - 1.439bar
emp_bar = int (((raw_emp*Vcc_Per_ADC*1.293/1000) -  0.647)*10-10+0.5); // Calculate emp from raw value
grphboost = int ((bst_bar) * 3.2); // Calculate boost value for the bargraph 4 secions 125 pixels wide total 
grphemp = int ((emp_bar) * 3.2); // Calculate boost value for the bargraph 5 secions 125 pixels wide total
if ( millis() - lasttime > 120000) {
lasttime = millis();
peak_raw_bst_st = 0;
peak_raw_emp_st = 0;
}
if (raw_bst > peak_raw_bst){ // If current boost is higher than peak, store new value
peak_raw_bst = raw_bst ; // Store new peak value in peak memory
bst_barpeak =  (((peak_raw_bst*Vcc_Per_ADC*0.85261/1000) + 0.1581)*10-10); // 
}
if (raw_bst > peak_raw_bst_st){ // If current boost is higher than peak, store new value
peak_raw_bst_st = raw_bst ;  
bst_barpeak_st =  (((peak_raw_bst_st*Vcc_Per_ADC*0.85261/1000) + 0.1581)*10-10); //      (((peak_raw_bst_st * 0.003911) + 0.1581)*10-10);
}
if (raw_emp > peak_raw_emp){ // If current boost is higher than peak, store new value
peak_raw_emp = raw_emp ; // Store new peak value in peak memory
emp_barpeak = (((peak_raw_emp*Vcc_Per_ADC*1.293/1000) -  0.647)*10-10);     //
}
if (raw_emp > peak_raw_emp_st){ // If current boost is higher than peak, store new value
peak_raw_emp_st = raw_emp ; // Store new peak value in peak memory
emp_barpeak_st = (((peak_raw_emp_st*Vcc_Per_ADC*1.293/1000) -  0.647)*10-10);     //(((peak_raw_emp_st *0.006743) - 1.439)*10-10);
}
display.display();
display.clearDisplay();
display.setTextColor(WHITE);
send_pres_to_oled(10,7,4,emp_bar); //send emp
send_pres_to_oled(72,7,4,bst_bar); //send boost
send_pres_to_oled(68,45,2,emp_barpeak_st);
send_pres_to_oled(100,45,2,bst_barpeak_st);
send_pres_to_oled(4,45,2,emp_barpeak);
send_pres_to_oled(36,45,2,bst_barpeak);
display.drawRect(1, 40, 131, 24, WHITE); //Border of the bar chart
display.drawLine(32,40,32,63, WHITE); //draw bar boost markers
display.drawLine(64,40,64,63, WHITE); //draw bar boost markers
display.drawLine(96,40,96,63, WHITE); //draw bar boost markers
//display.drawLine(125,40,125,63, WHITE);
display.fillRect(1, 40, grphboost, 9, WHITE); //Draws the bar depending on the sensor value
display.fillRect(1, 55, grphemp, 9, WHITE); //Draws the bar depending on the sensor value
display.drawRect(1, 1, 127, 63, WHITE); //Border of the entire screen
//delay(100);
}
long readVcc() {
long result;
// Read 1.1V reference against AVcc
ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
delay(2); // Wait for Vref to settle
ADCSRA |= _BV(ADSC); // Convert
while (bit_is_set(ADCSRA,ADSC));
result = ADCL;
result |= ADCH<<8;
result = 1076490L / result; // Back-calculate AVcc in mV
//Serial.println(result);  //use this to adjust line above to calibrate readVcc should be the same as measure on 5v pin or Vref pin, mine read 4.71 volts on usb supply
return result;
}
void send_pres_to_oled(int first_pos,int height_pos, int text_size,int press_val){
//first_pos = 10, second_pos = 35, height_pos = 7 , text_size = 4
display.setTextSize(text_size);  
display.fillRect(first_pos + 6* text_size, height_pos + 6 * text_size , text_size, text_size, WHITE); //decimal point  
if (press_val < 9.5)  {    //anything from 9.5 upwards would be rounded to 10 so using two chars
if (press_val < 0) {   //deal with negative as normal negative requires entire char width
press_val = press_val*-1;
display.fillRect(first_pos-1, height_pos-text_size, 2*text_size, text_size/2, WHITE);
}
display.setCursor(first_pos, height_pos);
display.println(0);
display.setCursor(first_pos + 7*text_size, height_pos);
display.println(press_val);
}
else   {
display.setCursor(first_pos, height_pos);
display.println(press_val);
}
}
 

Aknovaman

Well-known member
Joined
Sep 26, 2016
Location
Tecumseh
TDI
2001 golf tdi
I have not seen any aging of these displays. They can be dimmed in the code by turning the display off and on with a pwm fashion but i have not written that into my code.

This code works well for boost display and it has smoother font.

https://youtu.be/47cdiDrc0xk

Not sure but some variation of this code may work to dim display.
SSD1306 OLED how to extend life time and reduce consumption.

https://forum.arduino.cc/index.php?topic=401620.0

I prefer the smoother and more round U8G and not block style fonts in the Adafruit library. The adafruit is too blockey for me.

I will post my new code when its done.
 
Last edited:

pkhoury

That guy with the goats
Joined
Nov 30, 2010
Location
Medina, TX
TDI
2013 JSW, 2003 Jetta Ute, 2 x 2002 Golf, 2000 Golf
More questions, and my apologies if they're not very smart ones. When I solder the header onto the nano PCB, am I supposed to solder both sides, or would I just solder the bottom (if the header faces upwards)? It's been a few years since I've done any soldering, so I don't even know what temperature I'm supposed to use.
 

Aknovaman

Well-known member
Joined
Sep 26, 2016
Location
Tecumseh
TDI
2001 golf tdi
Top or bottom is fine. They board is plated through the holes. If your iron has a temperature setting, 650 is good.
 

pkhoury

That guy with the goats
Joined
Nov 30, 2010
Location
Medina, TX
TDI
2013 JSW, 2003 Jetta Ute, 2 x 2002 Golf, 2000 Golf
If necessary I can write step by step directions on how to set up the software to load the sketch. Just need a few days.

I just used cat-5 cable wires cause they are solid/semi-rigid and free.

Windex, Here is a link to the wiring connections.

https://youtu.be/x6wSGZ9bYPk
Would you have a written list of wiring connections? I have to watch the video again. So far, I figured that SCL on the OLED goes to A5 on the nano, and SCM goes to A4. Kind of a PITA that there's only one connector for VCC, but 2 for ground.

*edit* I got the code to compile and uploaded it to my Chinese nano knockoff. Had to get the Chinese drivers for the USB to serial IC on it. Next up is figuring out how to connect the MAX6675 VCC and GND.

I don't suppose the Uno has a second VCC connection on the board? Or would the code for the Nano differ substantially from the Uno, where you couldn't compile the same code on different boards?
 
Last edited:

Aknovaman

Well-known member
Joined
Sep 26, 2016
Location
Tecumseh
TDI
2001 golf tdi
You can load the code in just about any of the boards.
I just stacked the vcc and ground wires directly on the nano.

My 1.3 inch oled displays arrived so its much easier to see. Not to lig and not too small. I loaded code into the pro micro boards as i prefer the cell phone charge cable connector over the larger connector on the nano board.
 

Aknovaman

Well-known member
Joined
Sep 26, 2016
Location
Tecumseh
TDI
2001 golf tdi
Last edited:

pkhoury

That guy with the goats
Joined
Nov 30, 2010
Location
Medina, TX
TDI
2013 JSW, 2003 Jetta Ute, 2 x 2002 Golf, 2000 Golf
I also found out the hard way, accidentally reversing vcc and gnd on the oled kills it. I wish I'd ordered more displays, but I still have one good one (the bicolor yellow/blue) and it works. I'm thinking I might just use those dupont connectors and quick splice connectors in the future, or a blank board with female headers, so I don't have to worry about bad solder joints.

But then there's still the enclosure conundrum...
 

Aknovaman

Well-known member
Joined
Sep 26, 2016
Location
Tecumseh
TDI
2001 golf tdi
Spend a bit more and get the 1.3 inch displays. They are definitely worth it. The white ones appear to be kind of grey and not bright white like a laptop screen white font. I prefer the all blue design.
Depending on which ebay display seller you choose, the pinout may vary.

To be honest, I have not spent more than 10 minutes looking for a case. :)

If I recall correctly, someone offered to make a 3D printed case. .????????
 
Last edited:

benhart16

Well-known member
Joined
Jun 9, 2011
Location
Seattle, WA
TDI
2000 Jetta tdi
If I recall correctly, someone offered to make a 3D printed case. .????????

I think I offered something of the sort in another thread. To be honest, I haven't read this entire thread, so I don't know what the exact design ideas people want or are considering. Were you guys wanting the board and screen to be in a single case, or would you guys like the board in a separate box than the screen? I was thinking of designing a screen mount for my MK 4 that would clip into the heater vent (and sit on the dash) on the left side of the steering wheel. I'd be happy to share the CAD files. Has everyone settled on the 1.3 inch screen?
 

chapelhill

Veteran Member
Joined
Aug 19, 2005
Location
Scotland
TDI
03 Ibiza pd13- 2260vk Turbo etc.., Merc E280cdi
Here is my new version . I used a little part of code from Chapelhill to save peak value .
I love Arduino :D

https://www.youtube.com/watch?v=bdnQrl0PDNA
Looks very good but you should post your code too so others can benefit.

I think the 0.96 inch screen is a bit small for two pressures but I have ordered 1.3 inch version to help.
Looking to turn 2 minute peak and reset function to peak in last 2 minutes function.
I like the graph you have which your code may help me with my function.
I may also put in a calculation for pressure flutter between subsequent readings as I am having problem with surge, which is probably just not enough fuel mapped in on duration map after swapping injectors.
 

Libang

Active member
Joined
Sep 4, 2009
Location
Czech Republic
TDI
TDI power :)
Here is my code . This version doesn't have atmospheric pressure correction because my sensor is broken .
I want to try 2.42" oled screen with EGT , EMP , BOOST , IAT , Log , AFR etc... looks good http://www.ebay.com/itm/I2C-2-42-OL...e-Display-Arduino-PIC-Multi-wii-/191835417966
I'm not an expert on programming, this is my first experience with Arduino .

Code:
//Arduino nano , 1.3" I2C OLED 

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH1106.h>
#define sensorPin 0

int OLED_RESET = 4;
Adafruit_SH1106 display(OLED_RESET);

// bar graph

float rawval = 0; // Setup raw sensor value
float barboost = 0; // Setup value for boost bar

// peak

int boostPeakReset = 4000; // time in milis to reset peak value
float boostPeak = 0.00;
float boostMax = 0.00;
unsigned long boostPeakTimer = 0;

// log

byte count;
byte sensorArray[128];
byte drawHeight;
boolean filled = 0; //decide either filled, or dot-display. 0==dot display.


void setup()
{
  display.begin(SH1106_SWITCHCAPVCC); // 3.3V power supply
  display.clearDisplay(); // Clear the display and ram
  for (count = 0; count <= 128; count++) //zero all elements
  {
    sensorArray[count] = 0;
  }
}


void loop() // Start loop
{
  int boostmbar = map(analogRead(sensorPin), 21, 961, 100, 2600);
  rawval = analogRead(0); // Read MAP sensor raw value on analog port 0
  barboost = (((rawval * 0.19) - 69.45) + 10); // Calculate boost value for the bargraph  


  if (boostPeak < boostmbar && boostmbar > 0.50) {
    boostPeak = boostmbar;
    boostPeakTimer = millis();
    if (boostMax < boostPeak) {
      boostMax = boostPeak;
    }
  }
  else if (boostPeak > boostmbar && (millis() - boostPeakTimer) > boostPeakReset) {
    boostPeak = 0.00;
  }


  // log 

  drawHeight = map(analogRead(A0), 0, 1023, 0, 25 );  

  sensorArray[0] = drawHeight;

  for (count = 55; count <= 128; count++ )
  {
    if (filled == false)
    {
      display.drawPixel(count, 71 - sensorArray[count - 55], WHITE);
    }
    else
      display.drawLine(count, 1, count, 71 - sensorArray[count - 55], WHITE); 
  }

  for (count = 80; count >= 2; count--) // count down from 160 to 2
  {
    sensorArray[count - 1] = sensorArray[count - 2];
  }

  display.drawLine(55, 43, 55, 64, WHITE);
  display.setTextColor(WHITE);
  display.setTextSize(4);
  display.setCursor(0, 0);
  display.println((boostmbar * 0.001) - 0.97);    // 0.97 = 970mbar atmospheric pressure correction

  display.drawRect(0, 31, 128, 12, WHITE); // Border of the bar chart
  display.fillRect(0, 31, barboost, 12, WHITE); // Draws the bar depending on the sensor value

  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.setCursor(97, 20);
  display.println("BOOST");

  display.setTextSize(2);
  display.setCursor(3, 48);
  display.println((boostPeak * 0.001) - 0.97); // 0.97 = 970mbar atmospheric pressure correction


  if (2700 < boostmbar ) {
    display.setTextSize(1);
    display.setCursor(105, 5);
    display.println("MAX");
  }
  else if (2700 > boostmbar ) {
    display.setTextSize(1);
    display.setCursor(105, 5);
    display.println("");
  }

  delay(1);
  display.display();
  display.clearDisplay();
}
 
Last edited:

Aknovaman

Well-known member
Joined
Sep 26, 2016
Location
Tecumseh
TDI
2001 golf tdi
I have one of the nextion 7 inch versions. The colors and resolution are very good. The demo works perfectly with the mega arduino. My original plan was to use it but am taking baby steps to get there. Not sure which pins are used by the display and which are available for external inputs. Thats a project for next month....... too busy right now.
 

Aknovaman

Well-known member
Joined
Sep 26, 2016
Location
Tecumseh
TDI
2001 golf tdi
Adding two high temp alarms to the code. :cool:

What is threshold for HIGH temperature and WAY TOO DANG HIGH?

:eek: :eek: :eek:
 
Top