1. ABOUT THE DATASET
------------

Title:	ReMINDS-SPaRAS: Customisable Environmental Sensor, Code and Results

Creators: James Gerrans (https://orcid.org/0009-0004-7866-1383), R. Simon Sherratt (https://orcid.org/0000-0001-7899-4445)

Organisation: University of Reading

Rights-holder(s): James Gerrans and University of Reading
Publication Year: 2026

Description: This dataset documents the proposal and evaluation of SPaRAS: a Smart Packaging and Returns Assessment Device developed throughout the course of James Gerrans's PhD as a technological solution to enable Medicine Reuse. This forms the supplementary information for a paper submitted to Nature Communications. 
This dataset and work carried out during James Gerrans's PhD, including associated publications, is part of the ReMINDS project (http://www.reading.ac.uk/ReMINDS). ReMINDS is an innovative multidisciplinary research project at the University of Reading creating the science and technology behind medication reuse and environmental stewardship in pharmaceutical and clinical settings.

Included in this dataset is embedded software for STMicroelectronics STM32L4P5 CPU, developed from STMicroelectronics example code, to control the NFC and peripherals forming SPaRAS: the ReMINDS Customisable Environmental Sensor. This software is built on "STM32CubeIDE 1.14.1". 
Also included is a program, developed in "Eclipse IDE for C and C++ Developers - 2025-06" that processes information extracted from the device.

This dataset also contains the results from analysing this system in regards to: functionality, battery lifespan, memory consumption and efficiency of data extraction. Data from each stage of processing the results of these tests have been documented within this dataset.
This includes: 
- Environmental data extracted from the board during an extended functionality test
- Current readings from the board used to determine the battery usage and lifespan of the SPaRAS
- Time measurements when extracting small amounts of data from the board which are extrapolated to approximate the time needed when reading all data from the device.

In each relevant file, captions have been added for clarity to explain the process used when analysing data.
Also included in this dataset is an excel workbook containing the final results used to generate all figures and tables submitted within the associated publication.

Cite as: Gerrans, James and Sherratt, Simon (2026): ReMINDS-SPaRAS: Customisable Environmental Sensor, Code and Results. University of Reading. Dataset. https://doi.org/10.17864/1947.001487 

Related publication: This dataset forms the supplementary information for "A Customisable Environmental Sensor to Enable Prescription Medicine Reuse" an academic paper, submitted to Nature Communications on 16/01/2026, as part of James Gerrans' PhD. All authors of the paper are listed here: James Gerrans, Nilanjan Dey, and R. Simon Sherratt

Contact: R. Simon Sherratt (r.s.sherratt@reading.ac.uk) as corresponding author of the related paper.

Acknowledgements: 
The creators of this dataset acknowledge support and guidance from academic supervisors and research collaborators.
ST Microelectronics is also acknowledged for contribution of original code that was modified throughout this project. More details can be found in the terms of use section.

2. TERMS OF USE
------------

Data, modifications to FP-SNS-SMARTAG2 code and documentation: copyright 2026 James and Gerrans and University of Reading. This material is licensed under a Creative Commons Attribution 4.0 International Licence: https://creativecommons.org/licenses/by/4.0/.

FP-SNS-SMARTAG2 (STMicroelectronics example code for the SMARTAG2 Evaluation Board, which has been modified by the creators of this item): copyright 2022 STMicroelectronics. All Rights Reserved. This code is distributed under the terms of the STMicroelectronics software licence, which is reproduced in the Code.zip file, in the folder SmartagV3.2\STM32CubeFunctionPack_SMARTAG2_V1.1.0.


3. PROJECT AND FUNDING INFORMATION
------------

Title: PhD carried out by James Gerrans

Dates: 09/2021-2026 (PhD still ongoing, ending in 2026)

Funding organisation: This PhD was carried out with funding by the University of Reading Regional Bursary PhD Studentship


4. CONTENTS
------------

File Structure: The file structure and location of all files included in this dataset are laid out here. This includes an overview of the data stored in each folder. The files have been organised into the following categories: code (code used to generate results), SPaRAS Input Files (files used to customise SPaRAS devices), SPaRAS Output Files (unprocessed binary data read from SPaRAS devices), Result Data (processed data gathered from tests and used to calculate results) and Source Data (final results data used to generate graphs and tables in the associated paper).
Code, SPaRAS Input files, and SPaRAS Outfile files are stored in separate folders.
Result data files include the prefix: ResultDat_
Source data files include the prefix: SourceDat_


- SourceDat_Figures.xlsx
- ResultDat_ExtractData.xlsx 
- ResultDat_BatteryLife.xlsx
- ResultDat_FunctionTest.xlsx
- SPaRASInputFiles | Folder | Contains the files used to customise device sensor configurations. 
	- JSONInputV3WkTst1.json
	- JSONInputV3WkTst2.json

- SPaRASOutputFiles | Folder | Contains the unprocessed files extracted from devices at the end of the test.
	- Board1 | Folder | Contains raw binary (.bin) files extracted from Board 1.  
		- data1-0.bin
		- data1-1.bin -> data1-127.bin

	- Board2 | Folder | Contains raw binary (.bin) tfiles extracted from Board 2. 
		- data1-0.bin
		- data1-1.bin -> data1-31.bin

- Code.zip | Zipped Folder | Contains the code used to operate SPaRAS and process information extracted from SPaRAS devices:
	- ReadSmartag2-VFlash
	- Smartag V3.2


File listing: The folders/files contained in this dataset are outlined below, detailing their: purpose, contained information, and use within the associated publication. The file descriptions below are provided in the following categories: Code, SPaRAS Input Files, SPaRAS Output Files, Results Data and Source Data.

Code: (Further information on each program can be found in the README.txt provided for each program.)
- ReadSmartag2-VFlash | Folder | Contains the program used to decode output files from the SPaRAS devices from binary to a human readable format (.txt and .csv). 

- Smartag V3.2 | Folder | Contains the code used that operates the modified SMARTAG2 board as a SPaRAS device. 


SPaRAS Input Files:
- JSONInputV3WkTst1.json | JavaScriptObjectNotation file (.json) | Contains sensor configurations and static information used to customise Board 1 for the extended functionality test.

- JSONInputV3WkTst2.json | JavaScriptObjectNotation file (.json) | Contains sensor configurations and static information used to customise Board 2 for the extended functionality test.


SPaRAS Output Files:
SPaRAS output files are named following the structure: "data[boardNumber]-[pageNumber].bin" and are stored in folders named after the corresponding board (Board 1 or Board 2).
Each folder contains a file with pageNumber 0 which is used to store it's sensor configurations, static information on it's assigned medicines and the minimum/maximum readings taken by all active sensors. 
Also contained in each folder are multiple files storing the environmental data recorded during the test. Each file contains 2 consecutive flash pages worth of information starting with the pageNumber specified in the filename. These files are named in the structure stated above ranging from pageNumber 1 to the highest page extracted increasing in intervals of 2 to include all odd integers.

- Board1 | Folder | Contains raw binary (.bin) files extracted from Board 1 during the extended functionality test.  
	- data1-0.bin | Binary file (.bin) | Contains the sensor configurations, static information and min/max readings for the device.
	- data1-1.bin -> data1-127.bin | Multiple Binary files (.bin) | 64 files containing all environmental data gathered by the device.

- Board2 | Folder | Contains raw binary (.bin) files extracted from Board 2 during the extended functionality test. 
	- data2-0.bin | Binary file (.bin) | Contains the sensor configurations, static information and min/max readings for the device.
	- data2-1.bin to data1-31.bin | Multiple Binary files (.bin) | 16 files containing all environmental data gathered by the device.


Results Data:
- ResultDat_BatteryLife.xlsx | Microsoft Excel Workbook (.xlsx) | Contains the data gathered by measuring the current draw of multiple SPaRAS devices. This was used to calculate a sum of the charge drawn throughout a hypothetical usage for each sensor configuration to estimate a device's battery life in relation to it's sample rate.
This workbook contains the following spreadsheets:
- Current Readings (Board 1): The current readings measured during events occurring on Board 1, organised by type of event
- Current Readings (Board 2): The current readings measured during events occurring on Board 2, organised by type of event
- Current Readings (Board 3): The current readings measured during events occurring on Board 3, organised by type of event
- Individual Events: The charge drawn calculated for every event measured on each board.
- Average Events: The average charge drawn for each type of event measured on each board, including the average over all boards. 

- ResultDat_ExtractData.xlsx | Microsoft Excel Workbook (.xlsx) | Contains Time measurements when moving a specified number of flash pages from flash memory to NFC memory. This data was used to find the amount of time taken to extract large amounts of data from a SPaRAS device

- ResultDat_FunctionTest.xlsx | Microsoft Excel Workbook (.xlsx) | Contains the processed temperature and humidity environmental data extracted from SPaRAS devices during the extended functionality test. This data was processed from the binary files (Located in "SPaRAS Input Files (JSON)") by the ReadSmartag2-VFlash code (Located in "Code.zip").

Source Data:
- SourceDat_Figures.xlsx | Microsoft Excel Workbook (.xlsx) | Contains the data used for each figure/table in the paper. Data is separated into spreadsheets labelled by their corresponding numbers in the associated publication. 
This workbook contains the following spreadsheets:
- Figure 1: A comparison of temperature and humidity between two devices over a week long test
- Figure 2: Relationship between the battery lifespan and frequency of sensor activation
- Figure 3: Relationship between the lifespan regarding memory consumption and Sample rate
- Figure 4: The time taken to extract environmental data from SPaRAS
- Figure 5: The relationships between the sample rate and time taken to fill limited memory
- Figure 6: The interactions of lifespan of the device from multiple factors with respect to sample rate
- Table 1: A breakdown of the time taken to extract one or two flash pages from SPaRAS
- Table 2: The maximum number of readings that can be extracted for each minute
- Table 3: The profiles used in the 9 day test


5. METHODS
-----------

The code included in this dataset was developed from STMicroelectronics code in the STM32CubeIDE 1.14.1. 
Further information on each program can be found in the README.txt provided for each program. Description of SPaRAS software and hardware development can be found in the README.txt for the Smartag V3.2 program.

Result generation/processing can be found in the methods section of the associated paper and in captions included in the Microsoft Excel Workbook (.xlsx) files contained in this dataset.