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

Arduino UNO-Based Smart Item Booking System with Bluetooth and LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Smart Item Booking System with Bluetooth and LCD Display

Circuit Documentation

Summary

This circuit is designed to monitor the availability of an item using a Force Sensitive Resistor (FSR) and provide visual feedback through LEDs and an LCD display. It also includes a tactile switch button for booking the item and a Bluetooth module for sending notifications. The circuit is controlled by an Arduino UNO microcontroller.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. Tactile Switch Buttons - 12mm Square

    • Description: Momentary push button switch.
    • Pins: 3, 1, 4, 2
  3. 16X2 LCD

    • Description: 16x2 character LCD display.
    • Pins: VSS, VDD, V0, RS, RW, E, D1, D0, D2, D3, D4, D6, D5, D7, A, K
  4. Square FSR

    • Description: Force Sensitive Resistor.
    • Pins: A0, A1
  5. Resistor (10k Ohms)

    • Description: Resistor with a resistance of 10k Ohms.
    • Pins: pin1, pin2
  6. Resistor (220 Ohms)

    • Description: Resistor with a resistance of 220 Ohms.
    • Pins: pin1, pin2
  7. LED: Two Pin (red)

    • Description: Red LED.
    • Pins: cathode, anode
  8. LED: Two Pin (green)

    • Description: Green LED.
    • Pins: cathode, anode
  9. Bluetooth module HM-10

    • Description: Bluetooth module for wireless communication.
    • Pins: BRK, RX, TX, GND, VCC, State

Wiring Details

Arduino UNO

Tactile Switch Buttons - 12mm Square

Resistor (10k Ohms)

Resistor (220 Ohms)

Resistor (220 Ohms)

Code Documentation

#include <LiquidCrystal.h>
#include <SoftwareSerial.h>

// Define pins for FSR, green LED, red LED, LCD, button, and Bluetooth module
const int fsrPin = A0;
const int greenLedPin = 13;
const int redLedPin = 12;
const int buttonPin = 6;
const int btRxPin = 9;
const int btTxPin = 8;

// Initialize the LCD and Bluetooth serial communication
LiquidCrystal lcd(11, 10, 5, 4, 3, 2, 1);
SoftwareSerial btSerial(btRxPin, btTxPin);

// Variables for booking status and notification timing
bool itemIsBooked = false;
unsigned long bookingTime = 0;
const unsigned long notificationDelay = 300000; // 5 minutes in milliseconds

void setup() {
  // Set FSR pin as input
  pinMode(fsrPin, INPUT);

  // Set LED pins as output
  pinMode(greenLedPin, OUTPUT);
  pinMode(redLedPin, OUTPUT);

  // Set button pin as input with pull-up resistor
  pinMode(buttonPin, INPUT_PULLUP);

  // Initialize the LCD
  lcd.begin(16, 2);

  // Initialize Bluetooth serial communication
  btSerial.begin(9600);
}

void loop() {
  // Read the analog value from the FSR
  int fsrReading = analogRead(fsrPin);

  // Set a threshold for pressure detection
  int pressureThreshold = 500; // Adjust this value as needed

  // Check if pressure is above the threshold
  if (fsrReading > pressureThreshold) {
    // Turn on green LED and display "Item available"
    digitalWrite(greenLedPin, HIGH);
    digitalWrite(redLedPin, LOW);
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Item available");

    // Check if button is pressed
    if (digitalRead(buttonPin) == LOW && !itemIsBooked) {
      // Button pressed, simulate booking process
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Booking...");
      delay(2000); // Simulate booking process delay
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Item booked!");

      itemIsBooked = true;
      bookingTime = millis();
    }
  } else {
    // Turn on red LED and display "Item not available"
    digitalWrite(greenLedPin, LOW);
    digitalWrite(redLedPin, HIGH);
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Item not available");

    // Reset booking status if pressure is removed
    itemIsBooked = false;
  }

  // Check if it's time to send a notification
  if (itemIsBooked && millis() - bookingTime >= notificationDelay) {
    btSerial.println("Please return the item");
    itemIsBooked = false; // Reset the booking status
  }

  delay(100); // Adjust delay as needed
}

This code initializes the necessary components and continuously monitors the FSR to determine the availability of the item. It provides visual feedback through LEDs and an LCD display and allows booking the item using a button. If the item is booked, a notification is sent via Bluetooth after a specified delay.