1.3 RobotGeek Sensor Shield & Wiring Primer

wiring.jpg

Contents:

About This Guide

This guide is designed to cover the basic foundations of wiring with the RobotGeek Sensor System. You will learn about the 3-Pin S-V-G system, what the 4-Pin groups are for, special cables, Digital/Analog Input/Output, Servos, Power, and Reserved Pins. This guide is more of a reference of tips and tricks than a tutorial, meaning that we won't be building a specific project here. Rather, we will be showing the ways you can wire any number of RobotGeek System based projects. With such a versatile system, there is a lot you can do, so let's get to it!

Installing the Sensor Shield on a Geekduino

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_stack1.jpg
stack1.jpg geekmount-pins-note.jpg geekmount-iso-3.jpg
  1. The Geekduino has the option to run at 3.3V as well as the standard 5V. Before you attach the Sensor Shield, make sure your Geekduino's switches are set appropriately. Unless otherwise noted, these should be set to '5V' and 'AUTO'.
  2. Now slot the bottom Pins of the RobotGeek Sensor Shield into the terminals in the top of the Geekduino. Note how the boards seat evenly on top of each other, and the Pins line up exactly. Be careful not to bend the Pins.

Back to Contents

The 3-Pin system (S/V/G)

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_pins-svg.jpg
pins-svg.jpg

The RobotGeek System is centered around the use of the RobotGeek Sensor Shield with Input or Output Devices. Sensor Shield seats on an Arduino Compatible board, such as the Geekduino, and breaks out the Pins into clearly labeled groups for ease of use. Each group is a column of Pins, 3-Pins to a row, labeled to let you know the number of the Pin, and whether the Pin is Analog, Digital, or PWM.

At the top of the board, each column is labeled with the letters S-V-G. You will also see these letters in order on RobotGeek Input/Output devices.

S - Signal refers to a Pin that conveys information. This information can be analog, such as the position of a potentiometer, or digital, such as the on/off state of a push button. The data on this Pin can be passed either to or from the board, depending on whether the Sensor attached is an input or output device. This wire will always be white in color as part of the standardized RobotGeek system, though it can really be any color elsewhere (most commonly yellow and orange in 3rd party devices).

V - Voltage (often signified with a + plus symbol) refers to the Pin that provides power to a component in your system. With the RobotGeek system, this is typically 5 volts. Later in this guide there will be examples of times when the 5v provided through the on-board regulator is not enough, and what to do in that situation. For now, the understanding that the red wire is your positive wire is good.

G - Ground (often signified with a – minus symbol) refers to a Pin that is necessary to power a component. Any component that is hooked to Voltage will eventually terminate to Ground. This wire is standardized black in color in the RobotGeek system.

Back to Contents

Using 3-Pin Sensor Cables

b_400_400_16777215_00__images_tutorials_RG101_primer_wirethruhole1.jpg
wirethruhole1.jpg wire-frayed.jpg wirethruhole2.jpg sensorcables-3.jpg sensorcables-mess.jpg notes.jpg

Because each individual pin has its own function, it is important that you mind your wiring. We've made it as easy as possible, but there is still room for error, and improper wiring can cause your devices to fail permanently.

  1. Feed your sensor cable carefully up through the bottom of your workbench through one of the rectangular holes. Try not to scrape it on the edges of the hole, as they are sharp enough to remove the insolator off of your wire, leaving the conductive portion exposed.
  2. Plug your sensor cable into your device, White wire to S-Signal, Red wire to V-Voltage, and Black wire to G-Ground. Mixing any of these up can cause permanent damage to your device when connected to power.
  3. Feed the opposite end of the cable back up through the workbench near the Geekduino. Plug in your cable, minding the S-V-G at the top of the Sensor Shield. It is also important that if you have a wiring diagram to work off of that you check it for the exact I/O pin your device should be on.
  4. After you've run quite a few cables this way, the bottom of your workbench will look like a rat's nest. This is normal, but can cause confusion if you want to change your wiring later. Labeling your cables with the name of the device they are plugged into with a small piece of tape, or writing down which devices are plugged into which ports can mitigate this effect.

Back to Contents

The 4-pin system - I2C and Serial Communication

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_pins-i2cuart1.jpg
pins-i2cuart1.jpg

At the bottom of the Sensor Shield, there are two sets of 4 Pins marked I2C and UART. These Pins allow different methods of Serial communication with the microprocessor. They are very useful for using advanced Devices in your project without having to reinvent the wheel.


Typical examples of I2C Devices are:
Typical examples of UART Devices are:

Back to Contents

Digital Ouput

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_pins-digitaA.jpg
pins-digitaA.jpg rg-leddriver-b.jpg rg-buzzer-a.jpg rg-relay-a.jpg

The Digital Pins are easy to understand. They function in only two states, ON or OFF (also referred to as HIGH or LOW). A HIGH signal is equal to 5 Volts. A LOW signal is equal to 0 Volts. Digital Output Devices respond to HIGH or LOW signals from the microprocessor. LEDs, Buzzers, and Relays are the most common examples of digital output devices.

Technically, every Pin on the board is a Digital Output Pin. The PWM Pins have special function that we will cover in another section, and Analog Input Pins 0-7 can act as Digital I/O Pins 14-21. This distinction is resolved by the microprocessor via code.

Back to Contents

Digital Input

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_pins-digitaA.jpg
pins-digitaA.jpg pushbutton-5.jpg

Just like Digital Output Devices, Digital Input Devices function in one of two states, ON or OFF. A HIGH signal is equal to 5 Volts. A LOW signal is equal to 0 Volts. A Digital Input Device is a Device that sends a HIGH or LOW signal to the microprocessor. RobotGeek Push Buttons are excellent examples of digital input devices.

Technically, every Pin on the board is a Digital Input Pin. The PWM Pins have special function that we will cover in another section, and Analog Input Pins 0-7 can act as Digital I/O Pins 14-21. This distinction is resolved by the microprocessor via code.

Back to Contents

Analog Input

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_pins-analog.jpg
pins-analog.jpg rg-rotknob-a.jpg rg-slider-a.jpg rg-joystick-a.jpg

Analog Input Devices function differently than Digital Input Devices. Instead of simply sending a HIGH or LOW signal, Analog Devices read a voltage between 0-5 Volts, which is translated to a 10 bit number (between 0-1023) by the microprocessor. This is useful for incremental control of a Device. The most notable Analog Input Devices are, Potentiometers, Sliders, Joysticks, and Force Sensitive Resistors.

Back to Contents

PWM / Analog Output

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_pins-pwmA.jpg
pins-pwmA.jpg rg-leddriver-b.jpg

Analog Output is a little bit trickier than Digital Output. Analog Devices need more than just an on or off state. This is where the PWM (Pulse Width Modulation) Pins come in. Using PWM, we can send a wide range of voltages to an Analog Device, allowing smooth control. An LED slowly fading in and out is a good example of this.

Back to Contents

Servos

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_servos1.jpg
servos1.jpg servos2.jpg servos3.jpg pins-pwmA.jpg

Servos are well known for using PWM for their control signal. This is used in a couple different ways, depending on the gearing of the servo. 180° Servos use the signal for their position, and Continuous Rotation Servos use it for their speed. Servos are plugged into the RobotGeek Sensor Shield the same way as any PWM Device. Servos come in many shapes and sizes (such as Plastic and Metal Gear Micro Servos!), and each of them has something a little different to offer. Make sure you are plugging your servos in correctly, as the wires have a slightly different coloring scheme.

Back to Contents

Jumpers/Power

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_power1.jpg
power1.jpg powerA.jpg

Most servos don't receive enough power from the Arduino to function properly. Notice that there are two jumpers in the center of the PWM column on your Sensor Shield. They are likely set to 5V. These give the servos another option for the Power Pin, namely VIN (Voltage In). Setting a jumper to VIN will pull power for the servos directly from the power supply, allowing you to use servos to their full potential.

In the example images, the top PWM Pins are set to 5V, which is suitable for any arduino compatible Device. The lower Pins are set to VIN, which works great for servos. Be warned, connecting Devices on Pins set to VIN can cause damage to the Devices if they are not designed to operate at higher voltages. Virtually all non-servo Devices are designed to run off of the 5V provided by a standard Arduino regulator. Pay attention to your jumpers to avoid damaging your Devices!

Back to Contents

Special Pins

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_pins-specia1.jpg
pins-specia1.jpg pins-accessory.jpg

Some Pins on the Sensor Shield operate a little differently than others. It is recommended that you avoid using these Pins unless you have to, because there is a chance their functions will interfere with the operation of your project. RobotGeek Kits are designed to work around this, and will include special instructions regarding these Pins when necessary. You won't need to know what they do to start building, but it's good to know what they do.

Pin Description Notes
DIO-0 RX (Receive Pin) Devices on the Hardware Serial pins need be removed during programming the Geekduino/Arduino. These pins cannot be used if you are using the UART 4-pin port, for example if you are using an XBee module.
DIO-1 TX (Transmit Pin)
DIO-2 Interrupt Pin External Interrupt pins are an advanced feature of the Arduino. Using these pins for not-interrupt purpose will not cause you any problems, but you may need to move your pins around if you need interrupt pins later
DIO-3 Interrupt Pin
AIO-4 I2C SDA (Data Line for I2C) You cannot use these 2 pins if you are using I2C peripherals / the I2C 4-pin port. These pins are needed for I2C Communications and will not function as analog inputs if I2C is being used. NOTE: If wired correctly with 4-pin squid cables, you can use these ports as a secondary I2C port.
AIO-5 I2C SCL (Clock Line for I2C)
DIO-13 Built in Resistor, Attached to onboard LED Pin 13 has a built in Resistor and LED on the Geekduino and most Arduino boards. This may interfere with some advanced I/O boards. Typically it works just fine as an output board.

Also worth noting are the Accessory Power Pins running alongside the board. These are useful for manually providing power to specific Devices that don't follow the 3-Pin convention.

Back to Contents

Squid and Adapter Cables

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_squid-3pin.jpg
squid-3pin.jpg squid-4pin.jpg squid-grove.jpg

Some Devices just don't fit the standard RobotGeek 3-Pin layout (S-V-G). We offer 3-Pin Sensor Squid Cables which split off into individual jumpers, allowing you to attach a 3-Pin Devices that follow a different convention. For 4-Pin Devices, such as UART or I2C, 4-Pin Sensor Squid Cables are available.

In a few of our projects, we use Grove Devices. Grove uses a slightly different wiring setup, requiring specific 4-Pin wires. In most cases, only 3 of those wires are used, and these Devices are fully compatible with the RobotGeek 3-Pin layout. Due to the functionality and popularity of Grove Devices, we offer Grove to 3-Pin Adapters as well as Grove to 4-Pin Adapters. You'll notice that the wire colors are Black, Red, and Yellow, rather than Black, Red, and White. Black and Red are Ground and Voltage, respectively. Yellow is the Signal wire.

Back to Contents

Grove Module Wiring

b_400_400_16777215_00__images_tutorials_robotGeek_wiring_grovewire1.jpg
grovewire1.jpg grovewireA.jpg grovewireB.jpg grovewireC.jpg grovewire2.jpg

Grove Modules all use a 4 pin connector, but they use that connector in different ways depending on what components are on the board. Some grove modules only use 3 of the 4 available pins for Signal, Voltage, and Ground, and are easily hooked directly with a grove to sensor shield adapter cable. Others use all 4 pins, and are still fairly easy to attach to a sensor shield over I2C or Serial, depending on which module you're working with. There are some special devices which use the 4 pins very differently, and require a Y-Cable to split off to two separate Digital Input/Output Ports. In the example, we have shown a 4-Digit Display that uses the Y-Cable to split off to a DIO port for Signal, and another port for Clock.

Back to Contents

Programming Reference

Now that you've completed Setting up your Geekduino, learning about Mounting Hardware, and tackled the Sensor Shield and Wiring, you're ready to go onto the next topic : 2.1 Serial Communication .

If you are interested in learning more in-depth about programming your Arduino, or would like to brush up on the basics, check out our Coding Primer. In this lesson we will look at programming concepts.

Feedback Form


Search