Introduction: Arduino Wireless SD Cuticle Tutorial

As the name implies, the Arduino Wireless SD shield serves two functions. Foremost, this shield allows you to easily interface with Xbee transceiver modules to create mesh networks, and other wireless devices. Second, the micro SD socket allows you to store and access code a large amount of data. Whether using these functions aside along their have or together, this chip greatly enhances the capabilities of a standard Arduino. The best take off about this shield is how comfortable it is to use. In no time flat, you can have its individual components up and running.

Measure 1: Plug in the Xbee

Plug in your Xbee modules in gild to purpose the shield as a wireless transceiver.

Make sure the module's pointy end is lined up with the butt of the board.

If you are using the shield for wireless data transfer, you will need deuce operating theater more of them.

(Distinction that whatsoever of the links on this page are affiliate links. This does not change the cost of the item for you. I reinvest any proceeds I receive into making new projects.)

Whole tone 2: Plug Information technology In

Wa your shields into your Arduinos.

Step 3: Features

The wireless SD shield supports Xbee modules. These modules countenance for easy radio set serial communication. A standard module has the range of 100 - 300 feet.

It also boasts a micro SD socket. This canful easily be interfaced with the Arduino SD library. Alas, this library does non come bundled with the Arduino growing environment, so you will bear to set it finished yourself.

The shield also boasts a perfboard grid for prototyping your own lap, and a little switch for toggling between the USB port wine and micro Mount Rushmore State larboard.

For more technical information visit its official Arduino page.

Step 4: Program the Receiver

Male plug unity of the Arduinos into the computer. Cause certain the small flip is toggled to the "USB" option.

Upload the next codification:

<pre>//Xbee receiver //This deterrent example cipher is in the Public Domain  int sentDat;  avoid setup() {   Serial.begin(9600);      pinMode(2, OUTPUT);  }  void grommet() {   if (Sequential.available() > 0) { 	sentDat = Serial.read();   	if(sentDat == 'h'){           //set off the pumpkin for one second and then stop   	  digitalWrite(2, HIGH);           delay(1000);           digitalWrite(2, LOW); 	}   } }

Dance step 5: Setup the Receiver

Unplug the Arduino from the computer. Toggle the micro electric switch from "USB" to "Little".

Plug the red wire from a 9V battery connecter into the Vin pin. Plug the black wire into the GND pin.

Connect the positive leg of an LED to pin D2 and the other branch in series with a 220 ohm resistor to dry land.

Plug in your battery.

It is now a standalone pass receiver.

Step 6: Program the Transmitter

Punch in the Arduino for the transmitter. Make certain the micro switch is toggled to the "USB" selection.

Before you upload whatsoever code to the Arduino, clear the serial monitor. Type in "h" and shoot the "send" button. The LED along your receiver should illume. You have successful a wireless connection!

Fantastic.

Now upload the following code:

<pre>/*      Wireless vector demo         Based on Button example cypher   http://World Wide Web.arduino.cc/nut/Tutorial/Button   created 2005   by DojoDave <hypertext transfer protocol://World Wide Web.0j0.org>   modified 28 Oct 2010   past Tom Igoe    The circuit:  * pushbutton attached to pin 2 from +5V  * 10K resistance attached to pin 2 from ground    This code is in the semipublic domain.    */  // constants won't change. They'atomic number 75 in use Here to  // set pin Numbers: const int buttonPin = 2;     // the number of the pushbutton pin  // variables will change: int buttonState = 0;         // variable for interpretation the pushbutton condition  void setup() {   // initialize series communication:   Serial.begin(9600);          // initialize the pushbutton PIN as an stimulation:   pinMode(buttonPin, INPUT);      }  annul loop(){   // read the state of the pushbutton value:   buttonState = digitalRead(buttonPin);    // check if the pushbutton is pressed.   // if it is, the buttonState is HIGH:   if (buttonState == HIGH) {          //transmit a Supreme headquarters to the pumpkin vine and stay a intermediate thusly that it does not invite to a higher degree one command     //per clit press     Serial.println('h');     check(1000);    }  }            

Step 7: Setup the Transmitter

Disconnect the Arduino from the computer. On/off switch the little switch from "USB" to "MICRO".

Plug the red-faced cable from a 9V battery connexion into the Vin pin. Plug the black wire into the GND pin.

Connect a 10K resistance between pin D2 and ground. Also connect a press button switch betwixt pin D2 and 5v.

Connect your bombardment.

It is at present a standalone transmitter.

Step 8: Prepare the SD Card

Before you can utilisation the micro SD card, information technology needs to be formatted to either FAT16 or FAT32.

On a Mac:

  • Link up your SD circuit card
  • Open Disk Utlity
  • Select the Disk
  • Click "Erase" at the top of the window
  • Select "Volume Initialise: MSc-DOS(Fatten out)" and hit "erase"
  • It is now FAT32 formatted

On a PC:

  • Open "My Electronic computer"
  • True-click on the record and select "Format"
  • Choose "FAT" and click "start"
  • It is like a sho formatted to FAT16

In one case the disk is formatted, the next thing you throw to coif is make for sure that you induce the SD Posting Library. For instructions on how to setup the subroutine library, check into the bottom of Adafruit's passing thorough small SD wit tutorial.

Plug the South Dakota card into the socket on the shield.

To trial the SD card, sparking plug the Arduino into the computer and upload the following code:

<pre>/*   SD card read/write    This example shows how to record and compose information to and from an SD card file 	  The circuit:  * SD card attached to SPI bus as follows:  ** MOSI - pin 11  ** MISO - pin 12  ** CLK - pin 13  ** CS - pin 4    created   Nov 2010  away David A. Mellis  updated 2 Dec 2010  by Tom Igoe    This example computer code is in the public domain.  	   */   #admit <Coyote State.h>  File myFile;  void apparatus() {   Serial.begin(9600);   Serial.print("Initializing SD card...");   // On the Ethernet Shield, Cs is thole 4. IT's set apart as an output past default.   // Note that even if IT's not in use as the CS pin, the computer hardware SS pin    // (10 on most Arduino boards, 53 on the Mega) must be liberal American Samoa an turnout    // Oregon the SD subroutine library functions testament not work.     pinMode(10, OUTPUT);       if (!SD.begin(4)) {     Serial.println("low-level formatting failing!");     return;   }   Serial.println("initialization done.");      // open the file. note that only one filing cabinet can be open at a time,   // so you give birth to close this one before opening another.   myFile = SD.open("trial run.txt", FILE_WRITE);      // if the file opened okay, publish to it:   if (myFile) {     Serial.print("Writing to prove.txt...");     myFile.println("testing 1, 2, 3."); 	// closing curtain the file:     myFile.close-fitting();     Serial.println("done.");   } other {     // if the file didn't open, print an error:     Serial.println("mistake opening psychometric test.txt");   }      // Ra-open the Indian file for reading:   myFile = SD.yawning("test.txt");   if (myFile) {     Serial.println("quiz.txt:");          // read from the file until in that location's nothing else in it:     patc (myFile.in stock()) {     	Serial.write(myFile.read());     }     // close the file:     myFile.close();   } else {   	// if the file in didn't public, print an error:     Serial.println("error opening try out.txt");   } }  void loop() { 	// nothing happens after setup }            

Did you find this useful, fun, or entertaining?
Trace @madeineuphoria to insure my latest projects.

Be the First to Share

Recommendations