This repository provides domain-specific lossless compression algorithms for resource-constrained Arduino microcontroller platforms. It features a delta-Rice coding scheme for temperature data and a regime-based adaptive Rice coding scheme for LDR (Light Dependent Resistor) data.
- Lossless Compression: Exact byte-for-byte reconstruction.
- Resource Efficient: Requires <256 bytes of RAM on an Arduino Uno during encoding.
- Domain-Specific: Exploits structural properties of physical sensor data (temporal coherence, regime-based behavior).
- Cross-platform Decompression: Python backend for restoring and analyzing data.
arduino/: Contains the sharedRiceCodecC++ files and the sketches fortemperature_compressionandldr_compression.python/: Contains thedecompress.pybackend, statistical analysis tools, and unit tests.
- Arduino: Upload the desired sketch to your Arduino with an SD card module connected (CS=10, MOSI=11, MISO=12, SCK=13). The encoded data will be saved as
.binfiles in the/compressed/directory on the SD card. - Python: Use
python/decompress.py <file.bin>to convert the binary files back into readable lists or process a whole directory using the script'sbatch_process_directoryfunctionality.
Run the unit tests in the python/ directory using:
python -m unittest test_decompress.py