Higher Logging Rate on the SD Card

Please note: This article only refers to Purple Classic SD sensors (PA-II-SD).

PurpleAir sensors sample particulate matter every second. These samples are averaged in 2-minute intervals, which are sent in data reports to our database. Those 2-minute reports are the smallest frequency (“real-time”) averages you can see on the map. Sensors that have an SD logger and an SD card will store these 2-minute reports on the SD card as well.

Occasionally, a user will have an interest in storing data on the SD card at more frequent intervals. This can be done with some slight modifications to the sensor’s hardware and one of the files on the SD card.

For example, one of our users was performing research on a wildfire by attaching one of our sensors to a drone and flying the drone over the fire. In this case, the second-by-second data was important to the researcher.

Step 1: Hardware Alteration

You will need to disconnect the sensor from power and remove the components from the sensor housing. Once this is done, you will cut the black wire that connects the SD logger to the mainboard.

Step 2: SD Card Alteration

Next, you will remove the SD card from the logger and connect it to a computer. On the SD card, you will find a file called “config.txt”. The contents of this file need to be edited.

Original:

115200,26,3,0,1,1,0
baud,escape,esc#,mode,verb,echo,ignoreRX

After alteration:

115200,26,0,0,1,1,0
baud,escape,esc#,mode,verb,echo,ignoreRX

Note that the third value of the first line—corresponding with “esc#”—needs to be changed from “3” to “0”.

How Will the Data Appear

After these two steps have been completed, you can insert the SD card back into the sensor, return the components into the housing, and power on the sensor. The SD card will no longer store data in CSV format. Rather, all data will be stored in text files called “LOGXXXXX.TXT”. There will be a new row of data for every second. For more information about how to understand what this data output means, you can refer to this article: Understanding PurpleAir Serial Output.

Additional Information

Be aware that making the above alterations will change how the sensor stores data on the SD card; it will not change how frequently the sensor sends its 2-minute averages to our database. These will still be sent at 2 minute intervals. Additionally, remember that this method will cause the SD card storage to be filled much more quickly than when the sensor runs in its default format.

The above alterations can be undone by soldering the black cord back to its original location on the logger and reverting the change in the config.txt file.

A full reference for the config.txt file can be found here:


Learn More

How to Obtain Sensor Data
SD Card Logging and Troubleshooting
SD Card File Headers

Can you explain how cutting this wire and having a higher data logging rate is beneficial to a user? Is the sensor accumulating excess data that the SD card is not able to log?

1 Like

Hi,
When I saw this I was very keen to try out the high data rate logging, I have implemented it but it has proven unreliable across 5 different sensors.

Higher Logging Rate on the SD Card

Any thoughts?

many thanks
Jim McQuaid (Sensing Leeds - a network of 50+ Purpleair sensors across Leeds/Bradford)

In certain use cases, a user will want a higher frequency of data logs than 2 minutes, which is what the service typically provides. As an example, we recently had a researcher ask if he could measure the air while moving across a city with 1-second samples. This solution was beneficial in that use case.

Since the sensor technically performs air sampling on a 1-second basis, it has the capability to log data much more frequently than 2-minutes to the SD card, with the limitation that it can’t log this 1-second data to PurpleAir servers (those will still be an accumulated 2-minute average).

Hi Jim, what’s the issue you’re running into? If you’d like, we can jump on a call to go over any details you’d like. Just send us an email at contact@purpleair.com.