Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano-Based Automated Petrol Pump with RFID and Keypad Security

View and Edit Project In Cirkit DesignerImage of Arduino Nano-Based Automated Petrol Pump with RFID and Keypad Security

Circuit Documentation

Summary

This circuit is designed to automate a petrol pump system using an Arduino Nano microcontroller. The system includes an RFID reader for user authentication, a keypad for password and cost input, an LCD screen for user interface, a relay to control a water pump (simulating the petrol pump), and a buzzer for alerts. The system ensures secure transactions by verifying the user's RFID card and password before dispensing fuel.

Component List

  1. Arduino Nano

    • Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
    • Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
  2. LCD screen 16x2 I2C

    • Description: A 16x2 character LCD display with I2C interface.
    • Pins: SCL, SDA, VCC, GND
  3. 5V Mini Water Pump

    • Description: A small water pump operating at 5V.
    • Pins: Positive pin, Negative pin
  4. RFID-RC522

    • Description: An RFID reader module operating at 3.3V.
    • Pins: VCC (3.3V), RST, GND, IRQ, MISO, MOSI, SCK, SDA
  5. Piezo Buzzer

    • Description: A small piezoelectric buzzer for sound alerts.
    • Pins: Pin 1, Pin 2
  6. 1 Channel Relay 5V

    • Description: A relay module to control high voltage devices with a 5V signal.
    • Pins: VCC, GND, IN, NC, COM, NO
  7. 4X4 Membrane Matrix Keypad

    • Description: A 4x4 matrix keypad for user input.
    • Pins: R1, R2, R3, R4, C1, C2, C3, C4
  8. 9V Battery

    • Description: A standard 9V battery for power supply.
    • Pins: Positive (+), Negative (-)

Wiring Details

Arduino Nano

LCD screen 16x2 I2C

5V Mini Water Pump

RFID-RC522

Piezo Buzzer

1 Channel Relay 5V

4X4 Membrane Matrix Keypad

9V Battery

Code Documentation

#include <SPI.h>
#include <MFRC522.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>

// Pin configuration for Arduino Nano
#define RST_PIN 9    // Reset pin for MFRC522
#define SS_PIN 10    // Slave select pin for MFRC522
#define RELAY_PIN 8  // Relay to control pump
#define BUZZER_PIN 7 // Buzzer for alerts

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
LiquidCrystal_I2C lcd(0x27, 16, 2); // Create I2C LCD instance (I2C address: 0x27)

// Keypad configuration
const byte ROWS = 4; // Rows of the keypad
const byte COLS = 4; // Columns of the keypad
char keys[ROWS][COLS] = {
    {'1', '2', '3', 'A'},
    {'4', '5', '6', 'B'},
    {'7', '8', '9', 'C'},
    {'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {6, 5, 4, 3}; // Connect to row pins of the keypad
byte colPins[COLS] = {2, A1, A2, A3}; // Connect to column pins of the keypad
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);

// User data (Simulated RFID card data, password, and balance)
String validRFID = "d3:1e:34:27"; 
String validPassword = "