Data-Logger Shield on the MEGA R3

hi together,

since we Support a relatively large number of questions on the use of our dataloggin shields in conjunction with a MEGAR3 comment I would like to today, to show what is necessary to this combination as simple as possible in operation to take.

For this we need to:

On the Data Logger Shield is a RTC (DS1307) and an SD Card Reader in FAT32 formatted cards are detected, and a Prototyping area.

The Problem of the two products (UNO and MEGA) is the different Pin Mapping. In a post I have already Transferred from the Pins on the other Controller are shown. A sample application with the Shield on the UNO we have here created.

We are using the RTC Library from Adafruit, which here to Download from GitHub is available, you can set this as usual in your folder "Libraries" from c:\Benutzer\Dokumente\Arduino\libraries add.

In the first step, we take care of the RTC, in connection to the SD Reader. Here software no Changes are necessary, we only add a connection on the Data Logger Shield SCL and SDA are connected to A4 and A5. Additional Pins are not occupied in this way, we have plenty of Alternatives. The easiest way to the connection by soldering of the additional pin is to be made on the Data-Logger Shield to fruition.

Here is a picture of the soldered pins (yellow):

This additional header is "A4" and "A5" of the Data-Logger Shield connected. In this connection we place on SDA and SCL, as shown in the image to recognize (MEGA with the Shield rotated 180°):

Thus, the RTC ready for use, and to set the time, get it right:

How the RTC is configured correctly and the Library used can be found in our E-Book for the RTC.

In the next step, we turn to the SD-Card-Reader. The Problem is the SD Library is the place to be want to use to compile the Work, the information necessary which is why we have a different library for it.

The Library from Adafruit from GitHub supports soft-SPI and is ideal for the Data-Logger Shield.

We add a Library to add we do this either through the library Manager, through the Import function of the same, or by copying the needed files toc:\Benutzer\Dokumente\Arduino\libraries.

However, since we want to be replaced for our purposes, the supplied Library, we navigate to the installation directory of the Arduino IDE, most of the time c:\Programme(x86)\Arduino\Libraries. Name the old library in order, for example, to SD_old and copy the Adarfuit-Library in its place:

the problems with the version management of libraries? -> VSCode with PlatformIO :)

Was the SD-Card Library replaced we can the example, sketch card info:

And need only one line to edit to change the highlighted line as in the Screenshot to identify:

Sketch upload and Serial Monitor open

And see the contents of the memory card.

Thus, the RTC and the SD Card Reader works. We want to be the example "data logger" from the previously replaced, new library, use the customization in SD to find.begin() instead, since card.init() here has no use:

a Lot of Fun tinkering with your Data-Logger Shield on MegaR3 and until the next post :)

 

For arduinoProduktvorstellungen

2 comments

Milan

Milan

Das SPI-Problem am SD-Shield lässt sich auch einfach mit 3 Kabeln lösen: Einfach Pin 50 (MISO) mit Pin 12, Pin 51 (MOSI) mit Pin 11 und Pin 52 (SCK) mit Pin13 auf dem Shield verbinden (löten). Um Probleme zu vermeiden, ist es besser, die “Beinchen” unter dem Shield abzuzwicken (4,5,11,12 und 13). Pin 10 stehen lassen! Der wird für den Slave Select benötigt und liegt beim Mega und Uno an der selben Stelle. … Dann muss man nicht mit den Bibliotheken rummachen … :-)

Bernhard

Bernhard

super, danke,
genau danach habe ich gesucht – und im Nu mein Problem gelöst.
Service auf höchster Ebene!

Leave a comment

All comments are moderated before being published

Recommended blog posts

  1. Install ESP32 now from the board manager
  2. Lüftersteuerung Raspberry Pi
  3. Arduino IDE - Programmieren für Einsteiger - Teil 1
  4. ESP32 - das Multitalent
  5. OTA - Over the Air - ESP programming via WLAN