Stufin
Home Quick Cart Profile

Arduino Data Logger Shield for Boards Compatible

Buy Now on Stufin

Input Channels

+ 6 x Analog Input Channels (0-5V)

+ 6 x Digital Input Channels

RTC Module

+ DS1307 RTC Chip

+ Battery Backup System (CR2032 Battery)

SD Card Slot

+ MicroSD Card Slot (supports up to 32GB)

Power Requirements

+ 5V DC Power Input

+ Optional Battery Backup (CR2032 Battery)

Dimensions

+ 69.5mm x 53.5mm x 17.5mm

Applications

  • Environmental Monitoring: Log temperature, humidity, and other environmental data for monitoring and analysis.
  • Industrial Automation: Use the shield to log data from sensors and devices in industrial environments.
  • IoT Projects: Integrate the shield into IoT projects to log and store data from various sensors and sources.
  • Prototyping and Development: Use the shield as a development tool for rapid prototyping and proof-of-concept projects.
The Arduino Data Logger Shield is well-suited for a wide range of applications, including

Conclusion

The Arduino Data Logger Shield is a powerful and versatile peripheral designed to simplify the process of logging and storing data from various sensors and inputs. With its compact design, range of input channels, and customizable logging options, this shield is an ideal choice for a wide range of applications, from environmental monitoring to industrial automation and IoT projects.

Pin Configuration

  • Arduino Data Logger Shield for Boards Compatible: Pin Description and Connection Guide
  • The Arduino Data Logger Shield is a versatile logging solution designed to work with various Arduino boards. This comprehensive guide will walk you through the pins on the shield, their functions, and how to connect them.
  • Pin Description:
  • 1. VCC:
  • Function: Power Supply (3.3V or 5V)
  • Description: This pin provides power to the shield. Connect it to the VCC pin of your Arduino board.
  • 2. GND:
  • Function: Ground
  • Description: This pin provides a ground connection for the shield. Connect it to the GND pin of your Arduino board.
  • 3. SCL:
  • Function: I2C Clock
  • Description: This pin is used for I2C communication and provides the clock signal. Connect it to the SCL pin of your Arduino board.
  • 4. SDA:
  • Function: I2C Data
  • Description: This pin is used for I2C communication and provides the data signal. Connect it to the SDA pin of your Arduino board.
  • 5. CS:
  • Function: Chip Select (SPI)
  • Description: This pin is used to select the SD card for SPI communication. Connect it to a digital pin on your Arduino board (e.g., D5).
  • 6. MOSI:
  • Function: Master Out Slave In (SPI)
  • Description: This pin is used for SPI communication and transmits data from the Arduino board to the SD card. Connect it to a digital pin on your Arduino board (e.g., D11).
  • 7. MISO:
  • Function: Master In Slave Out (SPI)
  • Description: This pin is used for SPI communication and receives data from the SD card. Connect it to a digital pin on your Arduino board (e.g., D12).
  • 8. SCK:
  • Function: Clock (SPI)
  • Description: This pin is used for SPI communication and provides the clock signal. Connect it to a digital pin on your Arduino board (e.g., D13).
  • 9. BAT:
  • Function: Battery Voltage Monitor
  • Description: This pin monitors the voltage of a connected battery. Connect it to a battery (e.g., 3.7V LiPo) or a voltage source.
  • 10. RTCT:
  • Function: Real-Time Clock (RTC) Backup Battery
  • Description: This pin provides power to the RTC module. Connect it to a battery (e.g., CR2032) or a voltage source.
  • Connection Structure:
  • To connect the Arduino Data Logger Shield to your Arduino board, follow this step-by-step guide:
  • 1. Power Connection:
  • Connect VCC to the VCC pin on your Arduino board.
  • Connect GND to the GND pin on your Arduino board.
  • 2. I2C Connection:
  • Connect SCL to the SCL pin on your Arduino board.
  • Connect SDA to the SDA pin on your Arduino board.
  • 3. SPI Connection (for SD card):
  • Connect CS to a digital pin on your Arduino board (e.g., D5).
  • Connect MOSI to a digital pin on your Arduino board (e.g., D11).
  • Connect MISO to a digital pin on your Arduino board (e.g., D12).
  • Connect SCK to a digital pin on your Arduino board (e.g., D13).
  • 4. Battery and RTC Connections:
  • Connect BAT to a battery (e.g., 3.7V LiPo) or a voltage source.
  • Connect RTCT to a battery (e.g., CR2032) or a voltage source.
  • Note:
  • Ensure that the Arduino board and the Data Logger Shield are compatible.
  • Verify the pin connections and voltage levels to avoid damage to the shield or your Arduino board.
  • Consult the datasheet and documentation provided with your Arduino board and SD card for specific pin connections and configuration.
  • By following this guide, you'll be able to successfully connect and use the Arduino Data Logger Shield with your Arduino board.

Code Examples

Arduino Data Logger Shield for Boards Compatible
Overview
The Arduino Data Logger Shield is a versatile expansion board designed to work with various Arduino boards, enabling users to log data from sensors, analog inputs, and digital inputs to a microSD card. This shield is ideal for applications requiring data logging, such as environmental monitoring, industrial automation, and IoT projects.
Features
Compatible with various Arduino boards, including Uno, Mega, and Due
 MicroSD card slot for data storage
 3x Analog input channels (0-5V)
 4x Digital input channels
 Real-time clock (RTC) with battery backup
 Supports FAT16 and FAT32 file systems
Hardware Connections
To use the Data Logger Shield, connect it to an Arduino board as follows:
Stack the shield on top of the Arduino board, ensuring the pins align correctly.
 Insert a microSD card into the shield's microSD card slot.
Software Examples
### Example 1: Logging Sensor Data
In this example, we'll log temperature and humidity data from a DHT11 sensor to a microSD card.
```c++
#include <DHT.h>
#include <SD.h>
// Define DHT11 sensor pin connections
#define DHT11_PIN 2
// Create a DHT object
DHT dht(DHT11_PIN, DHT11);
void setup() {
  // Initialize the SD card
  SD.begin();
// Create a file to log data
  File logFile = SD.open("log.txt", FILE_WRITE);
// Write the header to the file
  logFile.println("Date,Time,Temperature,Humidity");
  logFile.close();
}
void loop() {
  // Read temperature and humidity data from the DHT11 sensor
  float temperature = dht.readTemperature();
  float humidity = dht.readHumidity();
// Create a string to log the data
  String dataString = String(year()) + "-" + String(month()) + "-" + String(day()) + "," +
                      String(hour()) + ":" + String(minute()) + ":" + String(second()) + "," +
                      String(temperature) + "," + String(humidity);
// Open the log file in append mode
  File logFile = SD.open("log.txt", FILE_WRITE);
// Write the data to the file
  logFile.println(dataString);
  logFile.close();
// Wait 10 minutes before logging again
  delay(600000);
}
```
### Example 2: Logging Digital Input States
In this example, we'll log the states of four digital input channels to a microSD card.
```c++
#include <SD.h>
// Define the digital input pins
const int inputPins[] = {2, 3, 4, 5};
void setup() {
  // Initialize the SD card
  SD.begin();
// Create a file to log data
  File logFile = SD.open("log.txt", FILE_WRITE);
// Write the header to the file
  logFile.println("Date,Time,Input 1,Input 2,Input 3,Input 4");
  logFile.close();
}
void loop() {
  // Create a string to log the data
  String dataString = String(year()) + "-" + String(month()) + "-" + String(day()) + "," +
                      String(hour()) + ":" + String(minute()) + ":" + String(second()) + ",";
// Read the digital input states
  for (int i = 0; i < 4; i++) {
    dataString += String(digitalRead(inputPins[i])) + ",";
  }
// Remove the trailing comma
  dataString.remove(dataString.length() - 1);
// Open the log file in append mode
  File logFile = SD.open("log.txt", FILE_WRITE);
// Write the data to the file
  logFile.println(dataString);
  logFile.close();
// Wait 10 minutes before logging again
  delay(600000);
}
```
### Example 3: Real-Time Clock (RTC) Usage
In this example, we'll use the RTC to log the current date and time to a microSD card.
```c++
#include <Wire.h>
#include <RTClib.h>
#include <SD.h>
// Create an RTC object
RTC_DS3231 rtc;
void setup() {
  // Initialize the SD card
  SD.begin();
// Check if the RTC is available
  if (!rtc.begin()) {
    Serial.println("RTC not found!");
    while (1);
  }
// Create a file to log data
  File logFile = SD.open("log.txt", FILE_WRITE);
// Write the header to the file
  logFile.println("Date,Time");
  logFile.close();
}
void loop() {
  // Get the current date and time from the RTC
  DateTime now = rtc.now();
// Create a string to log the data
  String dataString = String(now.year()) + "-" + String(now.month()) + "-" + String(now.day()) + "," +
                      String(now.hour()) + ":" + String(now.minute()) + ":" + String(now.second());
// Open the log file in append mode
  File logFile = SD.open("log.txt", FILE_WRITE);
// Write the data to the file
  logFile.println(dataString);
  logFile.close();
// Wait 10 minutes before logging again
  delay(600000);
}
```
These examples demonstrate the basic usage of the Arduino Data Logger Shield for logging sensor data, digital input states, and using the RTC. You can modify and expand upon these examples to suit your specific IoT project requirements.