CO2 Sensor and Data Logger

School project

Worked with a classmate to build a device that logs CO2 levels in industrial settings and warns when they reach unsafe levels.

  • STM32 microcontroller with a CO2 sensor, buzzer, LED and SD card reader
  • Stores the CO2 level to the SD card once per second
  • Buzzer sounds and the LED blinks above 30000ppm of CO2
STM32 Nucleo, CO2 sensor, buzzer and SD card reader on a breadboard
STM32 Nucleo, CO2 sensor, buzzer and SD card reader on a breadboard

Bit-Banged I2C

Sensor communication is done through a custom I2C driver written from scratch: the clock and data lines are driven directly as GPIOs, with the start and stop conditions, ACKs and timing all handled in firmware.

Annotated scope trace of a read from the sensor
Annotated scope trace of a read from the sensor