A new way of no-solder prototyping

Base Units

A Grove base unit is a controller or shield to which you attach the Grove modules. The base unit provides the connection to the microprocessor, and the modules offer the input sensors and output actuators of your system.

A number of good base unit shields are available for the Arduino that provide a lot of Grove connectors. The base unit in Figure 3 is designed to plug in to an Arduino Uno. Units are also available for the Arduino Mega, Due, and others. I haven't seen one for the Arduino Yun yet, but no doubt it will be be coming.

Figure 3: Arduino Uno base unit shield.

On the Raspberry Pi side, the pickings are much slimmer, mostly because of the Pi's lack of an ADC (analog-to-digital converter). The one Raspberry Pi HAT (hardware on top) that I have evaluated is the GrovePi+ [3] (Figure 4). Although the GrovePi+ HAT fits well on the Raspberry Pi, it falls down on two huge counts, so I do not recommend it for general use.

Figure 4: GrovePi+ HAT on a Raspberry Pi 2.

The first problem is that the GrovePi+ HAT puts an Arduino between the Grove connectors and the Raspberry Pi. All of the I/O (with the exception of the Raspberry Pi serial connector) goes through the Arduino. Although this could be a nice solution to some problems, I find this architecture just gets in the way of trying to use the Raspberry Pi with Grove modules.

This "Arduino in between" leads to the second problem. The Raspberry Pi already has hundreds of Python driver packages for a huge variety of devices with I2C, digital, analog (via an external ADC), and serial interfaces, and these have to be rewritten for use with the GrovePi+, adding an additional set of complexity to using any devices that haven't been supported by the GrovePi+. Any custom solutions become a problem to implement. A better solution for the Raspberry Pi, in my opinion, is to create a HAT that has the connectors and an external ADC without another processor in the middle.

Using Grove with a Raspberry Pi or Arduino does not require a HAT or shield. All you need to do is connect the I2C and digital or analog inputs to the Grove devices using Grove-to-jumper pin connectors, as in Figure 5.

Figure 5: Jumper pins to Grove connector cable.

Did I say analog Raspberry Pi pins? As I mentioned earlier, it has none. Whereas the GrovePi+ uses the Arduino ADC internal system, the Raspberry Pi needs an external ADC. By attaching one of the many I2C ADC units on the market to the Rasp Pi or, better yet, a Grove I2C ADC module (Figure 6), you can then plug in your analog Grove modules to the other end of the ADC module.

Figure 6: Grove I2C ADC module: I2C on one end, analog on the other.

You can easily add an I2C ADC to the Raspberry Pi (using a Grove connector, no less), and then you have all four of the connector types possible. The software for reading the I2C is simple and easily available. Check out the latest postings on the SwitchDoc Labs blog for more information [4] about those drivers.

Connector Types

Physically, all four Grove connectors are exactly the same. The differences are in the signal types provided. Generically, all of the Grove connectors are wired the same: signal 1, signal 2, power, ground.

Digital. 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 (Table 1). Most modules only use D0, but some (e.g., 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, then D1/D2, and so on. Examples of Grove digital modules include switches, a fan, and LEDs. In Figure 7, you can see what the Grove connector looks like on the schematic for the LED module.

Table 1

Grove Digital Connector

Grove Pin

Name

Function

1

D0

Primary digital I/O

2

D1

Secondary digital I/O

3

VCC

Power for Grove module (5V or 3.3V)

4

GND

Ground

Figure 7: Grove LED module schematic.

Analog. A Grove analog connector also has the standard four lines coming into the Grove plug. The two signal lines are generically called A0 and A1 (Table 2). 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, then A1/A2, and so on. Examples of Grove analog modules include a potentiometer, a voltage divider, and – my personal favorite – the Grove air quality sensor.

Table 2

Grove Analog Connector

Grove Pin

Name

Function

1

A0

Primary analog input

2

A1

Secondary analog input

3

VCC

Power for Grove module (5V or 3.3V)

4

GND

Ground

UART. The Grove UART module is a specialized version of a Grove digital module. It uses pins 1 and 2 for the serial input and transmit (Table 3). The Grove UART plug is labeled from the base unit point of view; that is, pin 1 is the RX line (which the base unit uses to receive data, so it is an input), whereas pin 2 is the TX line (which the base unit uses to transmit data to the Grove module). Examples of Grove UART modules include XBee wireless sockets and a 125KHz RFID reader.

Table 3

Grove UART Connector

Grove Pin

Name

Function

1

RX

Serial receive (from base point of view)

2

TX

Serial transmit (from base point of view)

3

VCC

Power for Grove module (5V or 3.3V)

4

GND

Ground

I2C. Long-term readers of this column know that my favorite devices are I2C sensors, and Grove has many types of these sensors available. Most are 5V/3.3V-capable devices, but a few are only 3.3V or 5V, so 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 (Table 4). The Grove I2C also is a special version of the Grove digital connector. In fact, the I2C bus on a controller (e.g., the ESP8266, Raspberry Pi, and Arduino) often just uses digital I/O pins to implement the I2C bus. The pins on the Raspberry Pi and Arduino have hardware support for the I2C bus, whereas the ESP8266 is purely a software implementation.

Table 4

Grove I2C Connector

Grove Pin

Name

Function

1

SCL

I2C clock

2

SDA

I2C data

3

VCC

Power for Grove module (5V or 3.3V)

4

GND

Ground

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content