Login / Signup
Cart
Your cart is empty
The iLabs Challenger RP2040 SD/RTC is an Arduino/Circuitpython compatible Adafruit Feather format microcontroller board based on the RP2040 chip used in the Raspberry Pi Pico.
This board is equipped with a microSD card reader and a Real Time Clock making it super useful for data logging applications.
Check out the full range of Challenger boards here!
This board is equipped with a micro SD card connector that will house standard microSD cards allowing your application to have many gigabytes of storage capacity for sensor data or whatever you want to place on it. Together with a fancy display you could also store images.
It is normally very useful to tag sensor data with a time stamp, so we included a Real Time Clock chip to make this easy for you.
The chip we use is the MCP79410 general purpose I2C Compatible real-time clock/calendar. It is a highly integrated real-time clock with nonvolatile memory and many other advanced features. These features include a battery switchover circuit for backup power, a timestamp to log power failures and digital trimming for accuracy. Using a low-cost 32.768 kHz crystal or another clock source, time is tracked in either a 12-hour or 24-hour format with an AM/PM indicator and timing to the second, minute, hour, day of the week, day, month and year. As an interrupt or wakeup signal, a multifunction open drain output can be programmed as an Alarm Out or as a Clock Out that supports 4 selectable frequencies.
The interrupt output from the RTC is connected to pin GPIO25 on the RP2040 and can be used to wake up the device repeatedly to collect data.
In recent years we have noticed that we are seeing more and more USB Type-C cables laying around the lab due to the fact that most new phones and accessories use them. So iLabs decided to go for a USB Type-C connector for this board. A bonus of this is that they are more durable and you don’t have to fiddle with the cable before plugging it in!
The board can be powered from multiple sources. The most obvious way to run the board is by plugging it into a USB-C cable and attaching it to your computer. In this mode, you can write software and test the board with all its functionality.
You can also supply the board with 5V via the header connectors on the PWR pin.
There is a third way to supply the board too. This way is more invasive and will disable the onboard 3.3V power regulator. When doing this you will have to pull the EN header pin low and then supply your own 3.3V voltage on the 3.3V header pin. Please note that when disabling the onboard power regulator you will have to supply the 3.3V also when running the system on battery power.
The board can also be powered by a rechargeable LiPo battery. The battery can be connected using a standard 2.0mm JST connector through the battery connector on the right side of the board, or if the battery is an integral part of the system that you are designing, it is possible to connect the battery through the BAT pin instead.
Switching between the battery voltage and the applied USB voltage or external 5V is achieved seamlessly by the onboard circuitry.
Charging of the battery is performed by either connecting a USB cable or by connecting a 5V power source to the header pin marked USB on the board. If you do this make sure you connect your voltage through a 1A schottky diode to avoid any excessive current draw in the system when the two levels are slightly different. Please note that providing external charger circuitry could destroy the internal charger on the Challenger board!
This board includes a Bi2C connector, a small FFC connection used to connect other Bi2C devices (such as the examples listed below).
The Bi2C (Bus I2C) concept is a spin-off from the existing Groove, Stemma and Qwiic ecosystems where we use an FFC (Flexible Flat Cable) instead of normal threaded cables to create the connection. This means that we can get away with connectors that have 0.5mm pitch which makes them super thin and compact. Read more about Bi2C here.
You can also use Bi2C with Qwiic/STEMMA QT boards using the Bi2C Qwiic/STEMMA QT adapter, giving you an ultra-thin cable option for compact projects and enclosures.
We’ve teamed up with Earle F. Philhower over at his Github page to provide Arduino support for our Raspberry Pi Pico-based boards. All instructions on how to install the board support package as well as multiple examples on how to use the Raspberry Pi Pico processor can be found there.
Short logger example
All the existing SD card examples in the Philower Arduino-pico work as long as you make sure to specify the correct SPI bus in the 'begin' statement. Check out the code below and specifically the SD.begin statement, here we can use the core-defined expressions for the pin and the SPI bus.
The example also shows how to use the onboard RTC to generate a time stamp for each group of measured samples:
/*
SD card datalogger
This example shows how to log data from four analog sensors
to an SD card using the SD library and tag each sample group
with a time stamp.
The circuit:
analog sensors on analog ins 0, 1, 2 and 3
The SD card is attached to SPI1 and uses pin 9 for card select.
Pin 13 is used to detect if a card is inserted or not.
created 24 Nov 2010
modified 9 Apr 2012
by Tom Igoe
Modified 31 oct 2022 to work with Challenger RP2040 SD/RTC
by P Oldberg
This example code is in the public domain.
*/
# include <SPI.h>
# include <SD.h>
# include <Wire.h>
# include <MCP79412RTC.h>
int anPins[] = {A0, A1, A2, A3};
MCP79412RTC RTC;
void setup() {
// Open serial communications and wait for port to open:
while (!Serial)
delay(10);
Serial.begin(115200);
Serial.println("Checking if there is an SD card inserted !");
pinMode(SD_CARD_DETECT, INPUT_PULLUP);
if (digitalRead(SD_CARD_DETECT)) {
Serial.println("No card inserted, wait for reset !");
while(1);
}
Serial.print("Initializing SD card...");
// see if the card is present and can be initialized.
// Notice the use of core defined pin and SPI channel
if (!SD.begin(SDCARD_CS_PIN, SD_SPI)) {
Serial.println("Card failed, or not present, waiting for a reset.");
while(1);
}
Serial.println("card initialized.");
Serial.println("Synchronizing time !");
RTC.begin();
setSyncProvider(RTC.get); // the function to get the time from the RTC
if (timeStatus()!= timeSet)
Serial.println("Unable to sync with the RTC");
else
Serial.println("RTC has set the system time");
}
void loop() {
char tmbuf[64];
snprintf(tmbuf, 64, "%04d-%02d-%02dT%02d:%02d:%02d|", year(), month(), day(), hour(), minute(), second());
String dataString = String(tmbuf);
// read three sensors and append to the string:
for (int analogPin = 0; analogPin < 4; analogPin++) {
int sensor = analogRead(anPins[analogPin]);
dataString += String(sensor);
if (analogPin < 3) {
dataString += ",";
}
}
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
File dataFile = SD.open("datalog.txt", FILE_WRITE);
// if the file is available, write to it:
if (dataFile) {
dataFile.println(dataString);
dataFile.close();
// print to the serial port too:
Serial.println(dataString);
}
// if the file isn't open, pop up an error:
else {
Serial.println("error opening datalog.txt");
}
delay(2000);
}
The Challenger SD/RTC is fully compatible with Adafruit's CircuitPython.
MicroSD card not included