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.
5V
and GND
are used to power the circuit.A1
, A2
, and A3
are connected to the Basic Flex Resistors.A4
(SDA) and A5
(SCL) are connected to the I2C LCD Screen.D2
and D3
are used for RX and TX communication with the Bluetooth module.5V
power rail.5V
power rail.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.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.#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.