Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino UNO Based Smart Notification System with Bluetooth and Flex Sensors

Image of Arduino UNO Based Smart Notification System with Bluetooth and Flex Sensors

Circuit Documentation

Summary

This circuit is designed around an Arduino UNO microcontroller and includes various components such as resistors, a flex sensor, an I2C LCD screen, and a Bluetooth module. The Arduino UNO reads analog values from flex sensors and controls the output to an LCD screen and communicates via Bluetooth. The circuit is likely used for a monitoring system that provides feedback based on the flex sensor readings, displaying messages on the LCD and sending notifications through the Bluetooth module.

Component List

Arduino UNO

  • Microcontroller board based on the ATmega328P
  • It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.

Basic Flex Resistor (x3)

  • A sensor that changes its resistance when bent
  • Used to measure the amount of deflection or bending.

Resistor (10k Ohms)

  • A passive two-terminal electrical component that implements electrical resistance as a circuit element.

Resistor (200 Ohms) (x2)

  • A passive two-terminal electrical component with a fixed value of 200 Ohms resistance.

I2C LCD 16x2 Screen

  • An alphanumeric liquid crystal display with 16 characters per line and 2 lines.
  • Uses the I2C communication protocol for interfacing with the microcontroller.

Bluetooth module HM-10

  • A Bluetooth 4.0 module that allows for wireless communication.

Wiring Details

Arduino UNO

  • 5V and GND are used to power the circuit.
  • Analog pins A1, A2, and A3 are connected to the Basic Flex Resistors.
  • I2C pins A4 (SDA) and A5 (SCL) are connected to the I2C LCD Screen.
  • Digital pins D2 and D3 are used for RX and TX communication with the Bluetooth module.

Basic Flex Resistor

  • One pin is connected to an analog input on the Arduino UNO.
  • The other pin is connected to the ground.

Resistor (10k Ohms)

  • One pin is connected to the 5V power rail.
  • The other pin is connected to various components requiring a pull-up resistor.

Resistor (200 Ohms) (x2)

  • One pin is connected to the 5V power rail.
  • The other pin is connected to various components requiring current limiting.

I2C LCD 16x2 Screen

  • SCL and SDA are connected to the corresponding I2C pins on the Arduino UNO.
  • VCC (5V) is connected to the 5V power rail.
  • GND is connected to the ground.

Bluetooth module HM-10

  • RX is connected to pin D3 on the Arduino UNO.
  • TX is connected to pin D2 on the Arduino UNO.
  • VCC is connected to the 5V power rail.
  • GND is connected to the ground.

Documented Code

#include "SoftwareSerial.h"
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 2); // RX, TX
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address, 16 columns, 2 rows

// Define LED pins
#define blue 2
#define green 3
#define red 4

// Variables to store sensor readings
unsigned int f;
unsigned int g;
unsigned int h;

void setup() {
  // Set LED pins as outputs
  pinMode(blue, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(red, OUTPUT);

  // Start serial communication
  Serial.begin(9600);
  mySerial.begin(9600);

  // Initialize the LCD
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("  Welcome To");
  lcd.setCursor(0, 1);
  lcd.print("JustDoElectronic");
  lcd.clear();
  delay(3000);
}

void loop() {
  // Read analog values from flex sensors
  f = analogRead(1);
  g = analogRead(2);
  h = analogRead(3);

  // Check sensor values and act accordingly
  if (f <= 722) {
    digitalWrite(blue, HIGH);
    digitalWrite(green, LOW);
    digitalWrite(red, LOW);
    mySerial.println("Plz Give Me Water");
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("  Plz Give Me");
    lcd.setCursor(0, 1);
    lcd.print("     Water   ");
    delay(3000);
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(" If Anything");
    lcd.setCursor(0, 1);
    lcd.print("  You Want ");
  } else if (g <= 670) {
    digitalWrite(green, HIGH);
    digitalWrite(blue, LOW);
    digitalWrite(red, LOW);
    mySerial.println("Plz Give Me Food");
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("  Plz Give Me ");
    lcd.setCursor(0, 1);
    lcd.print("     Food   ");
    delay(3000);
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(" If Anything");
    lcd.setCursor(0, 1);
    lcd.print("  You Want ");
  } else if (h <= 675) {
    digitalWrite(green, HIGH);
    digitalWrite(blue, LOW);
    digitalWrite(red, LOW);
    mySerial.println("Plz Give Me Tea");
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("  Plz Give Me");
    lcd.setCursor(0, 1);
    lcd.print("     Tea   ");
    delay(3000);
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(" If Anything");
    lcd.setCursor(0, 1);
    lcd.print("  You Want ");
  } else {
    delay(200);
  }
}

This code is designed to read sensor data from three flex sensors and display messages on an LCD screen as well as send notifications via Bluetooth depending on the sensor readings. It uses the SoftwareSerial library to communicate with the Bluetooth module and the LiquidCrystal_I2C library to control the LCD.