The Challenger RP2040 SD/RTC is an Arduino/Circuitpython compatible Adafruit Feather format micro controller board based on the Raspberry Pico chip.
This board is equipped with an micro SD card reader and a Real Time Clock making it super useful for data logging applications.
Micro SD Card
This board is equipped with a micro SD card connector that will house standard micro SD cards allowing your application to have many gigabytes of storage room for sensor data or what ever you want to place on it. Together with a fancy display you could also store cool images.
Real Time Clock (RTC)
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 other 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 intperrupt 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.
USB Type C
In the recent years we have noticed that we are seeing more and more USB Type C cable laying around the lab due to the fact that all new phones and accessories use them. As of yet we haven’t seen any shortage of micro USB cables but we are not getting any new ones any more and old ones do break occasionally. So we decided to go for a USB Type C connector for this board. A bonus of this is that they are quite bit more durable and you don’t have to fiddle with the cable when plugging it in.
On board charger
The board is equipped with a standard 2.0mm JST connector for connecting a rechargeable LiPo battery. There is also an internal battery charger circuit that charges your battery as long as a USB cable is inserted or the VUSB connection is connected to 5V.
The SD Card is not included with the board and needs to be purchased separately.
Weight
0.009 kg
Dimensions
5.07 × 2.28 × 0.72 cm
Using the Arduino environment
We’ve teamed up with Earle F. Philhower over at his Github page to provide Arduino support for our RP2040 based boards. You can follow the instructions on Earle’s github page or you can check out our instructions here on how to install the package.
Circuitpython
The Challenger RP2040 WiFi board is fully compatible with Adafruits CircuitPython. Instruction are available on how to install the python interpreter of your choice is available on respective web site.
Short logger example
All the existing SD card examples in the Philower arduino-pico works 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 on board 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
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"); }
// 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); }
CircuitPython by Adafruit
The Challenger boards fully supports circuitpython and images are available from the official Circuitpython site.
How do I use it
Basically it works as any other circuitpython board but we have included relevant board parameters for simplify accessing specific pins and other special IO’s. The board help function lists the following functions:
Reviews
There are no reviews yet.