wiki:ArduinoMtrGrove

Arduino with Motor and Grove Shield Tutorial Page

This page provides information for my Motor+Grove tutorial that fits better in the trac format.

As always, everything is correct to the best of my knowledge, but there might be mistakes, so please check on your own.

Contents Outline

Seeeduino Notes

Terms

DIODigital Input or Output (can be either)
INTInterrupt
PWMPulse Width Modulation
SPISerial Peripheral Interconnect
I2CInter-IC bus
VccDigital Supply Voltage
AvccAnalog Supply Voltage

Seeeduino Voltage Jumper: 3.3V or 5.0V

The Seeeduino's microcontroller can be set to run at either 3.3V or 5.0V using a switch; this includes both the digital supply voltage (called Vcc) and analog supply voltage (called Avcc).

Old electronics typically uses 5V, while many new chips use 3.3V (or even lower). You need to know what you will be connecting to the Seeeduino before you can decide what voltage to use:

  • Some 3.3V parts are 5V tolerant: you can safely apply 5V to their inputs, but the outputs will only provide 3.3V at the most. These parts need a 3.3V power supply.
  • However, some 3.3V parts will die if you apply 5V to their inputs.
  • Some 5V parts will reliably recognize 3.3V output signals, but it's not guaranteed.
  • Best of all, some parts will tolerate a wide voltage range, sometimes as wide as 3.0V to 5.5V.
  • NOTE: when the Seeeduino's supply voltage (Vcc/AVcc) is set to 3.3V, it is not 5V tolerant!

I believe that most older shields are 5V; however, some newer shields are 3.3V or can auto-detect (using the IOREF pin on Uno-compatible boards, but not available on the Seeeduino).

Pin Voltage Range (excluding Reset)

Absolute maximum values:

  • All pins except reset: -0.5V to Vcc + 0.5V
  • Avcc: Vcc - 0.3V to Vcc + 0.3V
  • ARef: 1.0V to Avcc
  • AIn: 0.0V to ARef

Digital Input Voltage

How low does the input voltage need to be for the Seeeduino read it as Low (Off) and how high does the input voltage have to be for the Seeeduino to read an input as High (On)? The rules are:

  • Low is -0.5V to 0.3 x Vcc
  • High is 0.6 x Vcc to Vcc + 0.5V

I think this in clearer in a table, with showing the values for a Seeeduino set to 3.3V and 5.0V:

VccLow MinimumLow Maximum High MinimumHigh Maximum
3.3V-0.5V1.0V 2.0V3.8V
5.0V-0.5V1.5V 3.0V5.5V

Digital Output Voltages

What will the output voltages be when the output is Low (Off) or High (On)?

With Vcc set to 5.0V and an output current of 20mA, the output will be:

  • less than 0.9V when Low
  • at least 4.2V when High

With Vcc set to 3.0V and an output current of 10mA, the output will be:

  • less than 0.6V when Low
  • at least 2.3V when High

Analog Input Values

  • Analog inputs are 0V -> Aref with 10-bit resolution. They can also be used as D14-D19.
  • Normally, the power supply is used as the reference. However, an external analog voltage can be used as the reference via the AREF pin.
  • For the Seeeduino V3, when 5V power is selected, the power voltage is supposed to be 5V, but can vary a bit, especially if the Seeeduino is USB powered. If actual voltage is 4.8V, then a reading of 1023 = 4.8V

Notes

  • AVR microcontroller limitations include
    • 40mA max current per pin (20mA recommended)
    • 100mA max per pin group (D0-D4; D5-D13; A0-A6)
    • 200mA max all pins
  • Seeeduino PWM frequency is about 500Hz, with 8-bits resolution

Some Seeeduino / Arduino Differences

The Seeeduino is very close to the Arduino Duemmilanove, but differences include:

  • The power supply voltage (Vcc) can be set to either 3.3V or 5.0V via a jumper (see discussion above for more details).
  • The shield pin-out is slightly different from both the Duemilanove and the Uno, because it adds A6 and A7 analog inputs (which are IOREF and N/C on the Uno).

Seeeduino Shield Pinout

Digital Connector

Pin NamePrimary UseAlternate Uses
D0DIOTTL Serial Rx
D1DIOTTL Serial Tx
D2DIOINT0
D3DIOINT1, PWM
D4DIO
D5DIOPWM
D6DIOPWM
D7DIO
D8DIO
D9DIOPWM
D10DIOSPI-SS, PWM
D11DIOSPI-MOSI, PWM
D12DIOSPI-MISO
D13DIOSPI-SCK, LED
GNDGround
AREF Analog Ref

NOTE: Arduino UNO shield has two additional pins for the I2C interface (SDA and SCL)

Analog Connector

Pin NamePrimary UseAlternate Uses
A5AINI2C-SCL
A4AINI2C-SDA
A3AIN
A2AIN
A1AIN
A0AIN

Power Connector

NOTE: Last two pins are different between the Seeeduino and the Uno

Pin NameSeeeduinoArduino UNO
VinVinVin
GNDGroundGround
5V5V5V
3.3V3.3V3.3V
RESETResetReset
A6 AINIOREF
A7 AINNot connected

Arduino Motor Shield R3

Motor Pin Usage

FunctionChannel AChannel B
DirectionD12D13
PWM (Speed)D3D11
BrakeD9D8
Current SenseA0A1

TinkerKit Pin Usage

TypeConnectorPin
AINWhite 3-pinA2
AINWhite 3-pinA3
PWMOrange 3-pinD5
PWMOrange 3-pinD6
I2CWhite 4-pinTWI In
I2CWhite 4-pinTWI Out

Grove Base Shield V1.3

Digital Connector Pin Mapping

Grove Connector NameGrove Pin 1Grove Pin 2Grove Pin 3Grove Pin 4
UARTD0D1VccGND
D2D2D3VccGND
D3D3D4VccGND
D4D4D5VccGND
D5D5D6VccGND
D6D6D7VccGND
D7D7D8VccGND
D8D8D9VccGND

Analog Connector Pin Mapping

Grove Connector NameGrove Pin 1Grove Pin 2Grove Pin 3Grove Pin 4
A0A0A1VccGND
A1A1A2VccGND
A2A2A3VccGND
A3A3A4VccGND

I2C Connector Pin Mapping

All 4 I2C connectors share the same pin mapping, but the addresses will differ (since I2C is a bus).

NOTE:If either A4 or A5 is used, none of the I2C connectors can be used (since A4/A5 are also used for the I2C SDA/SCL pins).

Grove PinShield Pin
1SCL / A5
2SDA / A4
3Vcc
4GND

Where Seeeduino Shield Pins Appear With Motor And Grove Shields

Shield PinPin FunctionsOn SeeduinoOn Motor ShieldOn Grove ShieldOn Grove Shield
D0DIO, Serial RxTo FTDI FT232R chip, 10-pin FTDI Header UART Conn
D1DIO, Serial TxTo FTDI FT232R chip, 10-pin FTDI Header UART
D2DIO, INT0 D2 Conn
D3DIO, INT1, PWM Motor A SpeedD2 ConnD3 Conn
D4DIO D3 ConnD4 Conn
D5DIO, PWM TinkerKit PWMD4 ConnD5 Conn
D6DIO, PWM TinkerKit PWMD5 ConnD6 Conn
D7DIO D6 ConnD7 Conn
D8DIO Motor B BrakeD7 ConnD8 Conn
D9DIO, PWM Botor A BrakeD8 Conn
D10DIO, SPI-SS, PWM
D11DIO, SPI-MOSI, PWM Motor B Speed
D12DIO, SPI-MISO Motor A Dir
D13DIO, SPI-SCKLED 'L'Motor B Dir
A5AIN, I2C-SCL TinkerKit TWI In, OutI2C Conn 1,2,3,4
A4AIN, I2C-SDA TinkerKit TWI In, OutA3 ConnI2C Conn 1,2,3,4
A3AIN TinkerKit AINA2 ConnA3 Conn
A2AIN TinkerKit AINA1 ConnA2 Conn
A1AIN Motor B Curr SenseA0 ConnA1 Conn
A0AIN Motor A Curr SenseA0 Conn

My Pin Mapping

Digital Connector

Pin NamePin UseMotor ShieldGrove Shield
D0Not Used
D1Not Used
D2Digital Input Grove Button
D3PWM OutputMotor A Speed
D4Digital Output Grove LED
D5Digital Output, Input Grove Ultrasonic Ranger
D6Not Used
D7Not Used
D8Digital OutputMotor B Brake
D9Digital OutputMotor A Brake
D10Not Used
D11PWM OutputMotor B Speed
D12Digital OutputMotor A Dir
D13Digital OutputMotor B Dir

Analog Connector

Pin NamePin UseMotor ShieldGrove Shield
A5I2C-SCL Grove OLED
A4I2C-SDA Grove OLED
A3AIN Grove Joystick
A2AIN Grove Joystick
A1AINMotor B Current
A0AINMotor A Current
Last modified 2 years ago Last modified on Feb 14, 2015 6:23:18 PM