Electronics

Expansion Shield MEGA Sensor Shield V2 for MEGA 2560

AED 30.45

Low stock
1

Description

The Arduino MEGA has many more I/O pins (54 Digital pins and 16 Analog pins)than a standard Arduino. This shield also has connectors specifically for some external devices like an SD Card, Radiocommunications (Bluetooth and others). It also has an option to power the "V" pins on all the Digital I/O 3-pin groups from an external power supply instead of the Arduino +5V. This is good for large numbers of servos etc. The "Analog" 3-pin groups still use the Arduino +5V which is better from an electrical noise perspective.
This version has two options of +5V supply to all the "V" pins:

  • The jumper on +5 comes from the Arduino. Should be limited to about 300 ma
  • Jumper off: +5 (or other appropriate voltage) comes from an external supply connected to the blue terminal strip. External power Ground must also be connected to the blue terminal strip.

Using an external supply allows more current than the Arduino or Mega can supply, such as current for control of many servos or Relays, and other attached devices. Usually, this is +5V because most external devices require it. It is possible to use +6 volts if ALL the attached devices are the same such as Servos with that rating.

MEGA-SensorShieldV20-1024.jpg

Dedicated Connectors (pins left to right, top to bottom, as the above picture)

  • ICSP: RST, D52/SCK, D50/MISO, GND, D51/MOSI, 5V
  • Bluetooth: 3V3, GND, D0/RX0, D1/TX0, GND, 5V
  • SD Card: D50/MISO, D52/SCK, D53/SS, D51/MOSI, 5V, GND
  • APC220 (Wireless): --, D19/RX1, D18/TX1, --, 5V, GND
  • URF01 (ultrasonic): 5V, D48, D49, GND

نتيجة بحث الصور عن Expansion Shield  MEGA Sensor Shield V2 for MEGA 2560


Interfacing SD Card Module to Expansion Shield MEGA Sensor Shield V2 for MEGA 2560 Example:

In this tutorial, you will learn how to interface the SD Card Module to the Arduino Mega via a Sensor Shield.

Firstly, let's take a close look at the SD card connector on the Mega Sensor Shield.

Mega Sensor Shield SD Header Pinout

Mega Sensor Shield
SD Card Header

Corresponding
Arduino Mega Pins

Pin 1

50 MOSI

Pin 2

52 SCK

Pin 3

53 CS / SDCS

Pin 4

51 MOSI

Pin 5

GND

Pin 6

5V


The 6-pin SD Card connector is actually an SPI bus, and their pin designation is described in the table above.

Of course, the Mega Sensor Shield isn't essential to interfacing the SD Card module to the Arduino Mega, however, it absolutely makes life easier and adds reliability to your device.

There is one important reason why the Arduino Mega is chosen instead of the Arduino Uno (or any Arduino with the ATmega 328 microcontroller). There is only 2 KB of SRAM in the ATmega 328. SD card buffer requires 512 Byts, that's one-quarter of the available memory. By putting a few Serial.print functions in the code, it's pretty easy to run out of SRAM in the ATmega 328 before you know it. As SRAM runs out, heap and stack clashes and your program's behavior can become strange and inconsistent. As confusing as it can get, it's hard to tell whether it's the 'bug' in the code or short of SRAM, a situation no one wants to go into. On the other hand, the Arduino Mega has 8 KB of SRAM, that's sufficient to most embedded programming, and plenty of room can be left for future improvement/extension.


Interfacing SD card module to Mega Sensor Shield

Download this SD card library into the Arduino/libraries folder.

Once it's wired up, download this sketch to the Arduino Mega, make sure you have the correct board and serial com selected. Open the Serial Monitor, and set the Baudrate to 9600, if the SD card is working correctly, you should see something like this.

SD Connection successful

If it fails to initialize, try the things below:

1. Shut down the Serial monitor, unplug the USB cable, wait for about 10 seconds (wait for the capacitors to discharge) , and plug it back again. Start the Serial monitor, and push the reset button.