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

ESP8266 NodeMCU Based Multi-Sensor Monitoring System

View and Edit Project In Cirkit DesignerImage of ESP8266 NodeMCU Based Multi-Sensor Monitoring System

Circuit Documentation

Summary

The circuit in question is designed around the ESP8266 NodeMCU microcontroller, which serves as the central processing unit. The circuit includes a variety of sensors: the VL53L0X and VL6180X for distance measurement, the BMP180 for pressure and temperature measurement, and a photodiode for light detection. Power regulation is managed by an AMS1117 3.3V voltage regulator, and the system is powered by a LiPoly Battery (1300mAh). The ESP8266 NodeMCU communicates with the sensors via I2C protocol and GPIO connections.

Component List

ESP8266 NodeMCU

XP-G2

VL6180X

Photodiode

BMP180

VL53L0X

AMS1117 3.3

LiPoly Battery (1300mAh)

Wiring Details

ESP8266 NodeMCU

XP-G2

VL6180X

Photodiode

BMP180

VL53L0X

AMS1117 3.3

LiPoly Battery (1300mAh)

Documented Code

ESP8266 NodeMCU Code

#include <Wire.h>
#include <Adafruit_VL53L0X.h>
#include <Adafruit_BMP085.h>
#include <Adafruit_VL6180X.h>

Adafruit_VL53L0X lox = Adafruit_VL53L0X();
Adafruit_BMP085 bmp;
Adafruit_VL6180X vl = Adafruit_VL6180X();

void setup() {
  Serial.begin(115200);
  Wire.begin();

  if (!lox.begin()) {
    Serial.println(F("Failed to boot VL53L0X"));
    while (1);
  }
  Serial.println(F("VL53L0X ready"));

  if (!bmp.begin()) {
    Serial.println(F("Failed to boot BMP180"));
    while (1);
  }
  Serial.println(F("BMP180 ready"));

  if (!vl.begin()) {
    Serial.println(F("Failed to boot VL6180X"));
    while (1);
  }
  Serial.println(F("VL6180X ready"));
}

void loop() {
  // VL53L0X Eye Pressure Measurement
  VL53L0X_RangingMeasurementData_t measure;
  lox.rangingTest(&measure, false);

  if (measure.RangeStatus != 4) {  // phase failures have incorrect data
    float eyePressure = measure.RangeMilliMeter * 0.0075; // Convert to mmHg
    Serial.print("Eye Pressure: ");
    Serial.print(eyePressure);
    Serial.println(" mmHg");

    if (eyePressure > 21) {
      Serial.println("Status: High");
    } else if (eyePressure < 10) {
      Serial.println("Status: Low");
    } else {
      Serial.println("Status: Normal");
    }
  } else {
    Serial.println("VL53L0X Out of range");
  }

  // BMP180 Pressure and Temperature Measurement
  float temperature = bmp.readTemperature();
  float pressure = bmp.readPressure() / 100.0F; // Convert to hPa

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" *C");
  Serial.print("Pressure: ");
  Serial.print(pressure);
  Serial.println(" hPa");

  // VL6180X Distance Measurement
  uint8_t range = vl.readRange();
  uint8_t status = vl.readRangeStatus();

  if (status == VL6180X_ERROR_NONE) {
    Serial.print("Distance: ");
    Serial.print(range);
    Serial.println(" mm");
  } else {
    Serial.println("VL6180X Out of range");
  }

  delay(1000); // Wait for 1 second before next measurement
}

VL6180X Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

(Note: The code for the VL6180X microcontroller instance is minimal and does not include any functionality. It may be a placeholder or require further development.)