Grove Compatibility Matrix

Module Wio Arduino Raspberry Pi
Button Y Y Y
Buzzer Y Y Y
Gas Sensor Y Y
GPS N Y
IR Kit Y Y
LED Bar Y Y
LED RGB Backlight N Y
LED Socket Kit Y Y
Light Sensor Y Y
RF Kit 433 Mhz N Y
Relay Y Y
Rotary Angle Sensor Y Y
Sound Sensor Y Y
Temperature & Humidity Sensor Y Y
Temperature Sensor Y Y
Touch Sensor Y Y
Ultrasonic Ranger Y Y
Voltage Divider Y Y
Advertisements

How to Beep a Grove Buzzer in Raspberry Pi

W/ Base Board

1) Connect the module to the D2 port.

2) Run the following code:

from grovepi import *

pin = 2

pinMode(pin, "OUTPUT")

while True:
  digitalWrite(pin, 0) # or 1

W/o Base Board

How to Measure Distance with a Grove Ultrasonic Ranger in Arduino

W/ Base Shield

1) Connect the module to the D2 port.

2) Run the following code:

#include <Ultrasonic.h>

const inst PIN = 2;

Ultrasonic ultrasonic(PIN);

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(ultrasonic.MeasureInCentimeters()); // or MeasureInInches()
}

W/o Base Shield

How to Get Temperature from a Grove Temperature Sensor in Arduino

W/ Base Shield

1) Connect the module to the A0 port.

2) Run the following code:

#include <math.h>

const int B = 4275; // for v1.1 module

void setup() {
  Serial.begin(9600);
}

void loop() {
  int v = analogRead(0);

  float r = (float)(1023 - v) * 10000 / v;
  float t = 1 / (log(r / 10000) / B + 1 / 298.15) - 273.15;

  Serial.println(t);
}

W/o Base Shield

How to Get Humidity from a Grove Temperature & Humidity Sensor in Arduino

W/ Base Shield

1) Connect the module to the D2 port.

2) Run the following code:

#include <DHT.h>

const int PIN = 2;

DHT dht(PIN, DHT11);

void setup() {
  dht.begin();

  Serial.begin(9600); 
}

void loop() {
  Serial.println(dht.readHumidity());
}

W/o Base Shield

How to Get Temperature from a Grove Temperature & Humidity Sensor in Arduino

W/ Base Shield

1) Connect the module to the D2 port.

2) Run the following code:

#include <DHT.h>

const int PIN = 2;

DHT dht(PIN, DHT11);

void setup() {
  dht.begin();

  Serial.begin(9600); 
}

void loop() {
  Serial.println(dht.readTemperature());
}

W/o Base Shield