![]() |
|
|
|
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FeaturesThe Gadget Shield includes:
This is a 1.5g 120 sample-per-second digital accelerometer with 6-bit resolution and neat features such as tap/shake detection and tilt/orientation detection. Here is a direct link to the Freescale datasheet. This module contains three independent LED’s (red, green, and blue) with independent brightness control for each color since each LED is connected to a separate microcontroller PWM output. This gives you an incredibly wide color palette to choose from. This thing is bright -- the manufacturer does not recommend looking directly at it when operating at maximum power, and we usually just run it at about 10%-20% duty cycles because that’s plenty bright. This module outputs a digital low signal when 38kHz-modulated infrared energy is detected, as output by most infrared remote controls. See our sample software for using this module to decode infrared remote control transmissions. Together with the infrared LED emitter, this can be also be used as a non-contact object sensor (again, we have some sample software that demonstrates this). This LED emits light in the 940nm wavelength range and can be used to generate infrared remote control signals. This LED is controlled by a microcontroller timer pin so it is simple to generate the 38 kHz frequencies recognized by most receivers. See our sample software for using this LED together with the IR logic detector to turn your microcontroller board into a universal remote control. Use this to generate tones, alerts, or to play simple melodies (see our sample software below). The speaker uses PWM to generate frequencies up to 3000 Hz. Use this for sound sensing or tone detection. The microphone’s raw output is amplified (gain of 100), low-pass filtered to 15.9 kHz, offset by 2.5V then connected to an A/D input pin. This device outputs an analog signal inversely proportional to the intensity of visible light (more light means lower voltage). This signal is connected to an A/D input pin. The potentiometer’s rotation can be read using an A/D input pin. 4 general-purpose LED’s are connected to four independent digital outputs (active high) for displaying status information, or perhaps a 4-bit binary value. We use these LED’s as a “VU meter” for displaying light level and sound level in our sample software below. Two general-purpose momentary-contact pushbuttons are connected to two independent digital inputs (active low). For battery-powered operation or self-contained installations, it can be a pain to power an Arduino and its shields. The Gadget Shield makes this a little easier by providing a two-pin screw terminal block for easily connecting wire leads from battery packs or other power supplies. This voltage connects to the Vin node on the Arduino (through a reverse-voltage-blocking diode -- see the schematic) so is the same as plugging in a DC power jack. Stacking headers let you stack another shield on top of the Gadget Shield, or you can plug wires right into each header socket for direct control over the on-board gadgets. What if you don’t want to use the microphone and want to reclaim analog pin A0 for something else? No problem! Every pin connection on the Gadget Shield goes through a cuttable jumper that is easily cut with a hobby knife. The Arduino pin is then disconnected from that pin’s gadget. You can then use the Arduino pin for something else by connecting to it through the stackable header. Changed your mind? Just short the jumper by soldering in a small wire, or solder in a two-pin 0.1” header and use a shunt to re-make the connection. More details below. Arduino LibraryThe Gadget Shield comes with an Arduino library to help you get started quickly.
Documentation for the library is in the GadgetShield.h header file, or see the sample code below for usage examples. Here’s a quick taste to show you how easy it is to work with the Gadget Shield. This sketch plays a tone on the speaker whenever pushbutton #1 is pressed.
/* Play a tone on the speaker whenever pushbutton #1 is pressed */ #include <GadgetShield.h> void setup(void) { GS.Setup(); } void loop(void) { if (GS.IsSwitch(0)) GS.Speaker(440); else GS.Speaker(0); } Sample CodeHere are some sample programs for demonstrating the applications of the Gadget Shield. These sketches are also included as part of the GadgetShield library described above.
The IR LED and detector are good for more than just remote control. Since they are both pointing in the same direction you can use them together as an object detector. Turn on the IR LED at 38 kHz, then if an object reflects the IR light back to the detector, you will be able to sense that the IR detector’s output is low. Download this sketch and try it out for yourself! Instructions are at the top of the file. PDE file: ObjectSensor.pde
The on-board speaker is good for playing simple tones and melodies. Here is an example of a full song, Rimsky-Korsakov’s “Flight of the Bumblebee”. PDE file: Melody.pde
This demonstrates the infrared logic detector and emitter by constructing a simple universal remote. Instructions are provided at the top of the PDE file. Once you teach the application what one or more buttons do on your remote, you can then either have the application recognize them when pressed again, or have the application output them on command. Use this application as a starting point for your own IR control applications. PDE File: UniversalRemote.pde
This fun application demonstrates how the 3-dimensional orientation of the Gadget Shield can be sensed using the on-board accelerometer. The orientation is used to control the color of the RGB LED module. PDE File: Accelerometer.pde
Display the ambient sound level using a 4-LED “VU meter”. The louder it is, the more LED’s light up. PDE File: Microphone.pde
Like the microphone volume meter above, this “light meter” illuminates more LED’s as the ambient light level goes up. PDE File: LightSensor.pde This application is what we use for production testing. It exercises every sensor and actuator on the Gadget Shield. Use it as an example for how to interface with all of the devices on the board. Instructions are at the top of the PDE file. PDE File: ProductionTest.pde Arduino MegaThe Arduino Mega and Mega2560 have the two TWI pins (SCL and SDA) in a different place than the Arduino Uno and Duemilanove. These two pins are needed for communicating with the accelerometer. To use the accelerometer with a Mega, you will need to connect two wires to jumper the SCL and SDA pins from the Mega header to the Gadget Shield header. There are two ways to do this, directly to the stacking header pins A4/A5 or to a special two-pin header location (JP1) which is also connected to A4/A5. The figures below show these possibilities.
Connect SDA/SCL on a Mega by directly connecting to header pins A4/A5 or Connect SDA/SCL on a Mega by connecting to a separate header JP1 If you are not using the accelerometer on the Gadget Shield then these two wire connections are not needed. Pin MappingThe pin usage of the various sensors and actuators on the Gadget Shield is shown in the following table.
Arduino Uno/Duemilanove and Ruggeduino Arduino Mega Connection Pin Function Special Pin Function Special Accelerometer SCL A5/PC5 TWI ADC5/ SCL PD1 TWI SDA Accelerometer SDA A4/PC4 TWI ADC4/SDA PD0 TWI SCL LED #4 A3/PC3 Digital Out ADC3 A3/PF3 Digital Out ADC3 Potentiometer A2/PC2 Analog In 0V-5V ADC2 A2/PF2 Analog In 0V-5V ADC2 Visible Light Sensor A1/PC1 Analog In 0V-5V ADC1 A1/PF1 Analog In 0V-5V ADC1 Microphone A0/PC0 Analog In 0V-5V ADC0 A0/PF0 Analog In 0V-5V ADC0 LED #3 D13/PB5 Digital Out Active High SCK D13/PB7 Digital Out Active High PWM OC0A/OC1C Pushbutton #1 D12/PB4 Digital In Active Low MISO D12/PB6 Digital In Active Low PWM OC1B LED #1 D11/PB3 Digital Out Active High MOSI/PWM OC2A D11/PB5 Digital Out Active High PWM OC1A RGB Blue LED D10/PB2 Digital Out Active High SSn/PWM OC1B D10/PB4 Digital Out Active High PWM OC2A Speaker D9/PB1 Digital Out Active High PWM OC1A D9/PH6 Digital Out Active High PWM OC2B Pushbutton #2 D8/PB0 Digital In Active Low ICP D8/PH5 Digital In Active Low PWM OC4C Accelerometer Interrupt Output D7/PD7 Digital In Active Low AIN1 D7/PH4 Digital In Active Low PWM OC4B RGB Green LED D6/PD6 Digital Out Active High AIN0/PWM OC0A D6/PH3 Digital Out Active High PWM OC4A RGB Red LED D5/PD5 Digital Out Active High PWM OC0B D5/PE3 Digital Out Active High AIN1/PWM OC3A LED #2 D4/PD4 Digital Out Active High D4/PG5 Digital Out Active High PWM OC0B IR Transmitter D3/PD3 Digital Out Active High PWM OC2B D3/PE5 Digital Out Active High PWM OC3C IR Receiver D2/PD2 Digital In Active Low INT0 D2/PE4 Digital In Active Low INT4/PWM OC3B Cuttable JumpersAll of the Arduino pins connect to the gadgets through cuttable jumpers on the bottom side of the board. Here is a picture of part of the board bottom:
You can also use the cuttable jumpers as cross-wiring points. Suppose you really don’t like the pin mapping we have chosen. You can use cuts and wires over our cuttable jumpers to create your own pin mapping. Here is a picture of the PCB layout on the bottom of the board showing where all cuttable jumpers are. The connector numbers (J1, J2, etc.) refer to the jumper names shown in the schematic.
External Power InputFor standalone or battery-powered operation, the two-pin terminal block allows you to make a sturdy connection to a battery or other power source, without having to insert wires into stacking headers and hope they stay put.
This power input is essentially the same as the DC power jack on the Arduino. Provide a DC power source of the same voltage and current that is required by your Arduino board (e.g., 7-12VDC for an Arduino Uno, at least 100mA is recommended). The power input is reverse-voltage protected by a diode, just like the DC power jack input on the Arduino. Power you apply to the two-pin terminal block is available at the Vin pin on the stacking headers. Technical DataHere is the schematic of the Gadget Shield. Here is the schematic of the previous revision (part number AS010).
The Gadget Shield was designed in the USA and is assembled in the USA using lead-free components and lead-free manufacturing and assembly processes. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Proudly located in Michigan, USA
|