Automatic Tire Inflator!!!

(trying not to sound cliche...)
serial.print("hello, arduino.cc/forum/ !!!");


Intro:
I am a complete n00b when it comes to microcontrollers. I bought a picaxe a couple years ago, and tried messing with it but eventually lost interest because it was confusing me and I really had nothing useful to do with it, i just wanted to learn it.

Fast forward to now, I just bought an Arduino Demunlovve (or however its spelled) and an LCD\Keypad Shield from DF Robot. I figure that i shouldn't waste time with the picaxe when trying to learn, since arduino is so well documented with libraries and stuffs and of course this forum full of people willing to help. I have a background in Mechanical Engineering with some knowledge of basic circuits. I REALLY want to learn this stuff so I can bring some of my dumb ideas to life. I need an end goal, so I came up with (drumroll..) THE AUTOMATIC TIRE INFLATOR!!!
I figure i will learn A LOT if I can complete this /simple/ project.


What I plan on using:
Arduino Demunlofevaerefassferfoh (gah)
LCD\Keypad Shield from DF Robot
Freescale Semiconductor MPX5500 Pressure sensor - should be good enough for my car tire
cheapie air compressor from harbor freight - not exactly what I have, but you get the idea
IRF510 MOSFET and protection diode - this will switch the compressor on and off.


Goal:
I have a tire that has a slow leak, and I have to inflate it every couple days. Instead of spending money on a new tire, I spent it on an Arduino. My girlfriend says i'm an idiot (she's heard this before... "Yeah! I'm gonna do it!").

I want to be able to plug in the pump. the arduino gets power from the 12v cigarette lighter, and turns on. The lcd flashes a quick "hello", clears the screen, and brings you to this screen:
|Tire PSI: xx|
|Set PSI: xx|
The 'xx' next to Tire PSI would be the actual psi from the tire, as read from the pressure sensor. **I assume that I would use the "map" command in the sketch to translate a voltage reading to a pressure, which i would then set as a variable and print it to the LCD. Correct?
The 'xx' next to Set PSI would default to 32, which is the pressure my crappy tire is supposed to be at. However, I would like to be able to hit the up\down buttons on the shield to change this set PSI. I have no idea how i'm going to do this yet. I'm going to try to go through the example in LCD4Bit_mod library to figure out how a keypress can change a variable that is stored, and then print this variable and use it as the target pressure. I may need help on this, but don't tell me right away... gimmie a chance to at least try... :slight_smile:

After SetPSI is set by me, I would then hit the "select" button on the keypad, and the arduino would realize that TirePSI<SetPSI and would set the output pin to mosfet to HIGH, and the pump would begin filling the tire.

When the Pump gets up to SetPSI, it would shut off the pump, clear the screen, and print "YAY!" or something like that. A quick hit of the reset button would reset the prog to allow me to fill another tire.

Things to add in the future:
-a solenoid valve to release pressure, if the tire is over inflated. this would be useful at a drag strip, when i want to lower PSI
-possibly a radio to get rid of the pressure sensor, and use the cars TPMS sensor built into the wheel
-a quick "how-to" that would flash on the LCD in the beginning so someone else would know how to use it


Where i'm at right now....
I have the LCD4Bit_mod library, but after looking at the examples I got confused. I didn't understand what was going on. Then I looked at the examples in the LiquidCrystal Library, and that stuff made sense, mainly because there were lots of examples that were well //commented, and I could look up the syntax of the commands on arduino.cc website.

I looked at the circuit diagram for my LCD\Keypad Shield, and realized that all i had to do was change the following line, and then all the LiquidCrystal.h examples would work with my shield:
from:
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
to:
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

So, why would I use the LCD4Bit_mod library, if I could use this library? Since the keypad buttons use an AnalogInput pin and a voltage divider, can't I just copy and paste the bit of code from the LCD4Bit_mod example for recognizing key input, and continue using the LiquidCrystal library?

After A bit of fiddling, I managed to figure this out:

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // turn on the cursor:
  lcd.cursor();
}

void loop() {
  delay(500);
  lcd.setCursor(0,0);
  lcd.print("Tire PSI:");
  lcd.setCursor(0,1);
  lcd.print("Set PSI:");
  delay(500);
}

Now, I need to figure out how to display the actual tire pressure, and put it on the right side of the LCD screen. This is what i'm thinking, tell me if i'm wrong:
read voltage from sensor. map it to pressure, and put that number into a variable. print that variable to the screen

I also need to figure out how to default display '32' as the Set PSI, and use keypad to change that number. This is what i'm thinking, tell me if i'm an idiot:
#define Pump SomeUnusedPin //pin the mosfet is on
int SetPSI = 32 //default psi setting
if (up button is pressed), then SetPSI ++
lcd.print SetPSI
If (down button is pressed), then SetPSI --
lcd.print SetPSI

then...

If (select button is pressed), then Pump = HIGH
If (psi = SetPSI), then Pump = LOW

Am I on track here, or am I totally out of the "void loop()"?!?
LOL, i'm totally loving my new geek humor...

Another thought: I'm still trying to figure out how to justify my pressure values to the right side of the LCD. I suppose I can:
lcd.setCursor(14,0)
lcd.print (TirePSI)
lcd.setCursor(14,1)
lcd.print (SetPSI)
but if for some reason there was a triple digit PSI number, the third digit would be off the screen. some way to automatically justify it would be nice...

YET another thought:
If i remember correctly, Maybe a mosfet would not be good to use. I think these things have a duty cycle and will not like being constantly on for a long period of time, and I should use a relay instead. I'm not sure, i'll read up on this.

ANY AND ALL HELP WOULD BE GREAT. I prefer to try and figure this out on my own, but please let me know if i'm way off or help me answer any questions i may come up with. I plan on updating this thread every step of the way.

THANK YOU!!!

it literally took me 4 hours tonight to figure out that little bit of code and write this post... so take it easy on me, i'm a n00b.

THANK YOU AGAIN!!!!!!!

Your code won't work because it doesn't have the proper syntax and doesn't have semicolons. I assume you meant to post it as 'pseudo-code'.

I wouldn't use a keypad for something like this. It's easier to use $.50 momentary pushbuttons. All you need is a pressure up and pressure down button, at max. An easy way to do it is to attach each button to an interrupt, and have the interrupt run something simple like this:

void PressureUp(){pressure++;} //ISR for "up" button

int SetPSI = 32 //default psi setting

Why hard code something like this? Use EEPROM to store the SetPSI. Just do SetPSI=EEPROM.read(xxx) instead, and add an EEPROM.write(SetPSI) to your main loop. Only hard-code a backup or 'default' value for if the EEPROM gets erased.

You need to add some LCD code or it will just print numbers off the screen:

#define Pump SomeUnusedPin //pin the mosfet is on
int SetPSI = 32 //default psi setting;
if (up button is pressed), then SetPSI ++
lcd.print SetPSI;
lcd.setCursor(XXX)
If (down button is pressed), then SetPSI --
lcd.print SetPSI
lcd.setCursor(XXX)

I assume that I would use the "map" command in the sketch to translate a voltage reading to a pressure, which i would then set as a variable and print it to the LCD. Correct?

I've never used a 'map' command. I would just do

float PRESSURE_VAR = analogRead(PRESSURE_PIN);
PRESSURE_VAR = PRESSURE_VAR*X  //(some calibration function, depends on sensor)

But maybe I should learn something about this "map" command. Is it a C thing or an arduino library?

BetterSense:
Your code won't work because it doesn't have the proper syntax and doesn't have semicolons. I assume you meant to post it as 'pseudo-code'.

yeah, i know. i just typed that out real quick to get the general idea across of what commands i'd be using. I like that the arduino tells you where you messed up... LOL. Last night i forgot a lot of semicolons...

I wouldn't use a keypad for something like this. It's easier to use $.50 momentary pushbuttons. All you need is a pressure up and pressure down button, at max. An easy way to do it is to attach each button to an interrupt, and have the interrupt run something simple like this:

void PressureUp(){pressure++;} //ISR for "up" button

The LCD shield that I got ALREADY INCLUDED the keypad. I figure thats even easier, since i don't have to add any buttons :slight_smile:

int SetPSI = 32 //default psi setting

Why hard code something like this? Use EEPROM to store the SetPSI. Just do SetPSI=EEPROM.read(xxx) instead, and add an EEPROM.write(SetPSI) to your main loop. Only hard-code a backup or 'default' value for if the EEPROM gets erased.

i have to read more about how to use this. I figured this would be better than hard coding, because then I imagine the arduino would remember what SetPSI is when i shut the arduino off. when does the arduino get erased? if it got erased and i have nothing hardcoded, it would just come up with an error, right?

You need to add some LCD code or it will just print numbers off the screen:

#define Pump SomeUnusedPin //pin the mosfet is on
int SetPSI = 32 //default psi setting;
if (up button is pressed), then SetPSI ++
lcd.print SetPSI;
lcd.setCursor(XXX)
If (down button is pressed), then SetPSI --
lcd.print SetPSI
lcd.setCursor(XXX)

I'm confused.. what is lcd.setCursor(XXX)? I thought for setCursor, you had to give it a column and row to put the cursor at. are you suggesting that since i have the room, to just move it over to the left another column?

I assume that I would use the "map" command in the sketch to translate a voltage reading to a pressure, which i would then set as a variable and print it to the LCD. Correct?

I've never used a 'map' command. I would just do

float PRESSURE_VAR = analogRead(PRESSURE_PIN);

PRESSURE_VAR = PRESSURE_VAR*X  //(some calibration function, depends on sensor)




But maybe I should learn something about this "map" command. Is it a C thing or an arduino library?

[/quote]
map command for arduino
according to the datasheet for the pressure sensor, this is the transfer function:
Vout = Vs(0.0018P+0.04)
Vs = 5.0VDC
So, with a pressure of 0 kPa, voltage coming out of sensor would be .2V.
At a pressure of 500kPa, voltage coming out of sensor would be 4.7V
So, first i would have to map voltage to kPa. then I would have to map kPa to PSI.
#define pressureIn x //tell arduino pressure sensor is on some open analog in pin
kpa = map(pressureIn, .2, 4.7, 0, 500)
TirePSI = map(kpa, 0, 500, 0, 72.518)

come to think of it, the map function does not do fractions, so this will not work. You are probably right, I should use what you said, because I could go from voltage to psi in one easy step. hmm...

Thank You for the insight!

i have to read more about how to use this. I figured this would be better than hard coding, because then I imagine the arduino would remember what SetPSI is when i shut the arduino off. when does the arduino get erased? if it got erased and i have nothing hardcoded, it would just come up with an error, right?

Well, EEPROM should never get erased by itself, but strange things happen. If it does get erased, your variable would just get set to 0psi unless you have a backup coded, which might not be that big of a deal, especially since it should never happen.

I'm confused.. what is lcd.setCursor(XXX)?

XXX is whatever row and column you are trying to print to. If you just do lcd.print("foo") and then the next loop iteration you do lcd.print("bar") then what you will get is "foobar" written to the LCD. I assume you want to overwrite the old value, so you will have to have an lcd.setCursor() line somewhere in your loop to put your cursor back to the beginning of the space you are writing to. Otherwise it will keep printing the values one after the other all the way off the screen into oblivion.

This is a cool project, where are you getting your pressure sensor? Is it in a package that can be screwed into a pipe fitting or something?

BetterSense:

i have to read more about how to use this. I figured this would be better than hard coding, because then I imagine the arduino would remember what SetPSI is when i shut the arduino off. when does the arduino get erased? if it got erased and i have nothing hardcoded, it would just come up with an error, right?

Well, EEPROM should never get erased by itself, but strange things happen. If it does get erased, your variable would just get set to 0psi unless you have a backup coded, which might not be that big of a deal, especially since it should never happen.

Gotcha. I'll read up on this tonight... even if it goes to 0psi, thats not a big deal... just have to hit the button a bunch of times. for the backup, i imagine i could do something like:
read eeprom. if that value = 0, then setPSI = xx.
that way if eeprom is erased and goes back to 0, it will automatically get set back to my backup... i think this will work... LOL

I'm confused.. what is lcd.setCursor(XXX)?

XXX is whatever row and column you are trying to print to. If you just do lcd.print("foo") and then the next loop iteration you do lcd.print("bar") then what you will get is "foobar" written to the LCD. I assume you want to overwrite the old value, so you will have to have an lcd.setCursor() line somewhere in your loop to put your cursor back to the beginning of the space you are writing to. Otherwise it will keep printing the values one after the other all the way off the screen into oblivion.

Great point! I understand now. Thank You for pointing this out!!!!!

This is a cool project, where are you getting your pressure sensor? Is it in a package that can be screwed into a pipe fitting or something?

Thank You! I really needed to figure out something useful to do with the arduino, otherwise I would lose interest...

I actually 'acquired' the pressure sensor from my college, along with a bunch of other electrical thingers. I lol'd when i read the part of the 'Getting Started with Arduino' book where they had a box full of junk, because I have quite literally the same thing, actually several boxes. I graduated school a couple years ago and i'm still paying for it... I'm sure they won't miss this sensor, or their breadboards, or their crappy power supply, or their resistors and capacitors, or their 555 timers, etc etc etc.... :slight_smile: It was a pretty lousy education too, I learned more 'in the real world'.

The sensor I have is a differential sensor. I figured I would leave the vacuum side at ambient pressure, and the other side would be spliced into the air line going to the tire. it has a barbed nipple on it to connect to the tube, no threads.

question:

what is the difference between these two:

#define LED 13 // LED connected to
// digital pin 13

and

int LED = 13 // LED connected to pin 13

ive seen it done both ways, and I don't know why. nor do i know which one to use for my application...

Thank You!

killacam:
question:

what is the difference between these two:

#define LED 13 // LED connected to

// digital pin 13



and 


int LED = 13 // LED connected to pin 13




ive seen it done both ways, and I don't know why. nor do i know which one to use for my application... 

Thank You!

The first way, when the program is being compiled whenever the compiler encounters LED it replaces it with the number 13. The second way the compiler sets aside two bytes of memory for an int and put the value 13 into those two bytes.

The first way uses no memory, but is not "type-safe" -- the value LED has no type, so the compiler can't check that it's used properly. The second way is type-safe, but since it's a variable it could accidentally get changed during your program.

Best is:

const int LED=13;

The "const" keyword tells the compiler this is a constant, so if you try to change it the compiler throws an error. It's typed so the compiler will do type-checking for you.

Wow! Thank you for the clarification!

After doing some reading, I kinda figured out the main differences between the two, but i didn't know the thing about the "const int LED=13" way... i've yet to come across that, but I will def use it myself for now on... so, i imagine the #define was put in there for uber n00bs? whatever, I'm glad you straightened this out for me. Thank You!!!!

I'm slowly working on this project... I'm really just playing around trying to print info to the lcd right now, but tonight i'll hopefully be able to print the data from the analoginput onto the LCD... :slight_smile:

killacam:
so, i imagine the #define was put in there for uber n00bs? whatever, I'm glad you straightened this out for me.

#define is a historical vestige, it was part of the original c language. The keyword const was introduced in c++ to address some of the problems with #define, but #define was kept for backwards compatibility.

interesting... i read the blurb on arduinos website about const and it definitely said at the end that const int was better than #define. Now I know why!

Tonight this is what I plan to accomplish:

  • Get circuit working for pressure sensor (as per manufacturer recommendations)
  • first figure out how to print info from the analoginput to the serial monitor
  • then use float or map to convert 0-1023 into psi (this will take a while)

I'm pretty sure that I cannot use the map command, because there will be decimal points involved. i dunno. i may just play with it, watching data from the serial monitor to see what happens....

Here I go!

Alright, I made some code and it's spitting out something useful over the serial monitor...

const int sensor = 5; //pin the sensor is on
int pressure = 0; //variable to hold pressure value
//int volts = 0; //variable to hold volts i don't think i needed this

void setup()
{
  Serial.begin(9600);
  Serial.println("THIS IS TO TEST ANALOG INPUT");
}

void loop()
{
  pressure = analogRead(sensor); //read analog pin
  float volts; // i think this creates a floating point interger named volts
  volts = (((float)pressure / 1024) * 5); //some math to convert analogRead to volts
  Serial.print("Voltage: "); // Print the
  Serial.println(volts);     // Voltage value
  int psi;
  psi = map(pressure, 0, 1023, 0, 73); //really crappy conversion to psi
  Serial.print("PSI: "); // Print the 
  Serial.println(psi);   // PSI value
  delay(500); //delay so it doesn't spit out numbers crazy fast
}

So, my first observation is that using the map command sucks. it is nowhere near a perfect conversion...

I basically ripped this line from someone elses sketch:
volts = (((float)pressure / 1024) * 5);
I don't know why there is a 'float' in there... is it because whatever number 'pressure' is will be a fraction when it's divided by 1024? Will I have to put a 'float' in there every time a simple equation needs to be solved, if it involves fractions? Why does the float have to be in round brackets?

When I run this script, Volts only goes to the hundredth place, ex\ "Voltage: X.XX". Why? Shouldn't it go a couple more digits over, like X.XXXX?

I am attempting to convert volts into kPa and then to PSI. I will do all this math, but it seems silly. I feel like I should be able to go straight from 0-1023 directly to 0-72.5188689 PSI.

I'm not going to comment on any specific question, but did want to share some thoughts on your expectations of how accurate, and hence how many decimal digits will be useful for your project.

From the datasheet of your sensor:

Accuracy(6) (0 to 85°C) — — — ±2.5 %VFSS

From the Atmel ATmega328 datasheet:
• 10-bit Resolution
• 0.5 LSB Integral Non-linearity
• ± 2 LSB Absolute Accuracy

Neither of these are instrument quality accuracy specifications. Also the 5 volt top of range = 1023 counts, for an arduino is only valid if the voltage wired to the Arduino is exactly +5.000 volts, any variation and there will be (USB +5vdc can be +/- 5%) also effects your calculations.

As far as printing out float variable and how many decimals can be displayed, it's up to 4 max:

Serial.println(1.23456, 0) gives "1"
Serial.println(1.23456, 2) gives "1.23"
Serial.println(1.23456, 4) gives "1.2346"

Lefty

Thank You Lefty!

I kinda noticed something was going on, because the serial monitor was reporting voltage being at .18V, when the sensor said the lowest was .2v... So I have an accuracy problem. Its not too big of a deal if I cannot get .XX psi resolution, because its only a car tire... But i would like to get within plus\minus .3 psi...
Questions:

  1. Is there a way I can write a calibration routine? I suppose there is... maybe a better question is "How can I minimize the effects of error stackup" since I don't want to calibrate this sensor
  2. if this is powered off the power plug and not USB, would the voltage error due to USB go away, since it is now getting regulated?
  3. can I power this off the 14v from my car cigarette lighter, or would I have to step it down before the power gets to the arduino?

FWIW, i was able to get the arduino to print PSI from voltage:

void loop()
{
  pressure = analogRead(sensor); //read analog pin
  float volts; // i think this creates a floating point interger named volts
  volts = (((float)pressure / 1024) * 5); //some math to convert analogRead to volts
  Serial.print("Voltage: "); // Print the
  Serial.println(volts, 3);     // Voltage value
  float psi; // make a floating point interger named psi
  psi =  ((((float)volts / 5) -.04) / .0018) * .145; //convert volts to kPa to psi
  Serial.print("PSI: "); // Print the 
  Serial.println(psi, 4);   // PSI value
  delay(1000); //delay so it doesn't spit out numbers crazy fast
  
}

I don't know why this works, other than it did. I don't completely understand the thing with "(float)", but I put it into this line:
psi = ((((float)volts / 5) -.04) / .0018) * .145; //convert volts to kPa to psi
and it worked. I dunno... :roll_eyes:

As far as printing out float variable and how many decimals can be displayed, it's up to 4 max:

Serial.println(1.23456, 0) gives "1"
Serial.println(1.23456, 2) gives "1.23"
Serial.println(1.23456, 4) gives "1.2346"

Weird. So why when I went "Serial.println(psi)" did it go out 2 decimal places? shouldn't it have gone out 0 decimal places? I experimented, and "Serial.println(psi, 4) did indeed bring it out 4 decimal places.

Thank You for all the help guys! I am really excited that I am figuring some of this stuff out... I can't wait to do my next project, the Arduino Lojack \ Car Defense system... bwa ha ha!

killacam:
Thank You Lefty!

I kinda noticed something was going on, because the serial monitor was reporting voltage being at .18V, when the sensor said the lowest was .2v... So I have an accuracy problem. Its not too big of a deal if I cannot get .XX psi resolution, because its only a car tire... But i would like to get within plus\minus .3 psi...
Questions:

  1. Is there a way I can write a calibration routine? I suppose there is... maybe a better question is "How can I minimize the effects of error stackup" since I don't want to calibrate this sensor

If you measure the actual +5vdc going to your chip with a good meter, while being powered by the on board +5vdc regulator you would know the actual value to use in your calculations instead of just 5 it might be 5.11. As long as your doing floating point calcs this actual reference voltage can be utilized.

  1. if this is powered off the power plug and not USB, would the voltage error due to USB go away, since it is now getting regulated?

Sort of, but the on-board +5vdc regulator has it's own unknown accuracy variation, so actually measuring it's value to use in your calc will help eliminate some error. Note that this voltage can change with temp, but that's properly smaller then the initial accuracy error, so can be ignored I think.

  1. can I power this off the 14v from my car cigarette lighter, or would I have to step it down before the power gets to the arduino?

The external power connector on your arduino will except 14v. I ran mine at +15 and it worked fine. The best value to use is +8vdc as that means less waste heat dissipated in regulating it down to +5vdc by the on board 5 volt regulator. Some people like to add extra filtering and power protection components when using car power as it can be a noisy and spiky environment, but I have had no problem with just plugging into a cigar lighter socket, with nothing special added. But then again I'm a kind of crazy guy, Steve Martin fan.

FWIW, i was able to get the arduino to print PSI from voltage:

void loop()

{
  pressure = analogRead(sensor); //read analog pin
  float volts; // i think this creates a floating point interger named volts
  volts = (((float)pressure / 1024) * 5); //some math to convert analogRead to volts
  Serial.print("Voltage: "); // Print the
  Serial.println(volts, 3);     // Voltage value
  float psi; // make a floating point interger named psi
  psi =  ((((float)volts / 5) -.04) / .0018) * .145; //convert volts to kPa to psi
  Serial.print("PSI: "); // Print the
  Serial.println(psi, 4);   // PSI value
  delay(1000); //delay so it doesn't spit out numbers crazy fast
 
}




I don't know why this works, other than it did. I don't completely understand the thing with "(float)", but I put it into this line:
psi = ((((float)volts / 5) -.04) / .0018) * .145; //convert volts to kPa to psi
and it worked. I dunno... :roll_eyes:

Floats are a separate data type in the C language along with int type and char type, etc. And you have to do all kinds of 'casting' tricks ( that (float) is a casting thingee ) when you try and use mixed types in a formula. Problem is if you do it wrong you may get no kind of error message, just an answer that is not what you expected! It's one of the trickier things to learn in the C/C++ language. However if you get in trouble just ask for help, there are lots of software gurus around here that can cast proper casts in their sleep.





> As far as printing out float variable and how many decimals can be displayed, it's up to 4 max:
> 
> Serial.println(1.23456, 0) gives "1" 
> Serial.println(1.23456, 2) gives "1.23" 
> Serial.println(1.23456, 4) gives "1.2346"



Weird. So why when I went "Serial.println(psi)" did it go out 2 decimal places? shouldn't it have gone out 0 decimal places? I experimented, and "Serial.println(psi, 4) did indeed bring it out 4 decimal places.

Well it doesn't state in the arduino reference, but if you don't specify a second parameter at all in the Serial.println statement when using float variables, it defaults to 2 decimal places. 

Thank You for all the help guys! I am really excited that I am figuring some of this stuff out... I can't wait to do my next project, the Arduino Lojack \ Car Defense system... bwa ha ha!

Thank You again Lefty!

I measured the power going to the sensor at 4.85V. Should I plug this value into the part of the code that figures out voltage from 0-1023, or the part of the code that gets PSI from voltage? I tried both ways, and neither got me to 0psi, but close... -.2psi. That is no problem for this application. i just wanna check it at 30psi or so later on with a known good pressure sensor to make sure its right.

Regarding the power, I think I might look up some filtering circuits. The Arduino is going to be powered by the same wire that is controlling the pump motor, and i'm worried some spikes or something will get in there. I may be wasting my time, but it's probably good to know for the future anyways.

Next i'm going to try and figure out how to get the up\down keys to change the "SetPSI", and get the select key to start pumping. It was mentioned to me earlier that I should put the "SetPSI" variable in EEPROM, so I guess I will have to figure out how to have the key press change that variable in EEPROM, and then have the select button turn on the pump until that PSI is reached. This brings up a question tho:
What is the best way to program this? Should I contain all of this in the void loop(), or have subprograms that run? I need to do a lot more reading i guess.

I'm in the hospital with my girlfriend ATM, she is having a baby. She is passed out on ambien and pain killers, so i'm seizing the opportunity to catch up on some arduino code :slight_smile: