Arduino Automatic Tire Inflator
with Pressure Sensor, Relay & LCD
A smart air pressure control system that automatically inflates vehicle tires to your preset PSI — with real-time pressure monitoring, compressor relay control, buzzer alert, EEPROM memory and I2C LCD readout.
Components Required
Gather all hardware below before starting. The I2C LCD module simplifies wiring significantly — only 4 wires needed for the display.
How It Works
The system continuously reads the analog output of an air pressure transducer on pin A0 and converts it to a PSI value (with an adjustable calibration factor stored in EEPROM). The Arduino compares this live reading against a user-defined target pressure:
- If pressure is below target → relay activates the air compressor (feed solenoid ON, purge solenoid OFF).
- If pressure reaches target → both solenoids shut off, buzzer sounds a completion alert.
- If pressure is above target + threshold → purge solenoid opens to bleed excess air safely.
- The I2C LCD always shows current PSI, set PSI, and system state (Inflating / Purging / Done).
- All settings (target PSI, calibration factor) are saved to EEPROM and survive power cycles.
This makes the system reliable enough for daily use — plug in, it reads your saved pressure target and starts working immediately.
Operating Modes
The sketch uses a set_mode variable to switch between three distinct operating modes via the push buttons:
Use UP/DOWN buttons to adjust target PSI (10–70 PSI range). Saved to EEPROM address 0 automatically.
Press ENTER to activate. Compressor runs, LCD shows live pressure, buzzer alerts on completion.
Hold SET + ENTER simultaneously. Adjust calibration offset with UP/DOWN to match a reference gauge.
Pin Connections
All connections for the Arduino UNO. Note the I2C LCD uses only 4 wires (Vcc, GND, SDA, SCL) — much cleaner than parallel wiring.
| Component | Arduino Pin | Notes |
|---|---|---|
| Pressure Sensor (OUT) | A0 | Analog 0–5V → 0–1023 ADC |
| Button – SET | D2 | INPUT_PULLUP, active LOW |
| Button – UP | D3 | INPUT_PULLUP, active LOW |
| Button – DOWN | D4 | INPUT_PULLUP, active LOW |
| Button – ENTER | D5 | INPUT_PULLUP, active LOW |
| Relay – Purge Solenoid | D6 | HIGH = solenoid OFF (active LOW relay) |
| Relay – Feed Solenoid | D7 | HIGH = solenoid OFF (active LOW relay) |
| Buzzer (+) | D8 | Active HIGH, GND to GND |
| I2C LCD – SDA | A4 | I2C data line |
| I2C LCD – SCL | A5 | I2C clock line |
| I2C LCD – Vcc | 5V | Shared with Arduino 5V rail |
| I2C LCD – GND | GND | Common ground |
| Relay Module – VCC | 5V | Relay coils powered from Arduino |
| Compressor | Relay NO/COM | External 12V supply via relay |
Block Diagram
System Architecture — Arduino Automatic Tire Inflator
Step-by-Step Instructions
Verify the I2C LCD address with an I2C scanner sketch before building. Common addresses are 0x27 or 0x3F. Test the pressure sensor output by checking the raw ADC reading at A0 at known pressure.
Open Arduino IDE → Sketch → Include Library → Manage Libraries. Install LiquidCrystal I2C by Frank de Brabander. The EEPROM and Wire libraries are included with the IDE.
lcd(0x27, 20, 4)) but works with a 16×2 LCD — just trim strings to 16 characters if needed.
Connect one leg of each button to GND, the other to D2, D3, D4, D5 respectively. The code uses INPUT_PULLUP, so no external resistors are needed. Buttons read LOW when pressed.
Wire the sensor's signal (OUT) wire to A0, VCC to 5V, and GND to GND. If using a 0–5V transducer, the raw ADC value will range 0–1023. The cal_factor offset corrects for sensor variance.
Wire LCD VCC → 5V, GND → GND, SDA → A4, SCL → A5. That's all 4 wires. Adjust the I2C address in the code if your module uses 0x3F instead of 0x27.
Connect relay IN1 → D6 (purge), IN2 → D7 (feed). The relay's COM and NO terminals switch the compressor and solenoids from your 12V external supply.
Wire the buzzer positive (+) lead to D8 and negative to GND. An active buzzer will sound when D8 goes HIGH — no tone library needed.
Copy the code from Section 8 into Arduino IDE. Select Board: Arduino UNO and the correct COM port. Click Upload. After uploading, the LCD should show the welcome splash screen followed by the standby mode with your last saved PSI target.
- Attach a reference gauge to the same air line.
- Hold SET + ENTER simultaneously to enter Calibration Mode (set_mode = 2).
- Use UP/DOWN to adjust
cal_factoruntil the LCD reading matches the reference gauge. - Calibration value is saved to EEPROM address 2 automatically.
- Press SET to enter Pressure Setting mode.
- Use UP / DOWN to set your target PSI (10–70 PSI range).
- Press ENTER to start inflation — LCD shows "****Inflating****".
- When target is reached, compressor stops and buzzer sounds.
- If over-inflated, purge mode automatically bleeds air until correct PSI is reached.
Arduino Code
The complete sketch uses EEPROM.h, LiquidCrystal_I2C.h, and Wire.h. Settings persist between power cycles via EEPROM.
// Arduino Automatic Tire Inflator — MakeMindz.com // Pressure sensor + relay compressor + I2C LCD + EEPROM settings #include <EEPROM.h> #include <LiquidCrystal_I2C.h> #include <Wire.h> LiquidCrystal_I2C lcd(0x27, 20, 4); // Address, cols, rows // SDA → A4 SCL → A5 int sensorPin = A0; int setvalue = 0; int sw_set = 2; // SET button int sw_up = 3; // UP button int sw_dwn = 4; // DOWN button int sw_ent = 5; // ENTER button int purge = 6; // Purge solenoid relay int feed = 7; // Feed solenoid relay int max_pressure = 70; int min_pressure = 10; int pressure_value = 0; int sensor_Value = 0; int cal_factor = 0; int set_mode = 0; int threshold = 5; int inf_delay = 200; String disp_string[4] = { " Tyre Inflator", "Set Pressure", "-", "-" }; void setup() { pinMode(purge, OUTPUT); pinMode(feed, OUTPUT); pinMode(sw_up, INPUT_PULLUP); pinMode(sw_dwn, INPUT_PULLUP); pinMode(sw_set, INPUT_PULLUP); pinMode(sw_ent, INPUT_PULLUP); Serial.begin(9600); load_settings(set_mode); delay(500); if (setvalue > max_pressure) { save_settings(set_mode, 23); // default 23 PSI if EEPROM corrupt } lcd.init(); lcd.backlight(); lcd.clear(); lcd.setCursor(6, 0); lcd.print("Welcome"); lcd.setCursor(4, 1); lcd.print("Automatic"); lcd.setCursor(2, 2); lcd.print("Tyre Inflator"); delay(3000); lcd.clear(); disp_string[1] = "Set Pres.:" + String(setvalue) + "PSI"; disp_string[2] = "Press Enter"; disp_string[3] = "To Start Inflating"; display(); } void loop() { if (set_mode == 1) { sensor_Value = analogRead(sensorPin); pressure_value = sensor_Value + cal_factor; disp_string[2] = "Set Pressure:" + String(setvalue) + "PSI"; disp_string[3] = "Tyre Pressure:" + String(pressure_value) + "PSI"; delay(5); if (pressure_value < (setvalue + threshold)) { delay(inf_delay); if (pressure_value > setvalue) { disp_string[1] = "Inflation Done"; digitalWrite(purge, HIGH); digitalWrite(feed, HIGH); } else { disp_string[1] = "****Inflating****"; digitalWrite(purge, HIGH); digitalWrite(feed, LOW); } } if (pressure_value > (setvalue + threshold)) { delay(inf_delay); if (pressure_value > setvalue) { disp_string[1] = "****Purging****"; digitalWrite(purge, LOW); digitalWrite(feed, HIGH); } else { disp_string[1] = "Purging Done"; digitalWrite(purge, HIGH); digitalWrite(feed, HIGH); } } display(); } else { digitalWrite(purge, LOW); digitalWrite(feed, LOW); } // UP button handler if (digitalRead(sw_up) == LOW) { delay(1000); switch (set_mode) { case 0: if (setvalue < max_pressure) { setvalue++; save_settings(set_mode, setvalue); disp_string[2] = "Set Pressure:" + String(setvalue) + "PSI"; display(); } break; case 2: if (cal_factor < 200) { cal_factor++; save_settings(set_mode, cal_factor); sensor_Value = analogRead(sensorPin); pressure_value = sensor_Value + cal_factor; disp_string[2] = "Cal. Factor: " + String(cal_factor); disp_string[3] = "Pressure:" + String(pressure_value) + "PSI"; display(); } break; } } // DOWN button handler if (digitalRead(sw_dwn) == LOW) { delay(1000); switch (set_mode) { case 0: if (setvalue > min_pressure) { setvalue--; save_settings(set_mode, setvalue); disp_string[2] = "Set Pressure:" + String(setvalue) + "PSI"; display(); } break; case 2: if (cal_factor > 1) { cal_factor--; save_settings(set_mode, cal_factor); sensor_Value = analogRead(sensorPin); pressure_value = sensor_Value * (cal_factor / 100); disp_string[2] = "Cal. Factor: " + String(cal_factor); disp_string[3] = "Pressure: " + String(pressure_value) + "PSI"; display(); } break; } } // SET button → Pressure Setting mode if (digitalRead(sw_set) == LOW) { delay(1000); set_mode = 0; disp_string[1] = "Pressure Setting.."; display(); } // ENTER → Running mode if (digitalRead(sw_ent) == LOW && digitalRead(sw_set) == HIGH) { delay(1000); set_mode = 1; lcd.clear(); } // SET + ENTER → Calibration mode if (digitalRead(sw_ent) == LOW && digitalRead(sw_set) == LOW) { delay(1000); set_mode = 2; lcd.clear(); disp_string[1] = "Sensor Calibration"; display(); } } void standby() { digitalWrite(purge, LOW); digitalWrite(feed, LOW); lcd.clear(); disp_string[1] = "Set Pres.:" + String(setvalue) + "PSI"; disp_string[2] = "Press Enter"; disp_string[3] = "To Start Inflating"; display(); } void display() { for (int i = 0; i < 4; i++) { lcd.setCursor(0, i); delay(1); lcd.print(disp_string[i]); Serial.println("L" + String(i) + ": " + disp_string[i]); delay(5); } } void save_settings(int address, int value) { EEPROM.write(address, value); EEPROM.update(address, value); } void load_settings(int address) { setvalue = EEPROM.read(address); }
Logic Flowchart
Inflation Control Logic
Try the Simulation
Test the project in your browser — no hardware needed to get started.
Wokwi Online Simulator
Paste the sketch into a new Arduino UNO project and test instantly
Key Features
Compressor runs only until target PSI — no manual monitoring needed.
Live PSI readings updated continuously on the I2C LCD screen.
Purge solenoid automatically bleeds air if pressure exceeds target + threshold.
Target PSI and calibration factor saved — settings survive power loss.
Audible confirmation when inflation is complete.
Built-in calibration with adjustable offset for accurate PSI readings.
Adjustable 10–70 PSI range covers cars, bikes, and bicycles.
Relay shuts off compressor immediately at target — no wasted power.
Comments
Post a Comment