O2 sensor

Working with an oxygen sensor. This sensor allows us to measure the oxygen concentration in the environment we are measuring. The sensor is calibrated by the manufacturer and does not need to be calibrated like other sensors. This sensor is suitable for simple projects and tasks at school or in the laboratory. We can easily connect the sensor to the microbit using our MB2 expansion board and the included wires.

Description

With the sensor, you can measure, for example, air quality, oxygen concentration during experiments, or measure oxygen concentration when covering a candle in a container. Thanks to the dupont wires, you can easily connect it to the micro:bit via the MB2 expansion board and use it in the MakeCode environment.

Specifications

  • Detected gas: Oxygen (O2)
  • Measuring range: 0~25%Vol
  • Working voltage: 3.3~5.5V DC
  • Working current: <5mA
  • Output signal: I2C, UART (0~3V)
  • Operating temperature: -20~50℃
  • Working humidity: 15~90%RH (no water condensation during measurement)
  • Service life: >2 years

Connection

O2 sensor – micro:bit

  • Blue wire: Connect the sensor signal output to pin P0 on the micro:bit.
  • Green wire: Connect the sensor signal output to pin P1 on the micro:bit.
  • Red wire: Connect the power wire to the white strip. The sensor requires 3,3 V for proper operation.
  • Black wire: Connect the ground (GND) to GND.

LCD display – micro:bit

  • VCC: Connect the 3V3 output of the micro:bit - it provides power to the display.
  • GND: connect to the ground pin of the micro:bit (GND).
  • SCL: connect to the SCL pin of the micro:bit – this is the clock signal for communication over the I2C bus.
  • SDA: connect to the SDA pin of the micro:bit – it is used to transfer data between the micro:bit and the display.

Always make sure the micro:bit is disconnected from power before connecting any devices to avoid damaging the electronics.

Program

Display of the measured quantity on the LCD display

After correct programming, the measured value from the O2 sensor will appear on the display. 

  • In the program we use the I2C interface to communicate with the sensor
  • The correct measured value, after successful reading from the sensor, is stored in the variable Con2. We can work with this variable further
  • The oxygen concentration is displayed on the connected LCD display and at the same time the information is sent via the serial interface to the PC. This data can be displayed using a suitable application.
  • In the program, it is possible to change the display, for example using an LED display segment or another display element that allows us to display the measured quantity.

Tasks

Task 1: Comparison of O₂ concentration in different environments (air)

Measure O₂ in 3–5 places: outside, in the classroom, by the window, in a plastic bag after a few breaths (briefly!), or in a closed container with burning tealight candle (optional, only with adult supervision) Write down the values ​​and rank them from highest to lowest.

Questions to ponder:

  • Where was the concentration highest and why?

  • How will the result of ventilation, the presence of plants, or a candle flame affect it? (A flame consumes oxygen.)

  • How quickly does O₂ change in closed space versus open?

Task 2: Effect of breathing on O₂ concentration in a closed space

Place the O₂ sensor in a sealable container (e.g. a plastic box or a larger glass). Close the container for a short time and exhale into the space several times (carefully, without holding it for a long time). Observe the change in oxygen concentration over time and then open the container.

Task:

  • Record O₂ values ​​before exhalation, after exhalation, and after opening the container.

  • Create a simple graph of concentration over time.

Questions to ponder:

  • How quickly does the O₂ concentration decrease during breathing?

  • How quickly will it return after opening the container?

  • Why is it important to ventilate rooms where there are more people?

Task 3: Long-term monitoring of O₂ concentration in the classroom

Place an O₂ sensor in the classroom and measure the concentration during the lesson (e.g. every minute). Ideally, compare the status before the lesson, during the lesson and after ventilation.

Task:

  • Record the O₂ concentration over time.

  • Compare the values ​​before and after ventilation.

Questions to ponder:

  • Does the O₂ concentration decrease during teaching?

  • What effect does the number of students in a class have?

  • How will ventilation affect the measured values ​​and why?