• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
  • YouTube
  • MakerWorld
  • Instagram
  • Threads
  • Bluesky
  • Mastodon
  • Facebook
makerhacks-logo

Maker Hacks

Ideas, news & tutorials for makers and hackers – Arduino/Raspberry Pi, 3D printing, robotics, laser cutting, and more

  • Home
  • About
  • 3D Printing
  • Laser Cutting
  • CNC
  • Programming
  • Free Arduino Course
  • Free Robotics Course
  • Recommendations

Using Grove Sensors, Buttons, and Displays, with Raspberry Pi and Python

You are here: Home / Electronics and Hardware / Using Grove Sensors, Buttons, and Displays, with Raspberry Pi and Python
Author: Chris Garrett

Grove sensors are a plug and play way to add sensors, buttons, displays, and actuators to your electronics projects, without soldering. Let’s take a look how well they work when paired with a Raspberry Pi!

GrovePi Gyro, Buttons, Displays

Grove sensors are a plug and play way to add sensors, buttons, displays, and actuators to your electronics projects, without soldering. Let’s take a look how well they work when paired with a Raspberry Pi!

Previously

Playing with Grove – LCD Displays

I have talked about Grove before. Increasingly I am finding these parts a convenient way to build projects. No soldering, there are usually decent libraries, or at least code snippets, and far fewer wires involved because the majority of the sensors use either I2C or simple analog/digital connections, rather than a mess of breadboard connections.

Up to know, however, I have used Grove with Arduino and the BBC micro:bit. This time around I am using Raspberry Pi and the GrovePi add-on.

GrovePi

GrovePi

As you would expect, GrovePi allows you to plug in digital, analog, serial, and I2C Grove sensors, but it is a little more than that.

What makes GrovePi special is that it’s actually kind of an Arduino that you strap to your Raspberry Pi.

This means you don’t have to worry about the Pi being 3v, and it allows the Pi to read analog inputs.

Unfortunately, it also means it is not as cheap as it would be otherwise. What you trade dollars for you get back in convenience.

There are both full sized and Zero sized boards. I went with the full sized because the Zero version only has 6 sockets. Now I am thinking of getting the Zero version too!

Grove + Python

The Python libraries seem to be less of a priority than the Arduino code, possibly because GrovePi is not a Seeed product, but a third party add-on.

Dexter Industries have their own version of Raspbian that you will need to install to get everything they provide. Adding to an existing Raspbian image seemed to not work so well, but that might have been partly because I also needed to update the firmware.

The main library for handling the basic stuff is the GrovePi module.

This makes working with digital inputs super familiar to Arduino programmers:

import grovepi

grovepi.pinMode(3, "INPUT")

button1 = grovepi.digitalRead(3)

More complex modules have their own specialized libraries, such as the RGB Backlit LCD display:

import grove_rgb_lcd

# 4xLED plugged into pin 5
display = 5
grovepi.pinMode(display, "OUTPUT")
grovepi.fourDigit_init(display)
grovepi.fourDigit_brightness(display, 8)
grovepi.fourDigit_number(display, 1234, False)

Some modules don’t have official libraries, but due to the fact they are usually standard digital or analog, or will have I2C libraries somewhere, you can get them to work.

For example, my LSM6DS3 based 6-Axis Accelerometer and Gyroscope sensor does not have a library, but someone had made a library for a directly connected unit that still works, I just had to tell it the correct I2C address to use.

sudo i2cdetect -y 1

get i2c addresses in linux
get i2c addresses from linux

Code

Get the full code for my demo here.

See it in action in my shaky one-handed video:

 

Category: Electronics and Hardware, Software and ProgrammingTag: Hacks, linux, making, python, raspberry pi

About Chris Garrett

Marketing nerd by day, maker, retro gaming, tabletop war/roleplaying nerd by night. Co-author of the Problogger Book with Darren Rowse. Husband, Dad, 🇨🇦 Canadian.

Check out Retro Game Coders for retro gaming/computing.

☕️ Support Chris on Ko-Fi to get exclusive content and rewards!

Previous Post:Linux Automation Scheduling and Starting Scripts on BootLinux Automation Tips: Running Scripts Automatically
Next Post:Linux Automation Tips: Create a Boot/Start Menu with Pythonpi entertainment centre

Sidebar

  • Facebook
  • Instagram
  • YouTube

Featured Posts

  • CyberBrick Review + Getting Started
  • xTool M2 Review
  • xTool F2 Ultra Review
  • xTool F2 Review
  • xTool S1 Review
  • Anycubic Kobra S1 Combo Review
  • Makera Z1 Pro Review
  • CNC Buyer's Guide
  • eufyMake E1 UV Printer Review
  • eufyMake Purifier P1
  • Z80 on a Breadboard
  • OpenSCAD MakerWorld Customizer

30 Days to Arduino

Arduino Tutorials
  • 3D Printing
  • CNC
  • Electronics and Hardware
  • Laser Cutting
  • News and Reviews
  • Software and Programming

arduino budget cad cnc diode laser glowforge Hacks Ideas laser cutter linux Makes making python raspberry pi Reviews technology tips xtool xTool Lasers

  • YouTube
  • MakerWorld
  • Instagram
  • Threads
  • Bluesky
  • Mastodon
  • Facebook

.

Maker Hacks Blog Copyright © 2026 · All Rights Reserved · Privacy Policy