Tutorial: Using Grove Adaptors on Pin Header Sensors on the Raspberry Pi

Grove Adaptor Cable attached to Pi2Grover

Tutorial: Using Grove Adaptors on Pin Header Sensors on the Raspberry Pi

Grove connectors are appearing everywhere.  They are on sensors, computers, shields and hats.   There are multiple manufactures using this ubiquitous 4 pin plugs, including SwitchDoc Labs.   Grove adaptors allow you to use many more sensors with your Grove shields, Raspberry Pi and Arduino boards.   Grove connectors help keep you from blowing up boards (see the box of death) and allows you to quickly prototype IOT devices.

So, what if you have a sensor that only has pin headers?  What do you do?

It turns out there are easy ways of converting pin headers to Grove connectors using Grove adaptor cables.

See our complete Grove tutorial here.

Use Grove Connectors on a Raspberry Pi using Pi2Grover.

Use Grove Connectors on an Arduino using a Grove shield.

[callout size=”col-12″ title=”Subscribe to the GroveWeekly Newsletter” button_title=”View Latest Issue” button_link=”https://groveweekly.switchdoc.com”  button_size=”normal” button_rounded=”true” button_color=”red”]

What are Grove Adaptor Cables?

There are two types of Grove adaptor cables.   One converts the Grove connector to female header pins as in the pictures below:

 

 

 

 

 

 

 

 

The second type of Grove adaptor cables are Grove connector to male header pins as shown below:

 

 

 

 

 

 

 

How Do You Use These Cable Adaptors?

Basically, you map the Grove connector to your pin headers.   Be careful and make sure you check twice before applying power!

How you map depends on what kind of a sensor you have and what the interface is.   Grove connectors support four kinds of interfaces.

Wire Colors

Wire colors on standard Grove Cables are always the same.

Pin 1 – Yellow (for example, SCL on I2C Grove Connectors)

Pin 2 – White (for example, SDA on I2C Grove Connectors)

Pin 3 – Red – VCC on all Grove Connectors

Pin 4 – Black – GND on all Grove Connectors

Two Examples

SunAirPlus, a solar power controller and data collector, is an example of converting a pin header sensor to use Grove connectors.   SunAirPlus has I2C interface on the pin header that we often want to convert to Grove connectors.  In fact, SunAirPlus comes with a Grove adaptor cable. We connect the cable in the following way:

Pin 1 – Yellow – SCL

Pin 2 – White- SDA

Pin 3 – Red – VDD

Pin 4 – Black – GND

 

Looking down below to the I2C Grove connector, you can see the wiring for an I2C connector. (yellow = SCL, white = SDA,  red = VCC, black = GND).

 

 Second Example – The Adafruit Ultimate GPS

Grove Adaptor Cable attached to Pi2Grover

The Adafruit Ultimate GPS connects to a Raspberry Pi / Arduino through a Serial Interface (UART).   Looking down below at the Serial Interface (UART) Grove Connector wiring, we do the following:

 

Pin 1 – Yellow – Tx

Pin 2 – White – Rx

Pin 3 – Red – VIN

Pin 4 – Black – GND

Note that serial connectors are a bit odd in that you need to connect the RX on the Grove Connector to the TX on the sensor and the TX on the Grove connector to the RX on the sensor.

Conclusion

By following these rules, you can easily convert pin header sensors to Grove connectors.   And you can use the male pin header cables to connect to breadboards!

The Four Types of Grove Connectors

Grove I2C

IMG_6968 2
Grove I2C I2C 4 Channel Mux Board

Those long term readers of this blog know that our favorite devices are I2C sensors.   There are many types of I2C Grove sensors available.   Most are 5V/3.3V devices, but there are a few that are only 3.3V or 5.0V.  You need to check the specifications.

The Grove I2C connector has the standard layout.   Pin 1 is the SCL signal and Pin 2 is the SDA signal.   Power and Ground are the same as the other connectors.  This is another special version of the Grove Digital Connector.  In fact, often the I2C bus on a controller (like the ESP8266, Raspberry Pi and the Arduino) just uses Digital I/O pins to implement the I2C bus.  The pins on the Raspberry Pi and Arduino are special with hardware support for the I2C bus.  The ESP8266 is purely software.

Screen Shot 2016-02-23 at 7.51.46 PM

Grove UART

Grove UART RFID Reader
Grove UART RFID Reader

The Grove UART module is a specialized version of a Grove Digital Module.  It uses both Pin 1 and Pin 2 for the serial input and transmit.  The Grove UART plug is labeled from the base unit point of view.   In other words, Pin 1 is the RX line (which the base unit uses to receive data, so it is an input) where Pin 2 is the TX line (which the base unit uses to transmit data to the Grove module).

Examples of Grove UART modules are:  XBee Wireless Sockets, 125KHz RFID Reader

Screen Shot 2016-02-20 at 11.44.58 AM

Grove Digital

Figure 8
Simple Digital Grove Module with LED

A digital Grove connector consists of the standard four lines coming into the Grove plug.   The two signal lines are generically called D0 and D1.  Most modules only use D0, but some do (like the LED Bar Grove display) use both.   Often base units will have the first connector called D0 and the second called D1 and they will be wired D0/D1 and then D1/D2, etc.

Examples of Grove Digital modules are:   Switch Modules, the Fan Module, and the LED Module.  In Figure 8, you can see what the Grove connector looks like on the schematic for the LED Grove module.   They range from the simple to the very complex.

Screen Shot 2016-02-20 at 11.44.24 AM

Grove Analog

Grove Analog Simple Voltage Divider
Grove Analog Simple Voltage Divider

An Grove Analog connector consists of the standard four lines coming into the Grove plug.   The two signal lines are generically called A0 and A1.  Most modules only use A0.   Often base units will have the first connector called A0 and the second called A1 and they will be wired A0/A1 and then A1/A2, etc.

Examples of Grove Analog modules are:  Potentiometer, Voltage Divider and my personal favorite, the Grove Air Quality Sensor that will be available shortly from SwitchDoc Labs.

Screen Shot 2016-02-20 at 11.44.43 AM