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

Arduino UNO-Based Eye Pressure Monitor with OLED Display and TOF Sensor

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Eye Pressure Monitor with OLED Display and TOF Sensor

Circuit Documentation

Summary

This circuit is designed to measure eye pressure and detect changes in the surface using an array of sensors, including a TCRT 5000 IR sensor and a TOF10120 distance sensor. The data from these sensors is processed by an Arduino UNO microcontroller and displayed on a 0.96" OLED screen. The circuit is powered by a 9V battery, which is controlled by a rocker switch. The purpose of this circuit is to determine eye pressure status and ensure the correct positioning of an air puff for eye pressure measurement.

Component List

Arduino UNO

0.96" OLED

TOF10120

9V Battery

TCRT 5000 IR SENSOR

Rocker Switch

Wiring Details

Arduino UNO

0.96" OLED

TOF10120

9V Battery

TCRT 5000 IR SENSOR

Rocker Switch

Documented Code

Arduino UNO Code

/*
 * This Arduino Sketch reads data from the TCRT 5000 IR sensor and the TOF10120
 * sensor to determine eye pressure. It then displays the eye pressure status
 * (high, normal, or low) on a 0.96" OLED display. The eye pressure is
 * considered high if above 21 mmHg, normal if between 10 and 21 mmHg, and low
 * if below 10 mmHg.
 */

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

#define IR_SENSOR_DO 2
#define IR_SENSOR_AO A3
#define TOF_RX 1
#define TOF_TX 0

void setup() {
  pinMode(IR_SENSOR_DO, INPUT);
  pinMode(IR_SENSOR_AO, INPUT);
  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.display();
  delay(2000);
  display.clearDisplay();
}

void loop() {
  int irValue = analogRead(IR_SENSOR_AO);
  float eyePressure = map(irValue, 0, 1023, 0, 30);
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.print("Eye Pressure: ");
  display.print(eyePressure);
  display.print(" mmHg");
  display.setCursor(0, 10);
  if (eyePressure > 21) {
    display.print("Status: High");
  } else if (eyePressure >= 10) {
    display.print("Status: Normal");
  } else {
    display.print("Status: Low");
  }
  display.display();
  delay(1000);
}

(Note: The code for the other microcontroller instances appears to be mistakenly provided, as there is only one Arduino UNO in the circuit. The code for the TOF10120 and TCRT 5000 IR SENSOR is integrated into the Arduino UNO code.)