Build a Digital Data Logger
A data logger automatically records measurements from sensors over long periods of time. It can store information such as temperature, humidity, voltage, current, pressure or light intensity on an SD card or transmit it wirelessly to a computer or cloud service. Data loggers are widely used in laboratories, industrial automation, environmental monitoring, renewable energy systems and scientific research.
Project Overview
The microcontroller periodically reads one or more sensors and stores the measurements together with the current date and time.
Each record is written to an SD card or transmitted to a remote server, allowing the data to be analysed later using spreadsheet or graphing software.
The sampling interval may range from milliseconds to several hours, depending on the application.
Project Difficulty
| Item | Value |
|---|---|
| Difficulty | ⭐⭐⭐ Intermediate |
| Build Time | 4–8 Hours |
| Supply Voltage | 3.3 V or 5 V DC |
| Storage | MicroSD Card or Flash Memory |
| Controller | Arduino, ESP32 or STM32 |
Main Sections
| Section | Function |
|---|---|
| Microcontroller | Controls data acquisition and storage. |
| Sensors | Provide measurement data. |
| RTC Module | Adds accurate date and time to each record. |
| MicroSD Module | Stores collected data. |
| Display (Optional) | Shows current measurements. |
| Power Supply | Powers the complete system. |
Typical Sensors
| Sensor | Measurement |
|---|---|
| DS18B20 | Temperature |
| DHT22 | Temperature and Humidity |
| BME280 | Temperature, Humidity and Pressure |
| ACS712 | Current |
| Voltage Divider | Voltage |
| BH1750 | Light Intensity |
| MQ-135 | Air Quality |
Typical Components
| Quantity | Component |
|---|---|
| 1 | ESP32, Arduino Nano or STM32 |
| 1 | MicroSD Card Module |
| 1 | DS3231 RTC Module |
| 1–6 | Sensors |
| 1 | OLED or LCD Display (Optional) |
| 1 | Power Supply or Battery Pack |
| 1 | Project Enclosure |
How the System Works
The RTC provides the current date and time.
At each sampling interval, the microcontroller reads every connected sensor and combines the measurements with the timestamp.
The data is stored in CSV or TXT format on the MicroSD card, making it easy to open using spreadsheet applications.
In wireless versions, the same information can also be uploaded to a web server or cloud platform for remote monitoring.
Example CSV Record
| Date | Time | Temperature | Humidity | Voltage |
|---|---|---|---|---|
| 2026-08-03 | 14:30:00 | 28.5 °C | 65 % | 12.42 V |
Applications
- Weather stations.
- Solar power monitoring.
- Battery performance testing.
- Industrial process monitoring.
- Laboratory experiments.
- Greenhouse automation.
- Cold-room monitoring.
- Environmental research.
Testing
- Verify the supply voltage.
- Check communication with each sensor.
- Confirm the RTC keeps the correct date and time.
- Insert and format the MicroSD card.
- Verify that data files are created correctly.
- Open the CSV file on a computer.
- Compare sensor readings with reference instruments.
- Test long-term operation.
Troubleshooting
| Problem | Possible Cause |
|---|---|
| No data saved | MicroSD card not detected or incorrectly formatted. |
| Incorrect timestamps | RTC not set or backup battery depleted. |
| Sensor readings incorrect | Calibration or wiring problem. |
| Missing data | Power interruptions or software errors. |
| Corrupted files | Power removed while writing to the SD card. |
Project Improvements
- Add Wi-Fi cloud synchronisation.
- Transmit data using MQTT.
- Support LoRa communication for long-range monitoring.
- Add GPS location tagging.
- Display live graphs on a TFT screen.
- Automatically upload data to Google Sheets.
- Enable USB data export.
- Add battery level monitoring and deep-sleep mode.
Skills Learned
- Sensor interfacing.
- Data acquisition.
- Real-Time Clock (RTC) programming.
- MicroSD card storage.
- CSV file generation.
- Embedded system design.
Safety Notes
- Always disconnect power before inserting or removing the SD card.
- Use high-quality MicroSD cards for reliable long-term recording.
- Protect outdoor installations from moisture and dust.
- Ensure sensors operate within their specified voltage ranges.
- Back up recorded data regularly to prevent accidental loss.
Key Points
- A data logger automatically records measurements over time.
- An RTC provides accurate timestamps for every measurement.
- MicroSD cards offer simple and inexpensive data storage.
- CSV files can be analysed easily using spreadsheet software.
- Data loggers are widely used in science, industry, renewable energy and IoT applications.