DIY Sub £50 Digital LCD Arduino boost gauge

Muzza1742

Daily Driver
Dec 8, 2011
156
1
Stoke
so i got a little bored and decided i needed a new project. I like the look of the zada-tech boost gauges but i didnt want to pay £95 just for a boost gauge when i reckon i can build it myself and learn some new stuff on the way:)

First off a couple of photo's of it on the breadboard:


Diy boost gauge by Muzza1742, on Flickr


Lcd by Muzza1742, on Flickr

I've changed the display a little, it reads boost now instead of map and the psi is displayed to 1 decimal place.
the bottom line is a re-settable peak boost display that i'm eventually gonna change over to either and oil temp or something else gauge.


Its a piece of piss to build if you've got any kind of electronics knowledge at all.
I built mine following this blog: http://blog.nsfabrication.com/2009/06/29/arduino-based-lcd-boost-gauge-with-resettable-peak-hold/
but i made some changes to his code to show the pressure in PSI instead of KPa and adjusted for 1 bar of atmospheric pressure.
Ive got the arduino mega adk instead of the uno in the parts list because the chimp in maplins got my online reservation wrong and put a £60 board in instead of the cheaper one i ordered :D

Parts list:
http://www.coolcomponents.co.uk/catalog/arduino-revision-p-583.html Main board £18.50
http://www.coolcomponents.co.uk/catalog/serial-enabled-16x2-black-p-472.html 16x2 Serial LCD £15.99
http://www.coolcomponents.co.uk/catalog/resistor-025w-p-339.html 10k resistor £0.10
http://www.coolcomponents.co.uk/catalog/rotary-potentiometer-linear-p-920.html 10k Pot to simulate the map sensor until i put it on the car £0.45
http://www.coolcomponents.co.uk/catalog/switch-mini-tactile-p-202.html momentary switch for the peak reset £0.28
http://uk.farnell.com/jsp/search/pr...12&s_kwcid=TC|13123|mpx4250ap||S|p|9695405829 MPX4250AP manifold absolute pressure sensor £8.74

for a total of £44.06 and a couple of hours tinkering. I've enjoyed building it and if anyone wants to have a go hopefully this post makes things a bit easier for anyone else


And now the important part: the code for the Arduino
Code:
// NSFabrication.com Arduino boost gauge project
// Uses Freescale MPX4250AP MAP sensor on Analog port 0 and SparkFun 16×2 Serial LCD display
// Push button on D2 pulled to 5V, ground to reset peak memory
// 06-29-2009 Nick Salyer [email][email protected][/email]

int mapsen = 0; // Set MAP sensor input on Analog port 0
float boost = 0; // Set boost value to 0
float mapval = 0; // Set raw map value to 0
volatile float peakboost = 0; // Set peak memory to 0

void setup()
{
attachInterrupt (0, preset, LOW); // defines reset interrupt on D2
Serial.begin(9600); // Open serial port
Serial.write(254); // SerLCD instruction
Serial.write(01); // Clear display
Serial.write(254); // SerLCD instruction
Serial.write(128); // “Powered by:” on first line, left align
Serial.print("Seat Leon");
Serial.write(254); // SerLCD instruction
Serial.write(197); // “NSFabrication” on second line, left align
Serial.print("Cupra 1.8T");
delay (4000); // Display splash screen for 2 seconds
Serial.write(254); // SerLCD instruction
Serial.write(01); // Clear display
Serial.write(254); // SerLCD instruction
Serial.write(128); // “MAP:” at top right of display
Serial.print("BOOST");
Serial.write(254); // SerLCD instruction
Serial.write(140); // “PSI” three digits to the right of “MAP:”
Serial.print("PSI");
Serial.write(254); // SerLCD instruction
Serial.write(192); // “Peak:” at bottom right of display
Serial.print("PEAK");
Serial.write(254); // SerLCD instruction
Serial.write(204); // “PSI” left of peakboost
Serial.print("PSI");
}

void loop()
{
mapval= analogRead(mapsen); //Reads the MAP sensor raw value on analog port 0
boost = (mapval*(.00488)/(.022)*(0.145)-14.5); //Converts raw MAP value to PSI and accounts for atomospheric pressure

if (boost > peakboost) // If current boost is higher than peak, store in peak memory
{
peakboost = boost ;  // Store current boost in peak memory
}

if (peakboost <= 0) // Shifts peak value 1 character to the right if < 10PSI
{
Serial.write(254); // SerLCD instruction
Serial.write(197); // Peak display after “Peak:”
Serial.print(peakboost,1); //peak to 1 decimal
}
else
{
Serial.write(254); // SerLCD instruction
Serial.write(197); // Go to position 22
Serial.write(32); // Load clear bit at position 22
Serial.write(254); // SerLCD instruction
Serial.write(198); // Go to position 22
Serial.write(32); // Load clear bit at position 23
Serial.write(254); // SerLCD instruction
Serial.write(199); // Go to position 22
Serial.write(32); // Load clear bit at position 24
Serial.write(254); // SerLCD instruction
Serial.write(200); // Go to position 22
Serial.write(32); // Load clear bit at position 25
Serial.write(254); // SerLCD instruction
Serial.write(201); // Go to position 22
Serial.write(32); // Load clear bit at position 26
Serial.write(254); // SerLCD instruction
Serial.write(202); // Go to position 22
Serial.write(32); // Load clear bit at position 26
Serial.write(254); // SerLCD instruction
Serial.write(198); // Peak display after “Peak:”
Serial.print(peakboost,1); //peak to 1 decimal
}
if (boost <= 0) //Shifts the MAP value 1 character to the right if < 10PSI
{
Serial.write(254); // SerLCD instruction
Serial.write(133); // boost after “MAP:”
Serial.print(boost,1); //boost to 1 decimal
}
else
{
Serial.write(254); // SerLCD instruction
Serial.write(133); // Go to position 6
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(134); // Go to position 7
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(135); // Go to position 8
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(136); // Go to position 9
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(137); // Go to position 10
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(138); // Go to position 11
Serial.write(32); // Load clear bit at position 4
Serial.write(254); // SerLCD instruction
Serial.write(134); // boost after “MAP:”
Serial.print(boost,1); // boost to one decimal
}
delay(100); // prevents LCD display from ghosting. Lower number refreshes faster, higher number has less ghosting on slow LCD’s
}

void preset() //peak reset if D2 goes low
{
peakboost = boost; //sets peakboost to current boost reading, resetting the peak memory
}
 

Allan_84

Active Member
Apr 11, 2010
851
3
Denmark
great project ;)

im on something similar, but not with an arduino, i use an Amicus board, its the same just PIC micro chip instead of the atmel microcontroller.

when/if its done il post picture of it also.
 
Dec 31, 2007
1,479
0
Reading
I have a parrot partially blocking the drivers vent, so I try to kee the vent closed. I've noticed that the blowers are noisier when the drivers vent is closed though, which is a bit frustrating!
 

Muzza1742

Daily Driver
Dec 8, 2011
156
1
Stoke
ive removed the vent and sealed it shut now so it shouldnt blow to much. i know what you mean about the noise though.
managed to pick up the map sensor for $6 by saying im prototyping a new product to bring to market with my "company" :)
i figured out how to take a voltage off a two wire temp sensor using another resistor so all i need now is to find a decent temp sensor and thats one more thing down.
also picked up a LDR (light dependent resistor) to put into the modded vent so all ive got to do now is to write some code and make it dim at night and full brightness during the day.
 

Muzza1742

Daily Driver
Dec 8, 2011
156
1
Stoke
my map sensor showed up today but in typical fashion i wasn't paying attention to what i ordered. ended up with a mpx4250gp instead of a mpx4250ap.
The difference being that the ap is an absolute pressure sensor and the gp is gauge pressure. the gp wont show a negative pressure reading when it on vac because it only shows pressure above current atmospheric pressure. the ap is absolute pressure and would show -14.5 psi to 21.4 psi.

But seeing as the mrs lost her job yesterday all spending is cancelled and i'll fit the gauge with the gp map this weekend.
 

Muzza1742

Daily Driver
Dec 8, 2011
156
1
Stoke
did a bit of fiddling with it yesterday.
Got the gauge fitted but because it was threatening to rain all day i was rushing and didnt take many pictures.

Here's the three i did take:


Untitled by Muzza1742, on Flickr


Untitled by Muzza1742, on Flickr


Untitled by Muzza1742, on Flickr

So far everything works as intended, i need to do some adjusting on the code to slow the refresh and put a capacitor into the map sensor circuit to even out the readings.

I've changed the peak reading display to a temp sensor (taking readings from a forklift truck oil sensor going spare at work) but because im skint now its not wired up until i can get an adapter for the sump plug.

Another thing im not 100% happy with is the readability of the lcd in daylight so i need to do some more testing and i might change it over to an OLED once the mrs finds a new job
 

Muzza1742

Daily Driver
Dec 8, 2011
156
1
Stoke
decided to strip out the clocks and fit the lcd in there instead cause im not happy with the way the light shines onto it when its sat in the vent. just means i need to buy some new vent internals now
 
Dec 31, 2007
1,479
0
Reading
Sorry to hear about the missus losing her job mate :(. Hopefully she'll find something soon!

Good work on the board as it is though! Where abouts are you going to put it in the clocks?

Btw - What are you going to do with the old vent? I've been after one that I want to pull apart anyway, pm me if you want rid of it! I've got a paypal account sat doing nothing!
 
Adrian Flux insurance services - discount for forum members.