The Adafruit Feather 32u4 Adalogger is a versatile and portable development board that combines the power of the ATmega32u4 microcontroller with the convenience of an onboard microSD card slot for data logging. This board is part of the Feather ecosystem, designed by Adafruit for ease of use and flexibility. It is ideal for projects that require data collection, such as environmental monitoring, experimental data logging, or even as a tiny, stand-alone GPS logger.
Pin Number | Function | Description |
---|---|---|
1 | GND | Ground |
2 | BAT | Battery + |
3 | EN | Enable pin for the 3.3V regulator |
4 | USB | USB data- |
5 | USB | USB data+ |
6-13 | Digital I/O | Digital pins, can also serve as PWM, SPI, I2C |
14-19 | Analog Input | Analog pins, can also serve as digital I/O |
20 | AREF | Analog reference voltage for the ADC |
21 | SCK | SPI clock |
22 | MISO | SPI Master In Slave Out |
23 | MOSI | SPI Master Out Slave In |
24 | SS | SPI Slave Select |
25 | RXLED | RX LED, lights up when the USB port receives data |
26 | TXLED | TX LED, lights up when the USB port sends data |
27 | SDA | I2C Data |
28 | SCL | I2C Clock |
29 | RST | Reset pin |
#include <SPI.h>
#include <SD.h>
File dataFile;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // Wait for serial port to connect. Needed for native USB port only
}
Serial.print("Initializing SD card...");
if (!SD.begin(4)) { // Make sure to use the correct chip select pin
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
// Create or open the data file
dataFile = SD.open("datalog.txt", FILE_WRITE);
// If the file is available, write to it:
if (dataFile) {
dataFile.println("Logging data...");
dataFile.close(); // Make sure to close the file when you're done
Serial.println("Data written.");
} else {
// If the file isn't open, pop up an error:
Serial.println("error opening datalog.txt");
}
}
void loop() {
// Nothing here for now.
}
Q: Can I power the Adalogger with a 5V supply? A: No, the operating voltage is 3.3V. You must use a regulated 3.3V supply or the onboard USB connection.
Q: How do I program the Adalogger? A: You can program it using the Arduino IDE. Select the "Adafruit Feather 32u4" board from the Boards menu.
Q: What is the maximum size of the SD card that can be used? A: The Adalogger supports microSD cards up to 32GB in size.
Q: Can I use the Adalogger for real-time clock (RTC) applications? A: Yes, the Adalogger has a built-in RTC. You'll need to add a 3V coin cell battery to the board to keep the clock running when power is disconnected.