Oxygen Sensor for Aquariums

Introduction

This experiment demonstrates how to monitor oxygen levels in an aquarium using an oxygen sensor.

Oxygen Sensor

Components Needed

Circuit Setup

  1. Connect the VCC pin of the oxygen sensor to 5V on the Arduino.
  2. Connect the sensor's output pin to an analog input pin (e.g., A0) on the Arduino.

The sensor will monitor the oxygen levels in the aquarium and send the data to the Arduino.

Oxygen Sensor Circuit Setup

Code for Oxygen Sensor

Upload the following code to your Arduino to measure oxygen levels:


const int oxygenPin = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int oxygenLevel = analogRead(oxygenPin);
  Serial.print("Oxygen Level: ");
  Serial.println(oxygenLevel);
  delay(1000);
}
            

Explanation

The oxygen sensor detects the dissolved oxygen level in the aquarium, which is read by the Arduino and displayed on the Serial Monitor.

Troubleshooting