Grove Base Kit for Raspberry Pi - basic set

Grove is a modular prototype system consisting of a base unit and various components with a standardized connector. The base unit can be e.g. Arduino Uno or Raspberry Pi, which enable communication, data processing and input/output control from Grove modules. Each Grove module usually performs one function, from a simple button to a more complex heart rate monitor. All modules have a standard Grove connector that allows you to easily and quickly connect individual elements in a block system, making it easy and enjoyable to create projects using more elements. This enables faster learning and less complicated experimenting, building and prototyping compared to soldering or standard prototyping based on wires and jumpers. For the Raspberry Pi minicomputer there is a Grove Base Hat converter designed to connect to the GPIO connector, allowing for easy connection of multiple modules.

If you have no experience with the Grove system, you should read the Beginner Guide to learn how to perform basic Grove operations. The first part of the guide contains information on the components included in the kit. The next chapter discusses the basic configuration of the Raspberry Pi minicomputer, and after these brief preparations, the guide goes on to the 11 instructional parts teaching basic operations related to the components of the starter kit.

Table of contents

Grove Base Kit for Raspberry Pi

The Grove Start Kit consists of one Grove Base Hat (for Raspberry Pi) and 10 Grove modules. Detailed information can be found below.

Detailed product description

Grove Base Hat

Grove Base Hat for Raspberry Pi

Nowadays, theGrove series ofsensors, actuators and displays has grownsignificantly. It includes newer and newer modules that make the work of engineers, teachers, students and even artists easier. Designing, creating, building - all these things have become faster and easier with Grove modules. All of these factors have made the modules' offerings include overlays, designed for fans of extremely popular minicomputers. Grove Base Hat for Raspberry Pi and Grove Base Hat for RPi Zero. This allows you to take full advantage of the functionality of Grove modules with the capabilities of the raspberry.

Grove Base Hat for Raspberry Pi is equipped with digital and analogue ports, I2C or UART and PWM interface connectors, all to ensure that the user will not run out of options. Thanks to the built-in microcontroller, a 12-bit 8-channel analog/digital converter for Raspberry Pi is also available.

Properties

  • Compatible with Raspberry 4B / 3B+ / 3B / 2B / Zero
  • Built-in MCU
  • 12-bit analogue-to-digital converter
  • Multi-purpose ports Grove

Equipment overview

GPIO:Takithe same layout as in Raspberry Pi.

PWM:PortPWM Grove connects to GPIO/BCM pin12(PWM0) and GPIO/BCM pin13(PWM1), which is the Raspberry Pi hardware PWM pin. In addition all GPIO pins can be used as software PWM pins.

Please note .

  • All pin numbers, except the Grove port, are marked with BCM pin numbers. More information about the differences between BCM pins and physical pins can be found here.

  • Compared to hardware PWM, software PWM is not as accurate and will have problems at high frequencies.

  • The GPIO/BCM pin 18 is also marked as PWM 0, in fact the GPIO/ BCM 12 and GPIO/ BCM 18 have the same PWM channel, so they cannot set a different speed.

  • The audio jack output also uses PWM 0 and PWM 1, so you cannot have audio output in this jack and use PWM at the same time.

UART: The Grove UARTportconnects to the GPIO14 (UART0 TX) and GPIO15 (UART0 RX). UART is commonly used in Raspberry Pi as a convenient way for GPIO to control or access kernel boot messages from the serial console (enabled by default). It can also be used as a way to connect Arduino, ATmega microcontrollers, ESP8266, etc. to your minicomputer.

Cyfrowy:Na board there are 6 digital Grove slots. They are marked with symbols D5 / D16 / D18 / D22 / D24 / D26.

Analogowy:As you know, the Raspberry Pi does not have an analog-to-digital converter, so you cannot connect analog sensors directly to it. With the help of the built-in MCU STM32, Grove Base Hat can work with an external 12-bit converter. This means that your Raspberry Pi can work with analog sensors. What's more, there are four analog Grove slots available. After converting the analog data into digital data, the converter enters the Raspberry Pi via the I2C interface.

I2C:Nathree I2C ports are available, all directly connected to Raspberry Pi's I2C port. You can treat this part as an I2C hub. Most of the new Grove modules have an I2C interface. You will see for yourself, that these three ports are extremely useful.

SWD:We use the SWD port to upload the overlay firmware. In addition, this section contains 3 GPIO pins, i.e. pin 9 / pin 10 / pin 11. These pins are not used by any Grove port, you can use them without worrying about pinning.

Grove Modules

Grove - Buzzer

This module uses a piezoelectric buzzer as the main component. When connected to a digital output, it is able to generate high-pitched sounds. When connected to an analogue output it is able to generate sounds at different frequencies. (Note: The frequency range that the human ear can recognize is from 20 Hz to 20 kHz).

Grove - Button with red LED

Grove - red button with LED. The button is stable and solid. Its lifetime is about 100,000 clicks. Thanks to the built-in LED you can use it in many interesting projects. An interesting solution is to use it as a button status indicator...

Grove - Light intensity sensor

Grove - The light sensor contains a photoresistor that detects light intensity. The resistance of the photoresistor decreases as the light intensity increases. A dual circuit OpAmp LM358 on the board produces a voltage corresponding to the light intensity (i.e. based on resistance values). The output signal has an analogue value, the brighter the light, the higher its value.

Grove - Soil moisture sensor

The moisture sensor can be used to detect the level of soil moisture or the presence of water around the sensor. The modulehelps in plant care. It is easy to use, just put it in the soil and start reading the data. Using the sensor, you can easily create a design for an automatic flower irrigation indicator.

Grove - Mini PIR motion detector

Grove - the mini PIR motion detector is a passive infrared sensor that detects movement within its range. Simply connect it to Grove - Base Shield and program it accordingly. When someone moves in the detection range, the sensor will change the SIG pin state to high.

Grove - Servo

The servo is a DC motor with a gearbox and feedback system. It is used in the drive mechanisms of robots. An interesting module for Grove enthusiasts. The servo is equipped with a Grove plug, thanks to which its connection does not require additional connecting cables.

Grove - Temperature sensor and wilgotności(DHT11)

Temperature and humidity sensor with factory calibrated digital output. A unique element of the capacitive sensor measures relative humidity and a negative temperature coefficient (NTC) thermistor is responsible for temperature measurement. It is characterized by reliability and long-term stability. Please note that this sensor will not operate at temperatures below 0 degrees.

Grove - Relay

The Grove Relay is a digital, normally open switch. With its help you can switch a high voltage circuit using low voltage, e.g. 5 V from the controller. There is an operating indicator on the board as an LED.

Grove - Ultrasonic distance sensor

Grove - the ultrasonic distance sensor is a non-contact distance measuring module operating at 40 kHz. When we provide a pulse trigger signal of more than 10 us through a single pin, the sensor will emit 8 cycles of 40 kHz and detect an echo. The width of the echo signal pulse is proportional to the measured distance.

Grove - 16 x 2 LCD display (white characters on blue background)

This Grove module is a 16-character LCD display with 2 lines. It uses the I2C bus interface to communicate with the starter board, thus reducing the number of pins used from 10 to 2, which is very convenient for the Grove system. The display module also allows the creation and display of various symbols, e.g. hearts, by means of a simple code configuration.

How to get started?

We will need it:

Basic guide

How to record Raspbian on a card?

1. download Raspbian Stretch

Download RaspbianStretch from the official Raspberry Pi website and choose "with desktop and recommended software".

2. Win32 Disk Imager

  • Download Win32Disk Imager from Sourceforge Project as an installer file and enable it to install the software.

  • Insert the microSD card into the card slot on your computer.

  • Start Win32DiskImager from your desktop or menu.

  • Select the appropriate letter of the SD card drive in the device field. Be careful to choose the right drive: if you choose the wrong one, you may lose data on your computer's hard drive! If you are using the SD card slot in your computer and you do not see the drive in the Win32DiskImager window, try using an external SD adapter.

  • Click 'Write' and wait for your computer to finish writing.

  • Finish.

  • Turn off the program and remove the SD card.

Basic configuration

Wireless connection and SSH

1. create a file named "wpa_supplicant.conf" in the /boot folder and copy the code below.

country=EN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="Name-WiFi"
psk="WiFi password"
key_mgmt=WPA-PSK
priority=1
}

Note

The Wi-Fi name and password should be the same as the local Wi-Fi network to which your computer is connected (make sure that your computer and Raspberry Pi are on the same LAN).

2 . create an empty file named "ssh" in the /boot folder.

3 Insert the Raspbian SD card into Raspberry Pi

4. connect the Raspberry Pi to the power supply.

5.Open the putty to connect the computer to Raspberry Pi.

Download putty:.https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

Default user name: pi. Default password: raspberry

VNC configuration

Open raspi-config by entering the following command into the terminal.

sudo raspi-config

Go down to "5 Interfacing Options" and press "enter" to select.

Go down to "P3 VNC" and press "enter" to select.

Select "Yes" to enable.

Select "Ok".

**Install VNC Viewer

Download VNCViewer

Open VNC Viewer and enter the Raspberry Pi IP address. You can find the IP address by entering the ifconfig command in the Raspberry Pi terminal (or you can enter raspberrypi.local).

Note

If you use raspberrypi.local to log in, you should make sure that only one Raspberry Pi is used on your LAN.

Enter your default username and password, now you can access the Raspberry Pi remote desktop!

We did it!

Base Hat configuration

1. turn off Raspberry Pi

sudo shutdown -h now

Connect Grove Base Hat to Raspberry Pi.

Connect the power supply to the Raspberry Pi with a microUSB cable to turn on the I2C bus, open the raspi-config with the following command.

sudo raspi-config

Go down to "5 interfacing options" and press "enter" to select.

Go down to "P5 I2C" and press "enter" to select.

Select "Yes" to enable.

Choose "Ok".

Select "Finish" to save your changes.

3.Quick installation with the following command.

curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -

If everything went well, you should see the message below.

Successfully installed grove.py-0.6
#######################################################
Lastest Grove.py from github install complete !!!!!
#######################################################

4.Besides quick installation, you can alsoinstall all the variables.

5.Clone the latest library of the python.py repository.

git clone https://github.com/Seeed-Studio/grove.py

LED button demo

After the basic configuration of the Raspberry Pi we can now run the LED demo code. Note: you must first follow these steps to continue.

Connecting the hardware

Step 1: Connect Grove - button with red LED to port D5 on Base Hat

Step 2: Attach Base Hat to Raspberry Pi

Step 3: Connect the Raspberry Pi to the power source using the microUSB cable.

Enter the code

Step 1: Enter the following command to create a Python file

cd grove.py
nano example.py

Step 2: Copy the following code to the Python file

Note

Make sure the text editor is in unix format.

#!/usr/bin/env python

import time
from grove.grove_ryb_led_button import GroveLedButton

def main():
    ledbtn = GroveLedButton(5)

    while True:
        ledbtn.led.light(True)
        time.sleep(1)

        ledbtn.led.light(False)
        time.sleep(1)

if __name__ === '__main__':
    main()

Step 3:Uruchomprogram

sudo chmod +x example.py
sudo ./example.py

After a single click of the LED button, the LED will go into "ON" mode, and if you hold it down for a long time in "OFF". After double-clicking the LED button, the LED will start flashing.

pi@raspberrypi:~/grove.py $ sudo ./example.py
turn on LED
turn on LED
turn off the LED
turn on LED
LED blink
^CTraceback (most recent call last):
  File "./example.py", line 17, in 
    main()
  File "./example.py", line 14, in main
    time.sleep(1)
KeyboardInterrupt
pi@raspberrypi:~/grove.py $ 

Explanation of the blink code

In Python, because the modules relate to each other, different modules can have different "main" definitions and there can only be one input program eachtime. The choice of the input program depends on the value of the name. "if__name __ === 'main'" is equal, it means that it is a Python emulation.

if __name__ == '__main__':
    main()

Grove Base Kit for Raspberry Pi

Are you ready to get acquainted with the Grove system? We have created 8 tutorials, which you can start with the basic Grove modules. This section shows you how to combine modules and apply them to real applications.

Prerequisite

To start the Grove Tutorial, basic knowledge of Raspberry Pi and Python programming language is required. Make sure you have successfully completed the basic configuration tutorial above, completed the LED Blink demo and make sure it fully works with Raspberry Pi and Grove Base Hat.

Learning outcomes

  • You will be able to use Grove Base Hat to build applications with Grove modules.
  • You will be able to demonstrate each element of the Grove Starter Kit and use the appropriate module for your own projects.
  • You will be able to recognize the types of modules included in this kit and their applications.
  • You will understand the difference between analogue and digital signals.

Botland.store - shop for makers!