Long-Term Telemetry: Temp & Humidity Data Logger
When an Arduino turns off, it forgets entirely everything it ever measured. The Bluetooth & SD Data Logger project shifts focus away from immediate real-time actuation and instead targets "Archival Analysis." By utilizing the SPI bus to write massive CSV files onto a physical MicroSD card, the system creates permanent, graphed historical records of terrifying 30-day thermal cycles in greenhouses or server racks.

Interfacing the Hardware SPI (MicroSD Module)
The MicroSD card architecture uses the incredibly fast SPI protocol.
- You wire the card adapter using the exact hardware pins (Usually:
MOSI: 11, MISO: 12, SCK: 13, CS: 4). - The SD.h Trap: Opening a file on an SD card is an intensely heavy operation.
- The C++ code forces the Arduino to parse a specific
log.csvstring:
File dataFile = SD.open("datalog.csv", FILE_WRITE);
if (dataFile) {
dataFile.print(rtcTime);
dataFile.print(","); // Critical CSV Comma Separator
dataFile.print(varTemp);
dataFile.print(",");
dataFile.println(varHumid); // The 'println' forces a massive carriage return.
dataFile.close(); // You MUST close the file, or the buffer will never save the data to the card!
}
Bluetooth Data Polling
The user doesn't want to pull the SD card out of the machine every two hours.
- We integrate an HC-05 Bluetooth Module.
- The Arduino runs a listening loop. If you connect your Android phone and send the letter
"D"(Dump data), the Uno intercepts the request! if (command == 'D') { dumpDataToPhone(); }- The Arduino violently opens the
.csvfile, reads the last 100 historical telemetry lines from the SD card usingfile.read(), and blasts those raw characters straight over the Bluetooth serial line onto your smartphone screen for immediate field analysis!
Logging Hardware Infrastructure
- Arduino Uno/Nano or Pro Mini.
- MicroSD Card Adapter Module + a generic FAT32 formatted 4GB/8GB SD Card.
- DHT22 or BME280 Precision Environmental Sensor.
- DS3231 I2C RTC Module (Absolutely mandatory. Writing "73 Degrees" is useless if you don't know the exact time and date it happened!).
- HC-05 Bluetooth Module for remote data querying.