seeed studio Grove Series User manual

Grove
Starter
Kit for
LaunchPad
About Grove
Grove is a modular, ready-to-use tool set that takes a building block approach to assembling
electronics. The Grove system consists of a base shield and a large selection of modules that
feature standardized connectors. The base shield allows for easy connection of popular
microcontroller devices to interface with the various Grove modules. Each Grove module
addresses a unique function & the overall collection of modules expand a wide range of
functionality - from a simple push-button to a complex heart rate sensor. Each one comes with
clear documentation and demo code to help you get started quickly.
About LaunchPad and BoosterPack
The Texas Instruments LaunchPad ecosystem is a set of low-cost & easy-to-use microcontroller
development kits that enable developers to rapidly prototype with modular, open source
hardware based on TI silicon. BoosterPacks are plug-in modules that can stack on top of the
various LaunchPad kits to add additional functionality, such as sensors, displays, wireless
modules & more.The Grove Base BoosterPack is a welcome addition to the
LaunchPad/BoosterPack ecosystem, enabling any LaunchPad to interface with the growing
offering of Grove modules from Seeed Studio. The Grove Base BoosterPack offers a
convenient and easy way for rapid prototypers to use more than one hundred Grove modules
with standardized connectors, including sensors, actuators, displays, lights, motors and more.
http://www.ti.com/launchpad
About Seeed Studio
Seeed is a hardware innovation platform for makers to grow inspirations into
differentiated products. Seeed provides accessible technologies with quality, speed
and supply chain knowledge. Seeed helps productize 1 to 1,000 pieces using in-house
engineering, supply chain management and agile manufacture forces. Seeed also
teams up with incubators, China tech ecosystem, investors and distribution channels to
portal Maker startups beyond. http://www.seeedstudio.com/depot/
About Texas Instruments
Texas Instruments Incorporated (TI) is a global semiconductor design and manufacturing
company that develops analog ICs and embedded processors. By employing the world's
brightest minds, TI creates innovations that shape the future of technology. TI is helping more
than 100,000 customers innovate with 80000+ analog ICs & embedded processors, software &
the industry’s largest sales/support staff. http://www.ti.com

Have Questions?
If you encounter any problem, please refer to the following websites for resources & help.
For all the Grove resources for LaunchPad
www.seeed.cc/s/boosterpack
For the details of Grove system
http://www.seeedstudio.com/wiki/GROVE_System
For tech support for your Grove Base BoosterPack or Starter Kit
http://support.seeedstudio.com
For all the details and support of TI LaunchPad development kits
http://www.ti.com/launchpad
For all details around the Energia software
http://www.energia.nu
For community support, check out http://www.43oh.com
NOTE
This kit is fully compatible with the BoosterPack pin out standard, which is documented here:
http://www.ti.com/byob
Most of the LaunchPad development kits from Texas Instruments adhere to this pinout standard
enabling support for the Grove Base BoosterPack. The following examples were developed for
the MSP-EXP430F5529LP LaunchPad, which features a 40 pin BoosterPack connector.
However any 40 pin LaunchPad with Energia support can leverage these tutorials as well. If you
are using a 20 pin LaunchPad (i.e. MSP-EXP430G2), jumpers can be used to route the
appropriate pins to the various Grove connectors on the Grove Base BoosterPack.
To ensure compatibility, we recommend that you check the BoosterPack and software pin
configurations for your specific LaunchPad kit.
If you are using different LaunchPads, please refer to http://energia.nu/ for additional information.
You can find the various pin mapping diagrams at: http://energia.nu/guide/pinmapping/

TABLE OF CONTENTS
LEARN MORE ABOUT THE PRODUCT X
Getting to know the Grove Base BoosterPack X
Using the Grove Base BoosterPack X
Brief overview of the included Grove modules X
Installing the Energia Development Environment X
SETTING UP THE ENERGIA IDE X
(1) Launch Energia X
(2) Selecting the Serial Port X
(3) Selecting your Board X
(4) Preparing Libraries X
THE EXAMPLES X
(1) Getting Started (Blinking LED) X
(2) Playing Music (Buzzer) X
(3) Controlling Other Electronics (Relay) X
(4) Displaying the Numbers (4-Digit Display) X
(5) Reading the Potentiometer (Rotary Angle Sensor) X
(6) Sensing the Light (Light Sensor) X
(7) Turning on an LED by Sound (Sound Sensor) X
(8) Is Anybody Here? (PIR Motion Sensor) X
(9) Taking Care of Your Plants (Moisture Sensor) X
(10) Sensing Distance (Ultrasonic Ranger Sensor) X
(11) Feeling the Environment (Temperature Humidity Sensor) X
Advanced Projects X
-------------------------
批注 [1]: Add a section on CCS Cloud?

LEARN MORE ABOUT THE PRODUCT
Getting to know the Grove Base BoosterPack
Below is an overview of the Grove Base BoosterPack. The BoosterPack is organized into 3
types of connectors - Digital, Analog & Serial. Depending on the Grove module you want to
interface with, you need to ensure you plug it into the appropriate connector type. The
BoosterPack has been designed to adhere to the BoosterPack pin out standard so by plugging
a Grove module into one of the connectors, the signals will be routed to the appropriate pins of
the BoosterPack connector.
Also, notice that the Grove connector has support for 2 signal pins. However, many of the
modules only require 1 signal pin (typically SIG0). In that case, SIG1 is a no connect (NC).
Since most Grove connectors typically only need 1 pin, the Grove connectors on the Grove
Base BoosterPack duplicate some pins of the BoosterPack connector. If you are using a Grove
module that needs both signal pins (i.e. a dual-axis joystick -- X axis = SIG1, Y axis = SIG0),
you should avoid using the adjacent connector since the repeated pin is taken up by the 2-axis
joystick Grove module. This is called a pin conflict, which will cause problems.

批注 [2]: Add a zoomed in shot to show how the pins at
the Grove module are the same as those on the BP
connector!


Using the Grove Base BoosterPack
Using a 40-pin LaunchPad (i.e. MSP-EXP430F5529LP, MSP-EXP432P401R, EK-
TM4C123GXL, etc) Recommended
The Grove Base BoosterPack was designed in a way to leverage pin numbers 21 through 40.
Visually, these are the inner 20 pins of the BoosterPack connector. The pins are connected as
shown in the table below:
Using the table below, developers should be able to read an analog value from a Grove module
(i.e. potentiometer/turn knob) that is connected to Grove connector ‘J6’ by using the
analogRead(24) API call with Energia.
Connector
Type
Grove
connector
Label
GND
VCC
SIG1 (connection to the
BoosterPack pin)
SIG0 (connection to the
BoosterPack pin) *
Analog
J5
GND
3.3V
23 (analog capable pin)
22 (analog capable pin)
Analog
J6
GND
3.3V
25 (analog capable pin)
24 (analog capable pin)
Analog
J7
GND
3.3V
26 (analog capable pin)
25 (analog capable pin)
Analog
J8
GND
3.3V
27 (analog capable pin)
26 (analog capable pin)
Analog
J9
GND
3.3V
28 (analog capable pin)
27 (analog capable pin)
I2C
J10
GND
3.3V
10 (I2C SDA)
9 (I2C SCL)
UART
J11
GND
3.3V
4 (UART to MCU)
3 (UART from MCU)
SPI
J12
GND
3.3V
14 (SPI MISO)
7 (SPI CLK)
Digital
J13
GND
3.3V
39 (Digital/PWM pin)
40 (Digital/PWM pin)
Digital
J14
GND
3.3V
38 (Digital/PWM pin)
39 (Digital/PWM pin)
Digital
J15
GND
3.3V
37 (Digital/PWM pin)
38 (Digital/PWM pin)
Digital
J16
GND
3.3V
36 (Digital/PWM pin)
37 (Digital/PWM pin)
Digital
J17
GND
3.3V
35 (Digital/PWM pin)
36 (Digital/PWM pin)
Using a 20-pin LaunchPad (i.e., MSP-EXP430G2, MSP-EXP430FR5969, MSP-
EXP430FR4133, etc)
If you are using a 20-pin LaunchPad, you can use jumpers or jumper wire to make the
appropriate connections between a Grove connector & the BoosterPack connector.

Using your specific LaunchPad’s pin out diagram, you can physically/electrically connect the
Grove module to the appropriate pin. Pinout diagrams for each LaunchPad are available here:
http://energia.nu/pin-maps/
With the help of these pin diagrams, you know which pin has the function you need. If you want
to use Grove connector J8 for an analog Grove module (i.e. potentiometer knob), you can use
the Energia pin maps to identify an analog-capable pin on the BoosterPack connector. Using a
jumper or jumper wire, you can connect pin number 26 with the analog-capable pin that is
available. For example, if you are using an MSP-EXP430G2 LaunchPad, you can use a jumper
or jumper wire to connect pin 26 with pin 6.
[Add a picture here to show jumper/wire making the above connection]
批注 [3]: PICTURE!

overview of the included Grove modules
DIGITAL MODULES
The Grove-Buzzer
What is it?
The Grove Buzzer module features a piezo buzzer that can be connected to digital outputs. It
will emit a tone when the output is high. Alternatively it can be connected to a pulse-width
modulation (PWM) capable output pin to generate various tones and sounds.
How to connect it?
This is a Digital module that should connect to a digital or PWM-capable pin (i.e. Grove
connector J13 - J17)
How to program it?
In Energia, you can use either the digitalWrite(pin, state) API to buzz the piezo at a fixed tone.
Or, you can use the analogWrite(pin, dutyCycle) or tone(pin, frequency, duration) function if you
want to modulate a specific frequency or tone.
More details:
http://www.seeedstudio.com/depot/Grove-Buzzer-p-768.html
The Grove-Relay
What is it?
The Relay is a digital normally- open switch that controls a relay capable of switching much
higher voltages and currents than your normal LaunchPad boards. When set to HIGH, the on-
board LED on the Grove-Relay module will light up and the relay will close to allow current to
flow. The peak voltage capability is 250V at 10 amps.
How to connect it?
This is a Digital module that should connect to a digital pin (i.e. Grove connector J13 - J17)
How to program it?
In Energia, you can use the digitalWrite(pin, state) API to close the relay.
More details:
http://www.seeedstudio.com/depot/Grove-Relay-p-769.html
The Grove-PIR Motion Sensor
What is it?
批注 [4]: For each module, should we have a small
diagram highlighting the appropriate grove connector?
批注 [5]: Vanity/alias URL
批注 [6]: Applies to all module overviews

When any motion occurs within the detection range (3m by default), the sensor outputs a HIGH
signal on its SIG0 pin.
How to connect it?
This is a digital module that should connect to a digital pin (i.e. Grove connector J13 - J17). This
requires just a single signal pin, SIG0.
How to program it?
In Energia, you should be able to use the digitalRead(pin) API. This function will return back the
state of the incoming signal from the motion sensor. If motion was detected, this function will
return a 1, else 0.
More details:
http://www.seeedstudio.com/depot/Grove-PIR-Motion-Sensor-p-802.html?cPath=25_31
The Grove-4-Digit Display
What is it?
The 4-Digit 7-segment display module usually takes 12 pins to control, but in this Grove module,
a TM1637 was used to allow us to control the display with only two pins. In addition to
displaying data using these two pins we can even change the brightness of the display. For
projects that require a numeric display this board would be an excellent choice!
How to connect it?
This is a digital module that requires 2 digital pins (i.e. Grove connector J13 - J17). This requires
both SIG1 and SIG0 (one clock pin & one data pin)
How to program it?
In Energia, you will need the Grove 4-Digit Display (DigitalTube) library. This library is available
in the Grove wiki, which is linked below. Along with the library are a few example sketches that
showcase how to use the library to display characters on the display.
If the library is installed in Energia, you can find it at:
File > Examples > Libraries > DigitalTube > [Examples]
More details:
http://www.seeedstudio.com/depot/Grove-4Digit-Display-p-1198.html?cPath=34_787
The Grove-Ultrasonic Ranger Sensor

What is it?
This Grove-ultrasonic sensor is a non-contact distance measurement module. This sensor
offers industrial performance & provides a detecting range of 3cm to 4 meters (~1cm of
resolution). It features a transmitter & receiver. The module transmits ultrasonic waves that
reflect off the nearest object & the receiver detects the “echo”. The time it takes for the receiver
to see the reflected signal is how we can detect distance.
How to connect it?
This is a digital module that should connect to a digital pin (i.e. Grove connector J13 - J17). This
requires just a single signal pin, SIG0.
How to program it?
In Energia, you will need the Grove-Ultrasonic Ranger Sensor library. This library is available in
the Grove wiki, which is linked below. Along with the library are a few example sketches that
showcase how to use the library to display the distance on the display (in either cm or inches).
If the library is installed in Energia, you can find it at:
File > Examples > Libraries > UltrasonicRanger > [Examples]
More details:
http://www.seeedstudio.com/depot/BackorderGroveUltrasonic-Ranger-p-960.html?cPath=25_31
ANALOG MODULES
The Grove-Light Sensor
What is it?
The Light sensor module detects the light intensity of the environment. This is an analog Grove
module that will return a voltage between 0V and 3.3V. The brighter the environment, the higher
the output voltage.
How to connect it?
This is an analog module that should connect to an analog pin (i.e. Grove connector J5 - J9).
This requires just a single signal pin, SIG0.
How to program it?
In Energia, you will be able to use the analogRead(pin) API. This function will return back the
raw analog readings coming from the sensor. Depending on the resolution of the LaunchPad
ADC channels, the API will return a number between 0-255 (8-bit ADC), 0 - 1024 (10-bit ADC),
or 0 - 4095 (12-bit ADC).
More details:
http://www.seeedstudio.com/depot/Grove-Light-Sensor-p-746.html?cPath=25_27
批注 [7]: File path should be:
file>sketchbook>launchpad kit>grove
modules>ultrasonic ranger

The Grove-Sound Sensor
What is it?
The Sound sensor module is a simple microphone. It can be used to determine the acoustic
noise level of the environment. The resistance of the sensor decreases when the sound
intensity of the environment increases. The value of output can be adjusted by the
potentiometer knob on the Grove-Sound Sensor module.
How to connect it?
This is an analog module that should connect to an analog pin (i.e. Grove connector J5 - J9).
This requires just a single signal pin, SIG0.
How to program it?
In Energia, you should be able to use the analogRead(pin) API. This function will return back
the raw analog readings coming from the sensor. Depending on the resolution of the
LaunchPad ADC channels, the API will return a number between 0-255 (8-bit ADC), 0 - 1024
(10-bit ADC), or 0 - 4095 (12-bit ADC).
More details:
http://www.seeedstudio.com/depot/Grove-Sound-Sensor-p-752.html
The Grove-Moisture Sensor
What is it?
This Moisture Sensor can be used to detect the moisture of soil or judge if there is water around
the sensor. The Moisture Sensor is very user-friendly: just insert it into the soil and then read the
data. Thanks to this sensor, you can easily see when your house plant is thirsty! Perhaps you
can have LaunchPad print out a message if moisture levels are too low: “Hey, I am thirsty now!
Please give me some water.”
How to connect it?
This is an analog module that should connect to an analog pin (i.e. Grove connector J5 - J9).
This requires just a single signal pin, SIG0.
How to program it?
In Energia, you should be able to use the analogRead(pin) API. This function will return back
the raw analog readings coming from the sensor. Depending on the resolution of the
LaunchPad ADC channels, the API will return a number between 0-255 (8-bit ADC), 0 - 1024
(10-bit ADC), or 0 - 4095 (12-bit ADC).
More details:
http://www.seeedstudio.com/depot/Grove-PIR-Motion-Sensor-p-802.html?cPath=25_31

The Grove-Temperature Humidity Sensor
What is it?
This module is an accurate temperature and humidity sensor. It consists of a capacitive
sensor element used for measuring relative humidity and a negative temperature coefficient
(NTC) thermistor used for measuring temperature.
How to connect it?
This is an analog module that should connect to an analog pin (i.e. Grove connector J5 - J9).
This requires just a single signal pin, SIG0.
How to program it?
In Energia, you will need the Grove-Temperature and Humidity Sensor library. This library is
available in the Grove wiki, which is linked below. Along with the library are a few example
sketches that showcase how to use the library to display the temperature & humidity readings.
Note that the sensor on this module is the DHT22.
NOTE: Since several DHT devices share this library, be sure to comment/uncomment the
appropriate sensor within the library.
If the library is installed in Energia, you can find it at:
File > Examples > Libraries > Humidity_Temperature_Sensor > [Examples]
More details:
http://www.seeedstudio.com/depot/Grove-TemperaureHumidity-Sensor-Pro-p-
838.html?cPath=25_125
The Grove-Rotary Angle Sensor
What is it?
The potentiometer module produces an analog output between 0 and Vcc on SIG0. The angular
range is 300 degrees with a linear change in the output voltage. This may also be known as a
rotary angle sensor.
How to connect it?
This is an analog module that should connect to an analog pin (i.e. Grove connector J5 - J9).
This requires just a single signal pin, SIG0.
How to program it?
In Energia, you should be able to use the analogRead(pin) API. This function will return back
the raw analog readings coming from the sensor. Depending on the resolution of the
LaunchPad ADC channels, the API will return a number between 0-255 (8-bit ADC), 0 - 1024
(10-bit ADC), or 0 - 4095 (12-bit ADC).
More details:

Installing the Energia IDE
Installing Energia
Energia is an open-source and community-driven development environment for LaunchPad kits.
It is based on the popular Wiring framework, offering a large collection of easy-to-use functions
and APIs. Energia support is available for many LaunchPad development kits across various TI
microcontroller devices: MSP430/MSP432, TM4C, C2000, and CC3200.
Note that Energia is available for Windows, Linux & Mac. The link above explains how to install
the required drivers & Energia on these various OS options. Once downloaded & installed, you
will need to configure Energia for the specific LaunchPad you are using.
Quick Overview of the Energia IDE

SETTING UP THE ENERGIA IDE
(1) Launch Energia
Once installed, go ahead and plug in your LaunchPad into the USB port of your computer. Then,
double-click Energia.exe (Windows users) / Energia.app (Mac OS X users). Energia will start
and an empty Sketch window will appear.
(2) Selecting the Serial Port
Select Serial Port from the Tools menu to view the available serial ports. On windows,
they will be listed as COMXXX port and usually a higher number is the LaunchPad com
port. On Mac OS X they will be listed as /dev/cu.uart-XXXX. On Mac OS X make sure to select
the /dev/cu.uart-XXXX and NOT the /dev/tty.uart-XXX. If needed, check your computer’s device
manager to verify which port to use.
Navigate to Tools > Serial Port [select your serial port]
(3) Select your board

Also, ensure that Energia is configured for the specific LaunchPad device you are using.
You can do so by navigating to Tools > Board > [select your LaunchPad]
(4) Preparing Libraries
Go to https://github.com/Seeed-Studio/LaunchPad_Kit http://www.energia.nu/grovekitcode
and download the latest zip file. This zip file includes example sketches & required libraries for
each of the Grove modules in the Starter Kit. Unzip the zip file, and then copy the contents into
the generic Energia folder on your computer.
●In Windows, you can unzip contents into this folder: [USERDIR] >My Documents >
Energia
●In Mac, you can unzip contents into this folder: /Users/USERDIR]/Documents/Energia.
●In Linux, you can unzip contents into this folder: /home/[USERDIR]/sketchbook
Here is how it should look in your directory:
批注 [8]: Add vanity URL/alias & host a zip file on
Energia site or Seeed site.

Once you have the folder structure as shown above, you may have to restart Energia in order
for the IDE to discover these new examples/libraries.
Note that these libraries and example projects are open source and available on github:
https://github.com/Seeed-Studio/LaunchPad_Kit
THE EXAMPLES

Example - 01 : Getting Started (Blinking LED)
WHAT ARE WE DOING HERE?
In this example, we will not be using any Grove modules. First, we’ll learn how to blink one of
the on-board LEDs that are featured on the LaunchPad development kit itself. All LaunchPad
kits feature a few user LEDs, typically a red LED. By running the example code, you will see the
LED switched on and off once per second.
THE CIRCUIT
We used the on-board red LED that is available on most LaunchPad kits. You don’t need to add
any other components.
CODE
This example is available here: File > Example > Basics > Blink
/*
Blink
The basic Energia example.
Turns on an LED on for one second, then off for one second, repeatedly.
Change the LED define to blink other LEDs.
Hardware Required:
* LaunchPad with an LED
This example code is in the public domain.
*/
// most launchpads have a red LED
#define LED RED_LED
//see pins_energia.h for more LED definitions
//#define LED GREEN_LED
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(LED, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

RESULT
The LED on board will periodically switch on and off, with each state lasting for 1 second.
TIPS
The 2 main APIs we are using are digitalWrite(pin, state) & delay(milliseconds). Note that we
need to also use the pinMode(pin, direction) function to set the appropriate pin as an OUTPUT
port before we can use the digitalWrite function for toggling it ON & OFF. Try changing the blink
speed or controlling another LED!
Example - 02 : Playing Music (Buzzer)
WHAT ARE WE DOING HERE?
This example shows how to use the Grove buzzer module to play melodies. It sends a square
wave of the appropriate frequency to the buzzer, generating the corresponding tone.
THE CIRCUIT
This manual suits for next models
2
Table of contents