Arduino Based Automatic Tire Inflator Using Pressure Sensor, Relay Module and LCD Display

Arduino Automatic Tire Inflator – Pressure Sensor, Relay & LCD Display | MakeMindz
Arduino Automation Project

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.

2 Hours Build
Intermediate Level
Arduino UNO + I2C LCD
EEPROM Settings Saved
Arduino Automatic Tire Inflator project with pressure sensor, relay module, I2C LCD display and push buttons

Components Required

Gather all hardware below before starting. The I2C LCD module simplifies wiring significantly — only 4 wires needed for the display.

🔵
Arduino UNOMain microcontroller
🔬
Air Pressure TransducerAnalog PSI measurement
4-Channel Relay ModuleCompressor + solenoid control
💨
Air Compressor / DC PumpTire inflation actuator
📺
16×2 I2C LCD (0x27)4-wire display (SDA/SCL)
🔔
Buzzer (Active)Completion alert
🔘
Push Buttons × 4SET / UP / DOWN / ENTER
⚙️
SMPS + Buck ConverterStable 5V/12V supply
🔌
Jumper Wires + BreadboardPrototyping connections

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:

set_mode = 0 Pressure Setting

Use UP/DOWN buttons to adjust target PSI (10–70 PSI range). Saved to EEPROM address 0 automatically.

set_mode = 1 Running / Inflating

Press ENTER to activate. Compressor runs, LCD shows live pressure, buzzer alerts on completion.

set_mode = 2 Sensor Calibration

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.

ComponentArduino PinNotes
Pressure Sensor (OUT)A0Analog 0–5V → 0–1023 ADC
Button – SETD2INPUT_PULLUP, active LOW
Button – UPD3INPUT_PULLUP, active LOW
Button – DOWND4INPUT_PULLUP, active LOW
Button – ENTERD5INPUT_PULLUP, active LOW
Relay – Purge SolenoidD6HIGH = solenoid OFF (active LOW relay)
Relay – Feed SolenoidD7HIGH = solenoid OFF (active LOW relay)
Buzzer (+)D8Active HIGH, GND to GND
I2C LCD – SDAA4I2C data line
I2C LCD – SCLA5I2C clock line
I2C LCD – Vcc5VShared with Arduino 5V rail
I2C LCD – GNDGNDCommon ground
Relay Module – VCC5VRelay coils powered from Arduino
CompressorRelay NO/COMExternal 12V supply via relay

Block Diagram

System Architecture — Arduino Automatic Tire Inflator

Arduino UNO ATmega328P A0·D2–D8·A4·A5 Pressure Sensor Air Transducer → Pin A0 Push Buttons × 4 SET · UP · DOWN · ENTER D2 D3 D4 D5 INPUT_PULLUP Active LOW 16×2 I2C LCD (0x27) Pressure · Set PSI · Status SDA→A4 SCL→A5 4-Ch Relay Module Feed + Purge solenoids D6 (purge) D7 (feed) EEPROM saved Buzzer Completion alert → Pin D8 Air Compressor DC pump / solenoid 12V external supply SMPS Power Supply + DC-DC Buck Converter 5V → Arduino · 12V → Pump Vehicle Tire ─ ─ indirect / external connection direct signal connection

Step-by-Step Instructions

1
Gather and test all components

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.

2
Install required libraries

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.

The code uses a 20×4 LCD initialisation (lcd(0x27, 20, 4)) but works with a 16×2 LCD — just trim strings to 16 characters if needed.
3
Wire the push buttons

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.

4
Connect the pressure sensor

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.

If using a 0–150 PSI automotive transducer (0.5V–4.5V output), you'll need to adjust the pressure formula in the code to match your sensor's datasheet.
5
Connect the I2C LCD display

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.

6
Set up the relay module and compressor

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.

⚠️ Keep 12V compressor wiring away from the Arduino 5V circuit. Use insulated terminals and always test with a small DC pump first before connecting a full AC compressor.
7
Connect the buzzer

Wire the buzzer positive (+) lead to D8 and negative to GND. An active buzzer will sound when D8 goes HIGH — no tone library needed.

8
Upload the Arduino sketch

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.

9
Calibrate the pressure sensor
  • 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_factor until the LCD reading matches the reference gauge.
  • Calibration value is saved to EEPROM address 2 automatically.
10
Set target pressure and start inflating
  • 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.

tire_inflator.ino
// 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

START Read Pressure Sensor A0 → pressure_value set_mode == 1? NO YES pressure < setvalue? YES Inflate feed=LOW purge=HIGH NO Purge (bleed air) purge=LOW feed=HIGH Standby Both relays OFF Loop / Done ✓

Try the Simulation

Test the project in your browser — no hardware needed to get started.

Cirkit Designer Simulation

Full schematic — all components wired and code loaded

Open Simulation →

Wokwi Online Simulator

Paste the sketch into a new Arduino UNO project and test instantly

Open Wokwi →

Key Features

🎯
Auto Inflation Control

Compressor runs only until target PSI — no manual monitoring needed.

📊
Real-Time Pressure Display

Live PSI readings updated continuously on the I2C LCD screen.

🛡️
Over-Inflation Protection

Purge solenoid automatically bleeds air if pressure exceeds target + threshold.

💾
EEPROM Memory

Target PSI and calibration factor saved — settings survive power loss.

🔔
Buzzer Alert

Audible confirmation when inflation is complete.

🔧
Sensor Calibration Mode

Built-in calibration with adjustable offset for accurate PSI readings.

🚗
Multi-Vehicle Support

Adjustable 10–70 PSI range covers cars, bikes, and bicycles.

Energy Efficient

Relay shuts off compressor immediately at target — no wasted power.

Made with ❤️ by MakeMindz — Arduino, IoT & Embedded Systems Tutorials

Questions? Comment on the original post.

Comments

try for free