Connect the BME280 STEMMA QT board to the Feather RP2040 Adalogger's STEMMA QT port with a STEMMA QT cable.
Do not remove the microSD card while the Feather is connected to power. Doing so may corrupt the log file. If you need to remove the microSD card, remove the power first, then remove the microSD card.
Plug your RP2040 Adalogger Feather into power (via USB).
When the Feather boots up, it automatically detects the BME280 sensor connected to the STEMMA QT port. The status pixel briefly blinks green to indicate the hardware has been successfully configured.
Every 30 seconds, the Feather reads the BME280 sensor's data and writes this data out to a .log file on the MicroSD card. Every 6 minutes, the Feather's LED blinks green to indicate it is still logging data.
Viewing the microSD Card's Data
When you are ready to view the logged data, first unplug the Feather from USB power. Then, remove the microSD card and insert it into your computer using a microSD card reader.
ALWAYS disconnect power from the Feather first, before removing the microSD card!
About the Log File
Each .log file uses the JSON Lines text file format. It's a great format for storing log files!
We opted to use JSONL instead of CSV files because if power is removed from the logger while it's logging, the file may become corrupted. Attempting to rescue a corrupted CSV file is very difficult and often requires guesswork to reconstruct the file. On the other hand, JSONL files are easy to read, each new line in the file is a JSON-encoded line of text. Each log line follows the previous line formatting, making it easy to see an error in a potentially corrupted file and reconstruct the line.
Reading the Log File
Each line of the log file corresponds to a different component within the config.json file.
For example, the config.json file on the board defines a BME280 sensor reading specific data.
...
"components": [
{
"name": "BME280 Sensor",
"componentAPI": "i2c",
"i2cDeviceName": "bme280",
"period": 15,
"i2cDeviceAddress": "0x77",
"i2cDeviceSensorTypes": [
{"type": "ambient-temp"},
{"type": "ambient-temp-fahrenheit"},
{"type": "relative-humidity"},
{"type": "pressure"},
{"type": "altitude"}
]
...
While a few sensor types are listed above, a lot more are supported by WipperSnapper depending on what sensor you are using.
The sensor types we support are:
Environmental Measurements
- ambient-temp
- ambient-temp-fahrenheit
- pressure
- relative-humidity
- altitude
- co2
- eco2
- tvoc
- gas-resistance
- voc-index
- nox-index
Particulate Matter
- pm10-std
- pm25-std
- pm100-std
- pm10-env
- pm25-env
- pm100-env
Temperature
- object-temp
- object-temp-fahrenheit
Electrical
- voltage
- current
Motion & Position
- accelerometer
- gyroscope
- gravity
- orientation
- magnetic-field
- linear-acceleration
- rotation-vector
- proximity
Light & Color
- light
- lux
- color
Data Types
- raw
- unitless-percent
- bytes
- boolean
The corresponding log file for the config.json file above looks like the following:
{"i2c_address":"0x77","timestamp":0,"value":21.84,"si_unit":"C"}
{"i2c_address":"0x77","timestamp":1,"value":71.312,"si_unit":"F"}
{"i2c_address":"0x77","timestamp":2,"value":31.1377,"si_unit":"%"}
{"i2c_address":"0x77","timestamp":3,"value":1001.109,"si_unit":"hPa"}
{"i2c_address":"0x77","timestamp":4,"value":101.5793,"si_unit":"m"}
To visualize the data produced - you can convert the JSONLines file to a CSV or manually parse it in your favorite spreadsheet program (Excel, Google Sheets) or numeric computing program (MATLAB, Jupyter, etc.).
NOTE: This website only works for JSONL files <= 5MB.
Plugging your logger into your computer's USB port reveals a USB drive called WIPPER. Within this drive are 3 files:
- config.json
- secrets.json
- wipper_boot_out.txt
The configuration file includes data about the board and the sensors connected to it.
If you attempt to use a sensor other than the BME280, you could see an error where the sensor's name in this file does not match the sensor you are using. This is because WipperSnapper performs a "best-guess" automatic configuration where it attempts to automatically initialize the sensor. It could get the name of the sensor wrong, or fail to initialize it if it's at a different i2c address.
If this value is incorrect, you may need to modify the file using our Online Configuration Tool (or by hand).
{
"exportedFromDevice": {
"sd_cs_pin": 23,
"referenceVoltage": 0,
"totalGPIOPins": 0,
"totalAnalogPins": 0,
"statusLEDBrightness": 0.3
},
"components": [
{
"name": "bme280",
"componentAPI": "i2c",
"i2cDeviceName": "bme280",
"period": 30,
"autoConfig": "true",
"i2cDeviceAddress": "0x77",
"i2cDeviceSensorTypes": [
{
"type": "ambient-temp"
},
{
"type": "ambient-temp-fahrenheit"
},
{
"type": "relative-humidity"
},
{
"type": "pressure"
},
{
"type": "altitude"
}
]
}
]
}
Modifying the Configuration File
We will very soon have online tools built into the Adafruit IO website, used via the Wippersnapper Devices page.
For now we have an online configuration tool to help create your config files. Importing is also supported.
Remember that you can always use a text editor to edit the json file's parameters, such as the period or the i2cDeviceSensorTypes returned by the sensor. When you're done editing this file, be sure to save it and then press the RESET button on your board.
Viewing USB-Serial Output
In addition to logging data to a microSD card, WipperSnapper also streams data over USB-serial. The data streamed over USB also uses the JSON Lines text file format.
To view the output, use a serial terminal client (such as PuTTY, TerraTerm, or even the Arduino IDE's serial monitor) to connect to the USB device, and set the terminal's baud rate to 115200 baud.
In your serial terminal, you should see the output begin with debugging info and then begin to record data:
Adding a Real-Time Clock (RTC)
The timestamp field in the JSON log increments with each measurement taken; it does not reflect the "actual" time the measurement was taken. To get that, you'll need to connect an RTC module like the DS3231 Precision RTC to your board.
Unlike I2C sensors, i2c real-time clock modules are "special" components and cannot able to be automatically configured on boot.
To add an RTC, it needs to be connected to the STEMMA QT port and then defined within config.json, the log file will automatically include a timestamp (in unix timestamp format) with the precise time each measurement was read and logged to the microSD card.
Don't forget that a Real Time Clock requires a battery backup to operate. A CR1220 size battery goes in the back, make sure the + symbol on the battery is visible when you insert it!
Connect the Adalogger to your computer, the WIPPER drive should appear.
Open the config.json file in a text editor and make the following modification to the exportedFromDevice array to add a rtc key/value pair.
{
"exportedFromDevice": {
"referenceVoltage": 3.3,
"totalGPIOPins": 18,
"totalAnalogPins": 4,
"sd_cs_pin": 23,
"statusLEDBrightness": 0.5,
"rtc": "DS3231"
},
...
Save the configuration file. Then, press the Adalogger's RESET button.
When the Adalogger boots back up, each line in the log file's timestamp will now reflect the actual time (as a UNIX timestamp):
{"i2c_address":"0x77","timestamp":1740661260,"value":22.11,"si_unit":"C"}
{"i2c_address":"0x77","timestamp":1740661260,"value":71.798,"si_unit":"F"}
{"i2c_address":"0x77","timestamp":1740661260,"value":31.82617,"si_unit":"%"}
{"i2c_address":"0x77","timestamp":1740661260,"value":1000.35,"si_unit":"hPa"}
{"i2c_address":"0x77","timestamp":1740661260,"value":107.9562,"si_unit":"m"}
Page last edited May 13, 2025
Text editor powered by tinymce.