0% found this document useful (0 votes)
16 views4 pages

SPI Reader EN

This document provides instructions for wiring an SD card reader module to an Atmega328p microcontroller and programming it to log data to an SD card. It details the wiring, formatting the SD card, testing it works by displaying card information, and provides an example sketch for logging analog sensor readings to a text file on the card.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

SPI Reader EN

This document provides instructions for wiring an SD card reader module to an Atmega328p microcontroller and programming it to log data to an SD card. It details the wiring, formatting the SD card, testing it works by displaying card information, and provides an example sketch for logging analog sensor readings to a text file on the card.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Welcome!

And thank you for purchasing our AZ-Delivery SPI reader micro memory card
module for the Atmega328p. On the following pages, we will take you through
the first steps of the installation process on the Atmega328p.
We wish you a lot of fun!

This data logger is suitable for FAT16/FAT32 formatted SD cards with up to


32GB and that can support 5V voltage supply.

Wiring the module with an Atmega328p:


+5V is connected to 5V on the Atmega328p Red wire
GND is connected to GND Black wire
MOSI is connected to D11 Orange wire
MISO is connected to D12 Purple wire
SCK is connected to D13 Yellow wire
CS is connected to D10 Green wire

After everything has been wired, then the Atmega328p can be supplied with
electric power.

„Programming“ the SD card reader:

In order to use the SD card with the Atmega328p, it has to be firstly formatted as
FAT16 or FAT32. For that, we recommend the SDFormatter program:
https://www.sdcard.org/downloads/formatter_4/

Then we let the SD card information to be shown. To do this, we start:

Select under File > Examples > SD > CardInfo.


Since there are different SD cards shields, we still need to indicate our Pin in the
code:

// change this to match your SD shield or module;

// Atmega328p Ethernet shield: pin 4

// Adafruit SD shields and modules: pin 10

// Sparkfun SD shield: pin 8

// MKRZero SD: SDCARD_SS_PIN

const int chipSelect = 10;

Possibly, the baud rate can now still be adjusted.


Serial.println (57600);

Or the baud rate in the serial monitor needs to be adjusted (to 9600

Baud). Open the Serial Monitor in the Arduino-IDE software:


Tools > Serial Monitor

If everything has been correctly completed, then the SD card will be recognized:
Now we can also write data on the SD card. For that, there is the example
DataLogger:

Here adjust again the shield:

const int chipSelect = 10;

And, if possible, also change the baud rate. After the upload, the values from the
analogue input 0, 1 and 2 are written on the SD card in a file, named „datalog.txt“.

You did it! Your data logger writes test


results on your µSD card!

Now it is time to learn and actualize your own projects.

For more hardware, our online store is always at your disposal:

https://az-delivery.de

Enjoy!
Imprint

https://az-delivery.de/pages/about-us

You might also like