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

ESP32-Based Flex Sensor Array and Heart Pulse Monitor with LCD Display

View and Edit Project In Cirkit DesignerImage of ESP32-Based Flex Sensor Array and Heart Pulse Monitor with LCD Display

Circuit Documentation

Summary

This circuit is designed to read values from five flex sensors and a heart pulse sensor, then display the first flex sensor value and the heart pulse value on a 16x2 LCD display. The values are also printed to the Serial Monitor. The circuit utilizes an ESP32-WROOM-32UE microcontroller to process the sensor data and control the LCD display. The circuit is powered by a 3.7v LiPo battery.

Component List

2.2 inch Basic Flex Resistor

ESP32-WROOM-32UE

Resistor

LCD Display 16x2

Heart Pulse Sensor

3.7v LiPo

Wiring Details

2.2 inch Basic Flex Resistor

ESP32-WROOM-32UE

Resistor

LCD Display 16x2

Heart Pulse Sensor

3.7v LiPo

Documented Code

/*
 * This Arduino sketch reads values from five flex sensors and a heart pulse
 * sensor, then displays the first flex sensor value and the heart pulse value
 * on a 16x2 LCD display. The values are also printed to the Serial Monitor.
 */

#include <LiquidCrystal.h>

// Flex Sensors
const int flexSensorPins[5] = {34, 35, 26, 32, 25};
int flexSensorValues[5] = {0, 0, 0, 0, 0};

// Heart Pulse Sensor
const int heartPulsePin = 33;
int heartPulseValue = 0;

// LCD Display
const int rs = 14, en = 27, d4 = 16, d5 = 17, d6 = 18, d7 = 19;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  Serial.begin(115200);
  for (int i = 0; i < 5; i++) {
    pinMode(flexSensorPins[i], INPUT);
  }
  pinMode(heartPulsePin, INPUT);

  // Initialize LCD
  lcd.begin(16, 2);
  lcd.print("Initializing...");
  delay(2000);
}

void loop() {
  // Read Flex Sensors
  for (int i = 0; i < 5; i++) {
    flexSensorValues[i] = analogRead(flexSensorPins[i]);
    Serial.print("Flex Sensor ");
    Serial.print(i + 1);
    Serial.print(": ");
    Serial.println(flexSensorValues[i]);
  }

  // Read Heart Pulse Sensor
  heartPulseValue = analogRead(heartPulsePin);
  Serial.print("Heart Pulse: ");
  Serial.println(heartPulseValue);

  // Display values on LCD
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Flex1:");
  lcd.print(flexSensorValues[0]);
  lcd.setCursor(0, 1);
  lcd.print("Pulse:");
  lcd.print(heartPulseValue);

  delay(1000); // Delay for 1 second
}

This code is designed to run on the ESP32-WROOM-32UE microcontroller. It initializes the serial communication, configures the input pins for the flex and heart pulse sensors, and sets up the LCD display. In the main loop, it reads the sensor values, prints them to the Serial Monitor, and displays them on the LCD.