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

Solar-Powered Environmental Data Logger with Adafruit Feather M0 Express

View and Edit Project In Cirkit DesignerImage of Solar-Powered Environmental Data Logger with Adafruit Feather M0 Express

Circuit Documentation

Summary

This circuit is designed to collect environmental data using a set of sensors and log this information for analysis. The core of the circuit is the Adafruit Feather M0 Express microcontroller, which interfaces with a BME280 sensor for atmospheric measurements, an SGP30 sensor for air quality, and a STEMMA Soil Sensor for soil moisture and temperature. The system is powered by a solar panel charging a 3.7v LiPo battery through an Adafruit BQ24074 Solar-DC-USB Lipo Charger. The Adafruit Terminal Breakout FeatherWing is used to facilitate connections to the Feather M0 Express. Communication with the sensors is handled via the I2C protocol.

Component List

Microcontroller

Sensors

Power Management

Interface

Wiring Details

Adafruit Feather M0 Express

Adafruit Terminal Breakout FeatherWing

Adafruit BME280

Adafruit STEMMA Soil Sensor

Solar Panel

3.7v LiPo Battery

Adafruit SGP30

Adafruit BQ24074 Solar-DC-USB Lipo Charger

Documented Code

/*
 * This Arduino Sketch is designed to log data from three sensors: SGP30, 
 * STEMMA Soil Sensor, and BME280. The data is read from the sensors, 
 * converted to appropriate units, and then logged to the Adafruit Feather 
 * M0 Express. The sensors are connected via I2C.
 */

#include <Wire.h>
#include <Adafruit_SGP30.h>
#include <Adafruit_BME280.h>
#include <Adafruit_STEMMA_Soil_Sensor.h>

Adafruit_SGP30 sgp;
Adafruit_BME280 bme;
Adafruit_STEMMA_Soil_Sensor soilSensor;

void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10);

  // Initialize SGP30
  if (!sgp.begin()) {
    Serial.println("SGP30 not found :(");
    while (1);
  }
  Serial.println("SGP30 Found!");

  // Initialize BME280
  if (!bme.begin(0x76)) {
    Serial.println("BME280 not found :(");
    while (1);
  }
  Serial.println("BME280 Found!");

  // Initialize Soil Sensor
  if (!soilSensor.begin()) {
    Serial.println("Soil Sensor not found :(");
    while (1);
  }
  Serial.println("Soil Sensor Found!");
}

void loop() {
  // Read SGP30
  if (!sgp.IAQmeasure()) {
    Serial.println("SGP30 measurement failed");
    return;
  }
  Serial.print("eCO2: "); Serial.print(sgp.eCO2); Serial.print(" ppm, TVOC: ");
  Serial.print(sgp.TVOC); Serial.println(" ppb");

  // Read BME280
  Serial.print("Temperature: "); Serial.print(bme.readTemperature());
  Serial.print(" °C, Humidity: "); Serial.print(bme.readHumidity());
  Serial.print(" %, Pressure: "); Serial.print(bme.readPressure() / 100.0F);
  Serial.println(" hPa");

  // Read Soil Sensor
  Serial.print("Soil Moisture: "); Serial.print(soilSensor.readMoisture());
  Serial.print(" %, Soil Temperature: "); Serial.print(soilSensor.readTemperature());
  Serial.println(" °C");

  delay(2000); // Delay between readings
}

This code initializes the sensors and reads their data in a loop, printing the results to the serial monitor. The delay between readings is set to 2 seconds.