Well I did make a nice post with pictures and details of my gauge but it seems I cant post images until I have 15 posts And I have no intention of randomly spamming posts until I reach that number. So for the time being I will just have to put off posting my project.
if you wanna upload the pics somewhere and send me the links ill post them for ya.
killerog said:Here are the images, few of both the screen and arduino clone board.
This image shows the screen in its housing, only has a temp paint job to test colour so ignore the terrible finish. Has two buttons, one to change screen and one to change/reset a setting on the current screen. The screen its self has an RGB back light which is not on in the picture but it allows me to set the back light to almost any colour, so should be able to match any colour used in a car.
The second image shows the PCB I made for the the buttons/screen.
Next image shows the arduino clone board I made. It only has the require inputs/outputs to cut down cost. The "jumper" you see plugged in allows the selection of 5v source, Either the car or a USB input.
Final image is that of the housing holding the arduino clone board.
I haven't been able to find my program yet, so I will either redo it or keep looking. I can also go into more detail into the two boards I have built if people are interested.
Hey there. Nice project! Your post convinced me to go ahead and dive into this. I had been researching quite a while and wasn't sure if I could take on something like this with no electronics experience or programming besides from Visual Basic. After going through Adafruit's tutorials though, it was so simple (for the most part...the formula I kept finding for the MPX4250AP sensor wasn't working correctly for me).
But I saw that you are always looking for other projects out there. I put up a write up here if you want to check mine out: cstark27.blogspot.com
I'm still trying to find the perfect screen as I haven't liked either ones I've got but oh well.
#include <LiquidCrystal.h>
#include <EEPROM.h>
LiquidCrystal lcd(3, 2, 5, 6, 7, 8);
//Button input pins
const int buttonPin1 = 8;
const int buttonPin2 = 12;
//Led output pins
const int ledPin1 = 9; //Blue
const int ledPin2 = 10; //Green
const int ledPin3 = 11; //Red
//Analog input pins
const int analogPin = 0;
//Global varibles
int startingBoostRaw = 0;
int startingBoostKPA = 0;
int boostValueRaw = 0;
int boostValueKPA = 0;
float boostValuePSI = 0;
int boostValueBar = 0;
int peakBoostKPA = 0;
int screenNumber= 0;
int buttonState1 = 0;
int buttonLastState1 = 0;
int buttonState2 = 0;
int buttonLastState2 = 0;
int addr = 0;
void setup()
{
//Set up LCD and show starting message
lcd.begin(16, 2);
lcd.noCursor();
lcd.print("SEAT Ibiza FR");
//Set up backlight
analogWrite(ledPin1, 255);
analogWrite(ledPin2, 255);
analogWrite(ledPin3, 255); //RED
//Set up pins
pinMode(buttonPin1,INPUT);
pinMode(buttonPin2,INPUT);
int reseted;
//Has the program been run already?
//Get "bool" value from memory
reseted = EEPROM.read(1);
if (reseted == 0) //If no the set the peak boost value to 0.
{
peakBoostKPA = 0;
EEPROM.write(1,1);
}
else //else Get peak boost value from memory
{
peakBoostKPA = EEPROM.read(addr);
}
startingBoostRaw = analogRead(analogPin); //Get the starting pressure value (may not work in car)
startingBoostKPA = (startingBoostRaw*(.00488)/(.022)+20); //Converts raw MAP value to kPa
//Start the serial port
Serial.begin(9600);
delay(5000); // Delay to show the starting message
}
void loop()
{
delay(100);
//Read button states
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
if (buttonState1 != buttonLastState1)
{
if (buttonState1 == HIGH)
{
screenNumber++;
if (screenNumber >= 3)
{
screenNumber = 0;
}
}
}
buttonLastState1 = buttonState1;
BoostCal();
if (screenNumber == 0)
{
Screen1();
}
if (screenNumber == 1)
{
Screen2();
}
if (screenNumber == 2)
{
Screen3();
}
}
//Works out the current boost value
void BoostCal()
{
boostValueRaw = analogRead(analogPin);//Read analog pin in
boostValueKPA = (boostValueRaw*(.00488)/(.022)+20) - startingBoostKPA; //Converts raw MAP value to kPa
boostValuePSI = (boostValueKPA * (.14503773773020923)) ;
if (boostValueKPA > peakBoostKPA) // if the new KPA value is higher then the peak value write it to the EEPROM
{
EEPROM.write(addr, boostValueKPA);
}
//Do other conversions
Serial.println(boostValueRaw);
Serial.println(boostValueKPA);
Serial.println(boostValuePSI);
}
void Screen1()
{
lcd.clear();
lcd.print("Value:");
lcd.print(boostValuePSI);
lcd.setCursor(0,1);
lcd.print("Peak:");
lcd.print(boostValueRaw);
Serial.println("Screen1");
buttonState2 = digitalRead(buttonPin2);
if (buttonState2 != buttonLastState2)
{
if (buttonState2 == HIGH)
{
peakBoostKPA = 0;
}
}
buttonLastState2 = buttonState2;
}
void Screen2()
{
lcd.clear();
lcd.print("Screen 2");
Serial.println("Screen2");
}
void Screen3()
{
lcd.clear();
lcd.print("Screen 3");
Serial.println("Screen3");
}
lol as much as mine works its still a work in progress for me and im always playing with it. im not sure i could knock out a retail quality unit
for oil temp your probably looking at £20 for the arduino, another £20 for the lcd, a couple of quid for wires and stuff, probably £5-£10 if you want a protosheild to mount it on, £10 for a 1/8npt temp sensor and £10 for the adapter to fit it into the leon sump (m14).
So your looking at £70ish for all the bits. All those prices are guesses btw
Had a bit of a delay with mine, stupid board I use to the program the ardinuo decided to stop working so I had to wait for a replacement.
I have redesigned my main board to use two Ethernet cables (Good idea you had there) to connect to my screen instead of 13 lose wires. They kept coming lose making testing a pain and I couldn't see them staying in the correct place in a normal car let alone one with suspension like that in the FR. I will get some pictures up of the new board when my mate has finished work so he can upload them again.