跳到主要内容

Grove Shield for Pi Pico v1.0

enter image description here

The Raspberry Pi Pico is a new popular low-cost, high-performance microcontroller board, so how to integrate Grove sensor to it? The grove shield perfectly solved this problem.

The Grove Shield for Pi Pico v1.0 is a plug-and-play shield for Raspberry Pi Pico which integrates with various kinds of Grove connectors, including 2I2C, 3Analog, 2UART, 3Digital ports, SWD debug interface and SPI pin, 3.3v/5v selectable power switch. It enables the build prototype and project in an easy and quick way without jumper wire and breadboard, you could explore infinite possibilities of Pico. The shield board is a stackable add-on board which acts as a bridge for Pi Pico and Seeed's Grove system.

Specification

ParameterValue/Range
Operating voltage3.3/5V
Operation Temperature-25℃ to +85℃
Analog Ports3
Digital Ports3
UART Ports2
I2C Ports2
Size56mm x56mm

Compatible Boards

The Base Shield is tested and fully compatible with Pi Pico.

Hardware Overview

  • 1-Analog Ports: include 3 anlog ports, A0, A1, A2.

  • 2-Digital Ports: include 3 digital ports, D16, D18, D20.

  • 3-UART Port: 2 UART port.

  • 4-I2C Ports: 2 I2C ports.

  • 5-Power Switch: 5V/3.3V selectable power switch.

  • 6-SPI port: 1 spi0 port.

  • Dimension: 56mm * 56mm

Getting Started

Project of Different Sounds of Buzzer

Materials Required

  • Step 1. Prepare the below stuffs:
Pi PicoGrove Shield for Pi PicoGrove - BuzzerGrove-Rotary-Angle-Sensor
enter image description hereenter image description hereenter image description hereenter image description here
Get ONE NowGet ONE NowGet ONE NowGet ONE Now
  • Step 2. Connect Grove Buzzer to port A1 of Base Shield.
  • Step 3. Connect Grove Rotary Angle Sensor to port A0 of Base Shield.
  • Step 4. Plug Grove Shield for Pi Pico into Pi Pico.
  • Step 5. Connect Pi Pico to PC through a USB cable.

enter image description here

Software

  • Step 1. Download Thonny(Windows, Mac)Integrated Development Environment(IDE) according to your computer system.

For linux develop environment:

Binary bundle for PC (Thonny+Python):

bash <(wget -O - https://thonny.org/installer-for-linux)

With pip:

pip3 install thonny

Debian, Rasbian, Ubuntu, Mint and others:

sudo apt install thonny

Fedora:

sudo dnf install thonny
  • Step 2. Start Thonny and Connect your computer and the Raspberry Pi Pico together, then open up the Run menu and select Run->"Select Interpreter", picking "MicoPython(Raspberry Pi Pico)" from the drop down, and select the com port of your Pi Pico. If you can't find "Micopython (Raspberry Pico)" in Select Interpreter, please download the latest version of Thonny.

Hit "ok" if your Raspberry Pi Pico is plugged in and running MicroPython Thonny should automatically connect to the Repl.

  • Step 3. Copy below code to the Thonny IDE, and click the green run button.
from machine import Pin,PWM,ADC
from time import sleep
adc = ADC(0) #ADC input (knob potentiometer) connected to A0
pwm = PWM(Pin(27))#DAC output (buzzer) connected to A1
pwm.freq(10000)
while True:

'''Analog port test'''
val = adc.read_u16()#Read A2 port adc value (65535~0)
#Drive the buzzer, turn off the buzzer when the adc value is less than 300
if val > 300:
pwm.freq(int(val/10))
pwm.duty_u16(10000)
else:
pwm.duty_u16(0)
print(val)
sleep(0.05)

Rotate Grove-Rotary-Angle-Sensor, you will hear different sounds from the buzzer.

Project of Detecting Temperature and Humidity

Materials Required

  • Step 1. Prepare the below stuffs:
Pi PicoGrove Shield for Pi PicoGrove-OLED-Display-0.96-SSD1315Grove-Temperature-Humidity-Sensor-DHT11
enter image description hereenter image description hereenter image description hereenter image description here
Get ONE NowGet ONE NowGet ONE NowGet ONE Now
备注

In this kit, we have upgraded the Grove Temperature Humidity Sensor(DHT11) to Grove Temperature Humidity Sensor(DHT20). If you want to get started with Grove Temperature Humidity Sensor(DHT20), you can click here.

  • Step 2. Connect Grove OLED Display 0.96" to port I2C1 of Base Shield.
  • Step 3. Connect Grove Temperature Humidity Sensor DHT11 to port D18 of Base Shield.
  • Step 4. Plug Grove Shield for Pi Pico into Pi Pico.
  • Step 5. Connect Pi Pico to PC through a USB cable.

Software

Please refer to the demo1 software part.

Copy below code to the Thonny IDE at first.

from ssd1306 import SSD1306_I2C
from dht11 import *
from machine import Pin, I2C
from time import sleep

i2c = I2C(1, scl=Pin(7), sda=Pin(6), freq=200000)#oled connect to I2C1
oled = SSD1306_I2C(128, 64, i2c)
dht2 = DHT(18) #temperature and humidity sensor connect to D18 port


while True:

temp,humid = dht2.readTempHumid()#temp: humid:
'''I2C port test'''
''' oled display test'''
oled.fill(0)#Clear screen
oled.text("Temp: " + str(temp),0,0)#display tempearture on line 1
oled.text("Humid: " + str(humid),0,8)
oled.show()
sleep(0.5)

Then please download the ssd1306.py and dht11.py to your local. Use Thonny open dht11.py, click file->save as->MicroPython device.

enter image description here

Input dht11.py in File name column, click "ok", then the file is saved at File->Open->MicroPython device, the same with the ssd1306.py file.

enter image description here

After you have save both of the files to your MicroPython device, now please click the green button to run the demo code.

Then you can get the temperature and humidity displayed on the OLED as below.

enter image description here

Project of Controling Led and Relay

Materials Required

  • Step 1. Prepare the below stuffs:
Pi PicoGrove Shield for Pi PicoGrove-buttonGrove-LEDGrove relay
enter image description hereenter image description hereenter image description hereenter image description hereenter image description here
Get ONE NowGet ONE NowGet ONE NowGet ONE NowGet ONE Now
  • Step 2. Connect Grove button to digital pin 18 of Base Shield.
  • Step 3. Connect Grove led to port D16 of Base Shield.
  • Step 4. Connect Grove Relay to port D20 of Base Shield.
  • Step 5. Plug Grove Shield for Pi Pico into Pi Pico.
  • Step 6. Connect Pi Pico to PC through a USB cable.

Software

Please refer to the demo1 software part.

Copy below code to the Thonny IDE at first.

from machine import Pin

button = Pin(18, Pin.IN, Pin.PULL_UP)# button connect to D18
button.irq(lambda pin: InterruptsButton(),Pin.IRQ_FALLING)#Set key interrupt
led = Pin(16, Pin.OUT)#led connect to D16
relay = Pin(20, Pin.OUT)
tmp = 0
'''Key interrupt function, change the state of the light when the key is pressed'''
def InterruptsButton(): #button input
global tmp
tmp = ~tmp
led.value(tmp)
relay.value(tmp)
while True:
pass

Now please click the green button to run the demo code.

Then you can press the grove button, you can control the led and relay open and close.

enter image description here

Project of Flashing Colors

Materials Required

  • Step 1. Prepare the below stuffs:
Pi PicoGrove Shield for Pi PicoRGB LED WS2813 mini
enter image description hereenter image description hereenter image description here
Get ONE NowGet ONE NowGet ONE Now
  • Step 2. Connect RGB LED WS2813 mini to port 18 of Base Shield.
  • Step 3. Plug Grove Shield for Pi Pico into Pi Pico.
  • Step 4. Connect Pi Pico to PC through a USB cable.

Software

Please refer to the demo1 software part.

Copy below code to the Thonny IDE at first.

from ws2812 import WS2812
import time

BLACK = (0, 0, 0)
RED = (255, 0, 0)
YELLOW = (255, 150, 0)
GREEN = (0, 255, 0)
CYAN = (0, 255, 255)
BLUE = (0, 0, 255)
PURPLE = (180, 0, 255)
WHITE = (255, 255, 255)
COLORS = (BLACK, RED, YELLOW, GREEN, CYAN, BLUE, PURPLE, WHITE)

#WS2812(pin_num,led_count)
led = WS2812(18,30)

print("fills")
for color in COLORS:
led.pixels_fill(color)
led.pixels_show()
time.sleep(0.2)

print("chases")
for color in COLORS:
led.color_chase(color, 0.01)

print("rainbow")
led.rainbow_cycle(0)


Then please download the ws2812.py to your local. Use Thonny open ws2812.py, click file->save as->MicroPython device.

Input ws2812.py in File name column, click "ok", then the file is saved at File->Open->MicroPython device.

enter image description here

After you have save the files to your MicroPython device, now please click the green button to run the demo code. Then you can get the RGB LED WS2813 mini flash beautiful color as below.

enter image description here

Project of Detecting Sound and Light

Materials Required

  • Step 1. Prepare the below stuffs:
Pi PicoGrove Shield for Pi Picogrove sound sensorGrove light sensorGrove-16x2 LCD
enter image description hereenter image description hereenter image description hereenter image description hereenter image description here
Get ONE NowGet ONE NowGet ONE NowGet One NowGet ONE Now
  • Step 2. Connect Grove sound sensor to analog pin 0 of Base Shield.
  • Step 3. Connect Grove light to port A1 of Base Shield.
  • Step 4. Connect Grove 16X2 lcd to port I2C1 of Base Shield.
  • Step 5. Plug Grove Shield for Pi Pico into Pi Pico.
  • Step 6. Connect Pi Pico to PC through a USB cable.

Software

Please refer to the demo1 software part.

Copy below code to the Thonny IDE at first.

#from lcd1602 import LCD1602_RGB  #LCD1602 RGB grove
from lcd1602 import LCD1602
from machine import I2C,Pin,ADC
from time import sleep
i2c = I2C(1,scl=Pin(7), sda=Pin(6), freq=400000)
d = LCD1602(i2c, 2, 16)
#d = LCD1602_RGB.display(i2c, 2, 16)
#d.set_rgb(255, 0, 0)
sleep(1)
light = ADC(0)
sound = ADC(1)

while True:

lightVal = light.read_u16()
soundVal = sound.read_u16()
d.home()
d.print('lightvalue=')
d.print(str(lightVal))
#d.set_rgb(0, 255, 0)
sleep(1)
d.setCursor(0, 1)
d.print('soundvalue=')
d.print(str(soundVal))
#d.set_rgb(0, 0, 255)
sleep(1)

Then please download the LCD1602.py to your local. Use Thonny open LCD1602.py, click file->save as->MicroPython device.

Input LCD1602.py in File name column, click "ok", then the file is saved at File->Open->MicroPython device.

备注

In this example, the version of LCD1602 we are using is a monochrome backlit version, If you need to control the full-color backlit version of LCD1602, check out the functions in this library file to learn how to use it.

enter image description here

After you have save the files to your MicroPython device, now please click the green button to run the demo code. Then you can get the sound sensor and light sensor data as below.

enter image description here

Project of Detecting Motion

Materials Required

  • Step 1. Prepare the below stuffs:
Pi PicoGrove Shield for Pi Picogrove servoGrove Mini FanGrove mini pir motion sensor
enter image description hereenter image description hereenter image description hereenter image description hereenter image description here
Get ONE NowGet ONE NowGet ONE NowGet ONE NowGet ONE Now
  • Step 2. Connect Grove servo to analog pin 1 of Base Shield.
  • Step 3. Connect Grove Mini fan to port D16 of Base Shield.
  • Step 4. Connect Grove Mini pir motion sensor to port D18 of Base Shield.
  • Step 5. Plug Grove Shield for Pi Pico into Pi Pico.
  • Step 6. Connect Pi Pico to PC through a USB cable.

Software

Please refer to the demo1 software part.

Copy below code to the Thonny IDE at first.

from machine import Pin,ADC,PWM
from time import sleep
import utime

miniFun = Pin(16, Pin.OUT)
miniPir = Pin(18, Pin.IN)

pwm_Servo=PWM(Pin(27))
pwm_Servo.freq(500)
Servo_Val =0

while True:

if miniPir.value() == 1 :
miniFun.value(1)

while Servo_Val<65535:
Servo_Val=Servo_Val+50
utime.sleep_ms(1)
pwm_Servo.duty_u16(Servo_Val)
while Servo_Val>0:
Servo_Val=Servo_Val-50
utime.sleep_ms(1)
pwm_Servo.duty_u16(Servo_Val)

else :
miniFun.value(0)

pwm_Servo.duty_u16(0)



Now please click the green button to run the demo code. Then you can get the grove mini fan and grove servo run When you hands swiping past the pir sensor as below.

Schematic Online Viewer

Resources

Course Resources

Tech Support

Please submit any technical issue into our forum.


Loading Comments...