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

Arduino UNO Oxygen Level Monitoring System with SMS Alerts

View and Edit Project In Cirkit DesignerImage of Arduino UNO Oxygen Level Monitoring System with SMS Alerts

Circuit Documentation

Summary

This circuit is designed to monitor oxygen levels using a DFRobot Oxygen Sensor and display the readings on a 16x2 I2C LCD. It also includes an alarm system with a buzzer and an LED that activates when oxygen levels fall below a certain threshold. The system is powered by a 12V power supply, which is stepped down using a Buck converter. An Arduino UNO microcontroller is used to control the entire system, and a SIM800L module is included for sending SMS alerts when oxygen levels are low.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. LED: Two Pin (red)

    • Description: Red LED with two pins.
    • Pins: cathode, anode
  3. Resistor (330 Ohms)

    • Description: Resistor with a resistance of 330 Ohms.
    • Pins: pin1, pin2
  4. Buzzer

    • Description: Buzzer for sound alarm.
    • Pins: PIN, GND
  5. DFRobot Oxygen Sensor

    • Description: Sensor for measuring oxygen levels.
    • Pins: Pin 1, Pin 2, Pin 3, Pin 4
  6. 16x2 I2C LCD

    • Description: 16x2 character LCD with I2C interface.
    • Pins: GND, VCC, SDA, SCL
  7. 2.1mm Barrel Jack with Terminal Block

    • Description: Power connector for 12V power supply.
    • Pins: POS, NEG
  8. Step down Buck converter

    • Description: Converts 12V to 5V.
    • Pins: IN +, IN - GND, OUT +, OUT - GND
  9. 12V power supply

    • Description: Provides 12V power to the circuit.
    • Pins: +, -
  10. SIM800L

    • Description: GSM/GPRS module for sending SMS.
    • Pins: NET, RST, VCC, RXD, TXD, GND

Wiring Details

Arduino UNO

LED: Two Pin (red)

Resistor (330 Ohms)

Resistor (330 Ohms)

Resistor (330 Ohms)

Buzzer

DFRobot Oxygen Sensor

16x2 I2C LCD

2.1mm Barrel Jack with Terminal Block

Step down Buck converter

12V power supply

SIM800L

Documented Code

Arduino UNO Code

#include <SoftwareSerial.h>
#include "DFRobot_OxygenSensor.h"
#include "LiquidCrystal_I2C.h"

//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(4, 3);  //SIM800L Tx & Rx is connected to Arduino #3 & #2

LiquidCrystal_I2C lcd(0x27, 16, 2);
#define Oxygen_IICAddress ADDRESS_3
#define COLLECT_NUMBER 10  // collect number, the collection range is 1-100.
DFRobot_OxygenSensor oxygen;
bool flag=0;
void setup(void) {

  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Welcome");
  pinMode(2, OUTPUT);
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  while (!oxygen.begin(Oxygen_IICAddress)) {
    Serial.println("I2c device number error !");
    delay(1000);
  }
  Serial.println("I2c connect success !");
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);

  //Begin serial communication with Arduino and SIM800L
  mySerial.begin(9600);

  Serial.println("Initializing...");
  delay(1000);

  mySerial.println("AT");  //Once the handshake test is successful, it will back to OK
  updateSerial();
}

void loop(void) {

  updateSerial();
  float oxygenData = oxygen.getOxygenData(COLLECT_NUMBER);
  //Serial.print(" oxygen concentration is ");
  //Serial.print(oxygenData);
  //Serial.println(" %vol");
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Oxygen conc. is ");

  if (oxygenData < 18.99) {
    digitalWrite(2, HIGH);   //sound alarm on
    digitalWrite(13, HIGH);  //light alarm on
    lcd.setCursor(0, 1);
    lcd.print(oxygenData);
    lcd.println(" %vol| LOW ");
    if(flag ==0){
    mySerial.println("AT+CMGF=1");  // Configuring TEXT mode
    updateSerial();
    mySerial.println("AT+CMGS=\"+966557143252\"");  //change ZZ with country code and xxxxxxxxxxx with phone number to sms
    updateSerial();
    mySerial.print("Oxygen Level is low");  //text content
    updateSerial();
    mySerial.write(26