Overview
In this tutorial, we will learn about the new Grove Beginner Kit for Arduino. The Grove Beginner Kit comes with 10 Sensors & and you can therefore make 12 Projects. The advantage of the Grove Beginner Kit for Arduino is that, you don’t need any breadboard neither soldering nor any external wires. Instead of Arduino Board, the kit has Arduino compatible Board called Seeeduino Lotus.
The kit is very useful for Arduino beginners as you only need to focus on coding and Arduino Learning. You can purchase this kit from Seeed Studio Official site.
The Kit has useful modules like LED, Buzzer, Push Button & Potentiometer. It has sensors like Light Sensor, Sound Sensor, DHT11 Humidity Temperature Sensor, Accelerometer & Air Pressure Sensor. We will interface all these sensors and Modules with Seeeduino Lotus and go through the Arduino basic programming.
Learning Objectives
1. Basics of Open Source Hardware Systems.
2. Basic Arduino Programming.
3. Communication principles and methods for sensors.
4. Hands-on implementation of Open Source Hardware projects.
What is inside Grove Beginner Kit for Arduino?
The Arduino Grove Beginner Kit contains 10 sensors and modules. It also has an ATmega328 microcontroller Board called as Seeeduino Lotus Board while is compatible with Arduino Board. You can use the Arduino IDE to program the Board. The following is the list of sensors/modules with a brief idea about them.
| S.N. | Items | Description |
|---|---|---|
| 1 | LED | Simple LED module |
| 2 | Buzzer | Piezo Buzzer |
| 3 | OLED Display 0.96” | 128×64 dot resolution compact Display |
| 4 | Button | Push button for human input interfaces |
| 5 | Rotary Potentiometer | Rotary knob for human input interfaces |
| 6 | Light Sensor | Detects surrounding light intensity |
| 7 | Sound Sensor | Detects surrounding sound intensity |
| 8 | Temperature & Humidity Sensor | Detects surrounding temperature and humidity values |
| 9 | Air Pressure Sensor | Detects surrounding atmospheric pressure |
| 10 | 3-Axis Accelerator | Detects object acceleration |
| 11 | Seeeduino Lotus | Arduino Compatible Board with Grove Ports |
Deafult PCB Connection
There is a default PCB connection between Sensor/Module & Seeeduino Lotus. All the modules have been connected to the Seeeduino through the PCB stamp holes. You don’t need any Grove cables to connect. Of course, you can also take the modules out and use Grove cables to connect the modules.
| Modules | Interface | Pins/Address |
|---|---|---|
| LED | Digital | D4 |
| Buzzer | Digital | D5 |
| OLED Display 0.96" | I2C | I2C, 0x78(default) |
| Button | Digital | D6 |
| Rotary Potentiometer | Analog | A0 |
| Light | Analog | A6 |
| Sound | Analog | A2 |
| Temperature & Humidity Sensor | Digital | D3 |
| Air Pressure Sensor | I2C | I2C, 0x77(default) / 0x76(optional) |
| 3-Axis Accelerator | I2C | I2C, 0x19(default) |
In this tutorial, I will show you how you can use the Grove Cables to connect the Module to the Seeeduino Board.
How to Get Started With Arduino IDE?
Installing Arduino IDE
Arduino IDE is an integrated development environment for Arduino, which is used for single-chip microcomputer software programming, downloading, testing and so on.
First you need to download and install Arduino IDE for your desired operating system from this link: Download Arduino IDE
Installing USB Drivers
Arduino connects to the PC via a USB cable. The USB driver depends on the type of USB chip you’re using on your Arduino. In the case of Seeeduino Lotus, we use a micro-USB data cable to connect it to the computer.
Download the CP2102 USB Driver and install it.
After the driver installation is completed, connect Arduino to the USB port of the PC with a USB cable.
Start & Setup Arduino IDE
1.Open the Arduino IDE on your PC.
2.Click on Tools -> Board to select the correct Development Board Model. Select Arduino/Genuino Uno as Board.
3.Click Tools -> Port to select the correct Port
4.Create a new Arduino file and name it Hello.ino, then copy the following code into it
|
1 2 3 4 5 6 7 |
void setup() { Serial.begin(9600); // initializes the serial port with a baud rate of 9600 } void loop() { Serial.println("hello, world"); // prints a string to a serial port delay(1000); //delay of 1 second } |
5.In the upper left corner of the Arduino IDE, there are two buttons, Verify and Upload. First, press the Verify button(✓) to compile. After the compilation is successful, press the upload button(→).
6.Navigate to Tools -> Serial Monitor, or click the Serial Monitor in the upper right corner(Magnifier Symbol), you can see the program running results:
Lesson 1: Blinking of LED
The first lesson of Arduino Grove Beginner Kit is Blinking of LED. In this project, we will turn on and off the LED repeatedly after a 1-second interval. Seeeduino is the control unit, the LED module is the output unit and the output signal is a digital signal.
We just need the LED and Seeeduino Lotus for this part.
There is already a default connection between LED & Seeeduino by PCB stamp hole. Or you can also connect the Seeeduino to the LED using Grove Cable. The LED is connected to digital pin D4 of Seeeduino Lotus.
Source Code
Now copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
int ledPin = 4; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); delay(1000); } |
The LED module will be 1 second on and 1 second off. You can rotate the potentiometer near the LED to adjust the LED brightness.
Lesson 2: Controlling LED using Button
In this lesson, we will control the ON & OFF state of LED using the Push Button. We will utilize the Seeeduino Lotus, Grove LED & Grove Button for this project.
There is already a default connection by PCB stamp hole. But you can also use a Grove cable to connect the Grove LED to Seeeduino Lotus’s digital interface D4. Connect the Grove Button to digital interface D6.
Source Code
Now copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
const int buttonPin = 6; // the number of the pushbutton pin const int ledPin = 4; // the number of the LED pin int buttonState = 0; // variable for reading the pushbutton statuS void setup() { pinMode(ledPin, OUTPUT); // initialize the LED pin as an output: pinMode(buttonPin, INPUT); // initialize the pushbutton pin as an input: } void loop() { buttonState = digitalRead(buttonPin); // read the state of the pushbutton value: if (buttonState == HIGH) // check if the pushbutton is pressed. If it is, the buttonState is HIGH: { digitalWrite(ledPin, HIGH); // turn LED on: } else { digitalWrite(ledPin, LOW); // turn LED off: } } |
Pressing the button will turn the LED module on. And releasing the button will turn off the LED.
Lesson 3: Controlling the Frequency of the LED Blink
In this experiment, we will control the LED blinking frequency using the Analog Signal from the Potentiometer. We will use the Seeeduino Lotus, Grove LED & Grove Rotary Switch
There is already a default connection by PCB stamp hole. But you can also a Grove cable to connect LED to Seeeduino Lotus’s digital interface D4, and a Grove cable to connect the Grove Rotary Switch to analog signal interface A0.
Source Code
Now copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
int rotaryPin = A0; // select the input pin for the rotary int ledPin = 4; // select the pin for the LED int rotaryValue = 0; // variable to store the value coming from the rotary void setup() { pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT: } void loop() { rotaryValue = analogRead(rotaryPin); // read the value from the sensor: digitalWrite(ledPin, HIGH); // turn the ledPin on delay(rotaryValue); // stop the program for <sensorValue> milliseconds: digitalWrite(ledPin, LOW); // turn the ledPin off: delay(rotaryValue); // stop the program for for <sensorValue> milliseconds: } |
Turning the Potentiometer will change the frequency of LED flickering.
Lesson 4: Buzzer Tutorial
The Grove Beginner Kit Arduino also has the Buzzer as well. Just like the LED module, Buzzer is also an output module, instead of lighting up, it produces a beep sound. This can be used for many situations for indication purposes. In this experiment, we will generate sound using the buzzer!
We will only use the Seeeduino Lotus & Grove Buzzer for this project.
There is already a default connection by PCB stamp hole. But you can also use a Grove cable to connect the Grove Buzzer to Seeeduino Lotus’s digital interface D5.
Source Code
Now copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 |
int BuzzerPin = 5; void setup() { pinMode(BuzzerPin, OUTPUT); } void loop() { analogWrite(BuzzerPin, 128); delay(1000); analogWrite(BuzzerPin, 0); delay(0); } |
After uploading the code, the Buzzer beeps.
Here is another example in which we can use the Potentiometer to control the Buzzer Speed. This can be done through the PWM Signal. Connect the Potentiometer to A0 Pin of Seeeduino Lotus using the Grove Cable.
Source Code
Now copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
int BuzzerPin = 5; int Potentiometer = A0; void setup() { pinMode(BuzzerPin, OUTPUT); } void loop() { int potentioValue, Value; potentioValue = analogRead(Potentiometer); Value = map(potentioValue, 0, 1023, 0, 255); //Mapping potentiometer value to PWM signal value analogWrite(BuzzerPin, Value); } |
After uploading the code, Adjust the potentiometer to adjust the Buzzer sound. The buzzer sound varies depending upon the PWM Signal from the potentiometer.
Lesson 5: Light Sensor Tutorial
The light sensor contains a photosensitive resistor to measure the intensity of light. The resistance of the photosensitive resistor decreases with the increase of light intensity. The LED will light up if the surrounding is dark, and stays off if the surrounding is bright.
In this experiment, we will turn ON the LED-based on the light intensity. Whenever more light falls on the Light Sensor, the LED will turn OFF. In the same way, if the quantity of light is less Light will turn ON.
For this experiment, we will utilize Seeeduino Lotus, Grove LED & Grove Light Sensor.
There is already a default connection by PCB stamp hole. But for demo purposes, use Grove Cable to connect the Grove LED to Seeeduino Lotus’s digital signal interface D4. And also connect the Grove Light Sensor to Seeeduino Lotus’s analog signal interface A6.
Source Code
Now copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
int sensorpin = A6; // Analog input pin that the sensor is attached to int ledPin = 4; // LED port int sensorValue = 0; // value read from the port int outputValue = 0; // value output to the PWM (analog out) void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { sensorValue = analogRead(sensorpin); // read the analog in value: outputValue = map(sensorValue, 0, 1023, 0, 255); // map it to the range of the analog out: Serial.println(sensorValue); analogWrite(ledPin, outputValue); // change the analog out value: delay(30); } |
The LED module will light up if it’s dark and stay off if it’s bright.
We can also observe the results on Serial Monitor from our sensors. Serial Monitor is a useful tool to observe results on Arduino, it can be very useful in terms of printing results from the sensors or debugging in general. Open the Serial Monitor by clicking on the right top section. Select the Buad rate as 9600.
The Serial Monitor displays the Analog value from the Sensor.
Lesson 6: Sound Sensor Tutorial
The sound sensor can detect the sound intensity of the environment, and its output is also simulated. In this experiment, we will turn on the LED on the basis of sound detection. If the sound sensor value exceeds the threshold value, the light will turn ON. The LED lights light up when the sound is made. When there is no sound and it is very quiet, the LED lights to go off.
We will utilize the Seeeduino Lotus, Grove LED & Grove Sound Sensor for this project.
There is already a default connection by PCB stamp hole. But for demo purposes, use Grove cables to connect the Grove LED to Seeeduino Lotus’s digital signal interface D4. Also, connect the Grove Sound Sensor to Seeeduino Lotus’s analog signal interface A2.
Source Code
Now copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
int soundPin = A2; // Analog sound sensor is to be attached to analog int ledPin = 4; // Digital LED is to be attached to digital void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { int soundState = analogRead(soundPin); // Read sound sensor’s value Serial.println(soundState); // if the sound sensor’s value is greater than 200, the light will be on for 5 seconds. if (soundState > 200) { digitalWrite(ledPin, HIGH); delay(100); } else { digitalWrite(ledPin, LOW); } } |
The LED module will light up if the surrounding is loud enough.
Lesson 7: OLED Display Tutorial
The Grove Beginner Kit Arduino also has the OLED Display. OLED Display can be used for many situations, where you could use it to visualize sensor readings!. In this tutorial, we will use the 0.96″ I2C OLED Display with Seeeduino Lotus. We will display the Hello World on OLED Display.
For this experiment, we will utilize Seeeduino Lotus & Grove OLED.
There is already a default connection by PCB stamp hole. But for demo purposes, use Grove cable to connect the OLED to Seeeduino Lotus’s I2C interface. The default I2C’s default address of OLED is 0x78.
Source Code
Before moving to the code part, you need to add the library to the Arduino IDE. To do that open the Arduino IDE. Then install the U8g2 library.
Navigate to Sketch -> Include Library -> Manage Libraries… and Search for the keyword “U8g2” in the Library Manager. It’s the u8g2 library by oliver, and click then install.
Now you can compile and upload the following code to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#include <Arduino.h> #include <U8x8lib.h> U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); void setup(void) { u8x8.begin(); u8x8.setFlipMode(1); } void loop(void) { u8x8.setFont(u8x8_font_chroma48medium8_r); u8x8.setCursor(0, 0); u8x8.print("Hello World!"); } |
The OLED Display will show the ‘Hello World’ on OLED Screen.
Lesson 8: DHT11 Humidity Temperature Sensor Tutorial
The Grove Beginner Kit for Arduino has the DHT11 Temperature and Humidity Sensor. In this, tutorial we will use the DHT11 Sensor to measure environment temperature and humidity. DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air and spits out a digital signal on the data pin.
To learn more about the DHT11 Sensor, you can refer our Arduino DHT11 Guide.
The project requires Seeeduino Lotus, Grove OLED & Grove Temperature and Temperature Sensor.
There is already a default connection by PCB stamp hole. But for demo purposes, use Grove cable to connect the OLED to Seeeduino Lotus’s I2C interface (Note: I2C’s default address is 0x78). Connect the Grove Temperature and Humidity Sensor to Seeeduino Lotus’s digital signal interface D3.
Source Code
Before moving to the code part, you need to add the library to the Arduino IDE. To do that open the Arduino IDE. Then install the Grove DHT11 library.
After adding the library, copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
#include "DHT.h" #include <Arduino.h> #include <U8x8lib.h> #define DHTPIN 3 // what pin we're connected to #define DHTTYPE DHT11 // DHT 11 DHT dht(DHTPIN, DHTTYPE); U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(U8X8_PIN_NONE); void setup(void) { Serial.begin(9600); Serial.println("DHTxx test!"); dht.begin(); u8x8.begin(); u8x8.setPowerSave(0); u8x8.setFlipMode(1); } void loop(void) { float temp, humi; temp = dht.readTemperature(); humi = dht.readHumidity(); u8x8.setFont(u8x8_font_chroma48medium8_r); u8x8.setCursor(0, 33); u8x8.print("Temp:"); u8x8.print(temp); u8x8.print("C"); u8x8.setCursor(0, 50); u8x8.print("Humidity:"); u8x8.print(humi); u8x8.print("%"); u8x8.refreshDisplay(); delay(200); } |
After uploading the code, the surrounding temperature and humidity appear on the OLED screen.
Lesson 9: BMP280 Pressure Sensor Tutorial
The Grove Beginner Kit for Arduino has the Grove Air Pressure Sensor BMP280. It is a breakout board for the Bosch BMP280 high-precision and low-power digital barometer. This module can be used to measure temperature and atmospheric pressure accurately. As the atmospheric pressure changes with altitude, it can also measure the approximate altitude of a place. Earlier we used BME280 & also BMP180 Sensor which is similar to BMP280.
The project requires Seeeduino Lotus & Grove Air Pressure Sensor.
There is already a default connection by PCB stamp hole. But for demo purposes, use Grove cable to connect Grove Air Pressure Sensor to Seeeduino Lotus’s I2C interface using a Grove cable. TheI2C default address is 0x77 or 0x76.
Source Code
Before moving to the code part, you need to add the library to the Arduino IDE. To do that open the Arduino IDE. Then install the Grove BMP2280 library.
After adding the library, copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
include "Seeed_BMP280.h" #include <Wire.h> BMP280 bmp280; void setup() { Serial.begin(9600); if (!bmp280.init()) { Serial.println("Device not connected or broken!"); } } void loop() { float pressure; Serial.print("Temp: "); Serial.print(bmp280.getTemperature()); //get and print temperatures Serial.println("C"); Serial.print("Pressure: "); Serial.print(pressure = bmp280.getPressure()); //get and print atmospheric pressure data Serial.println("Pa"); Serial.print("Altitude: "); Serial.print(bmp280.calcAltitude(pressure)); //get and print altitude data Serial.println("m"); Serial.println("\n");//add a line between output of different times. delay(1000); } |
The Air pressure readings are displayed on the Serial Monitor.
Lesson 10: Accelerometer Sensor Tutorial
The Grove Beginner Kit Arduino also has the Accelerometer Sensor. This is the last sensor, the 3-axis accelerometer. With this module, you can easily add motion monitoring to your design. The Sensor detects the gravity on all the 3 axes as well as the tilting motion. Previously we used ADXL335 and also ADXL345 Accelerometer Sensor for multiple applications.
The project requires Seeeduino Lotus & Grove 3-axis Accelerometer.
There is already a default connection by PCB stamp hole. But for demo purposes, use Grove cable to connect Grove 3-axis Accelerometer to Seeeduino Lotus’s I2C pin. The I2C default address is 0x19.
Source Code
Before moving to the code part, you need to add the library to the Arduino IDE. To do that open the Arduino IDE. Then install the Seeed LIS3DHTR library.
After adding the library, copy the following code and upload it to the Seeeduino Lotus Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#include "LIS3DHTR.h" #include <Wire.h> LIS3DHTR<TwoWire> LIS; //IIC #define WIRE Wire void setup() { Serial.begin(9600); while (!Serial) { }; LIS.begin(WIRE, LIS3DHTR_ADDRESS_UPDATED); //IIC init delay(100); LIS.setOutputDataRate(LIS3DHTR_DATARATE_50HZ); } void loop() { if (!LIS) { Serial.println("LIS3DHTR didn't connect."); while (1) ; return; } //3 axis Serial.print("x:"); Serial.print(LIS.getAccelerationX()); Serial.print(" "); Serial.print("y:"); Serial.print(LIS.getAccelerationY()); Serial.print(" "); Serial.print("z:"); Serial.println(LIS.getAccelerationZ()); delay(200); } |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#include "LIS3DHTR.h" #include <Wire.h> LIS3DHTR<TwoWire> LIS; //IIC #define WIRE Wire void setup() { Serial.begin(9600); while (!Serial) { }; LIS.begin(WIRE, LIS3DHTR_ADDRESS_UPDATED); //IIC init delay(100); LIS.setOutputDataRate(LIS3DHTR_DATARATE_50HZ); } void loop() { if (!LIS) { Serial.println("LIS3DHTR didn't connect."); while (1) ; return; } //3 axis Serial.print("x:"); Serial.print(LIS.getAccelerationX()); Serial.print(" "); Serial.print("y:"); Serial.print(LIS.getAccelerationY()); Serial.print(" "); Serial.print("z:"); Serial.println(LIS.getAccelerationZ()); delay(200); } |
The 3-axis accelerator readings are displayed on the Serial Monitor.































