Dismiss Notice
Hi Guest we emailed you the other day, but we just want to let you know that our Privacy Terms have changed. You can read them here: New Privacy Terms

DIY Sub £50 Digital LCD Arduino boost gauge

Discussion in 'Leon Mk1' started by Muzza1742, Mar 26, 2012.

  1. Muzza1742

    Muzza1742 Daily Driver

    Joined:
    Dec 8, 2011
    Messages:
    156
    Likes Received:
    1
    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:

    [​IMG]
    Diy boost gauge by Muzza1742, on Flickr

    [​IMG]
    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]nick@nsfabrication.com[/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
    }
     
  2. LEE69

    LEE69 Stage 2 Revo'd

    Joined:
    Dec 10, 2004
    Messages:
    21,346
    Likes Received:
    63
    I agree lol

    Nice bit of kit
     
  3. gdjohny

    gdjohny Crazy Mechanical Engineer

    Joined:
    Dec 25, 2010
    Messages:
    818
    Likes Received:
    0
    Nice
    Once I sell some bits from my garage I will build one and fit it to my speedo :)
     
  4. JamesL

    JamesL Senior Member

    Joined:
    Dec 31, 2007
    Messages:
    1,550
    Likes Received:
    0
    Would be great if you could do a full write up once you've completed the install mate. Good work!
     
  5. Klone

    Klone Senior Member

    Joined:
    Aug 24, 2010
    Messages:
    1,542
    Likes Received:
    1
    looks SO cool mate. keep up and let us see it.

    im absolutely tempted myself for the drivers vent!
     
  6. Muzza1742

    Muzza1742 Daily Driver

    Joined:
    Dec 8, 2011
    Messages:
    156
    Likes Received:
    1
    quick check of the lcd size for the drivers door vent:
    [​IMG]
    Test fit of boost gauge by Muzza1742, on Flickr

    and then onto butchering the vent to fit it in :rofl: (and one slightly slashed thumb from being a dickhead with a stanley knife)

    [​IMG]
    Test fit with cover by Muzza1742, on Flickr

    Just need to make it abit neater now
     
  7. cupra_r_ick

    cupra_r_ick Senior Member

    Joined:
    Jan 29, 2011
    Messages:
    1,096
    Likes Received:
    2
    make me one, now !
     
  8. Allan_84

    Allan_84 Senior Member

    Joined:
    Apr 11, 2010
    Messages:
    855
    Likes Received:
    2
    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.
     
  9. Muzza1742

    Muzza1742 Daily Driver

    Joined:
    Dec 8, 2011
    Messages:
    156
    Likes Received:
    1
    I'd like to see that when hour done mate
     
  10. JamesL

    JamesL Senior Member

    Joined:
    Dec 31, 2007
    Messages:
    1,550
    Likes Received:
    0
    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!
     
  11. Muzza1742

    Muzza1742 Daily Driver

    Joined:
    Dec 8, 2011
    Messages:
    156
    Likes Received:
    1
    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.
     
  12. JamesL

    JamesL Senior Member

    Joined:
    Dec 31, 2007
    Messages:
    1,550
    Likes Received:
    0
    PLEASE do a full write up for this, I would love to make one of these!
     
  13. Muzza1742

    Muzza1742 Daily Driver

    Joined:
    Dec 8, 2011
    Messages:
    156
    Likes Received:
    1
    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.
     
  14. MarkWales

    MarkWales Senior Member

    Joined:
    Feb 22, 2009
    Messages:
    3,690
    Likes Received:
    0
    following this one to see the progress
     
  15. hpoolsteve

    hpoolsteve Full Member

    Joined:
    Mar 7, 2012
    Messages:
    227
    Likes Received:
    0
  16. seat_cr

    seat_cr Guest

    ^ same here ;-)
     
  17. Muzza1742

    Muzza1742 Daily Driver

    Joined:
    Dec 8, 2011
    Messages:
    156
    Likes Received:
    1
    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:

    [​IMG]
    Untitled by Muzza1742, on Flickr

    [​IMG]
    Untitled by Muzza1742, on Flickr

    [​IMG]
    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
     
  18. Muzza1742

    Muzza1742 Daily Driver

    Joined:
    Dec 8, 2011
    Messages:
    156
    Likes Received:
    1
    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
     
  19. LEE69

    LEE69 Stage 2 Revo'd

    Joined:
    Dec 10, 2004
    Messages:
    21,346
    Likes Received:
    63
    Like the sound of that pics when you get a mo.
     
  20. JamesL

    JamesL Senior Member

    Joined:
    Dec 31, 2007
    Messages:
    1,550
    Likes Received:
    0
    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!
     

Share This Page