logo-mobile

ROHM

ROHM
Menu
  • Arduino –
  • Raspberry Pi –
  • Trending –
  • Others –
  • About –
  • Contact –

Raspberry Pi

Let’s Build Mobile Gadget Using Compact Raspberry Pi Zero Build Environment Check Device Using Grove Sensor

DevicePlus Editorial Team
Published by DevicePlus Editorial Team at March 26, 2020
Categories
  • Raspberry Pi
Tags
complete project

This article was translated to English, and was originally published for deviceplus.jp.

In this article, I’d like to show how to use a mechanism called Grove from Seeed, with which you can easily add sensors. We’ll build a compact environment check device that lets you use various sensors just by plugging them in and control them from Raspberry Pi.

image of complete project

List of Items Required in this Article

・Raspberry Pi Zero
Raspberry Pi Zero

・Seeed ReSpeaker 2-Mics Hat
Seeed re speaker 2 mics hat

・Grove temperature and humidity sensor
Grove temperature and humidity sensor

・Grove 4-digit display
Grove 4 digit display

・Compact lithium polymer battery
(*Caution: Handle with sufficient care and use at your own risk)
lithium polymer battery

・Switched breakout board
breakout board

・Case for Raspberry Pi Zero (You can start right away with the Raspberry Pi Starter Kit that includes a case.)

Table of Contents

1. Use Grove Sensor
2. Use 4-Digit Display
3. Assemble Compact Environment Check Device
4. Conclusion

1. Use Grove Sensor

This time, I’ll use Seeed ReSpeaker for Raspberry Pi Hat. If you haven’t set up the driver yet, please see Seeed page to set it up beforehand.
ReSpeaker has two Grove terminals. The Grove series are a sensor family from Seeed, which can be used just by plugging them into the terminals without soldering.

grove terminals

Seeed offers more than 100 types of sensors with the Grove terminal, covering most sensors.
lineups of grove sensors

Let’s select from sensors that are easy to use with Raspberry Pi.
First, I’ll pick the temperature and humidity sensor, a staple item. It uses a sensor called DHT11 to measure temperature and humidity. The square blue sensor is attached to the board. Four Grove terminals come out on the board.
It’s very handy because you only have to plug them into four unified Grove terminals, while you would normally need to set up a resistor and circuit and connect the power supply, GND, and output by each when using a temperature/humidity sensor.
I’ll insert this sensor into the Grove terminal on the left side as shown in the picture below.

connecting the sensor

Seeed also provides software to handle the sensor with Raspberry Pi. Turn on Raspberry Pi and connect to it with SSH. See Github page of Seeed to install grove.py by referring to the red frame below.
instructions for installing

Here, the grove.py program group is installed in Raspberry Pie with Python3.

$ git clone https://github.com/Seeed-Studio/grove.py
$ cd grove.py
$ sudo pip3 install .
$ cd grove

When the installation is complete, you can see that various programs are stored in a folder called grove. We’ll use grove_temperature_humidity_sensor.py here. Write a simple program as shown below to measure temperature and humidity using DHT11. Specify the Grove terminal on the left side of ReSpeaker as it is connected to GPIO3.
[Sample program grove_temp.py]

Then, use the python3 command to run the program:

$ python3 grove_temp.py

How’s it like? The sensor should be able to measure temperature and humidity once every few seconds and display the value on the screen.
measured temperature and humidity on the screen

You see that you can easily measure temperature and humidity just by plugging in Grove and using the sample program?

2. Use 4-Digit LCD Display

We already measured temperature and humidity, and I’d like to display it. Grove also provides a 4-digit LCD display which you can easily display numerical values.
This LCD display also has four terminals coming out on the board. Connect the display to the middle terminal of ReSpeaker.
connecting the 4 digit display

There is also a sample program for the 4-digit display, so we’ll apply it. Write a sample program as shown below:

[grove_4d.py]

As you run the program, the current time is displayed. We can use the data display simply by connecting it. Pretty straightforward.

$ python3 grove_4d.py
displaying the current time

Now, let’s enable the LCD to display the temperature and humidity measured earlier.
Create the grove_temp_4d.py program combining grove_temp.py and grove_4d.py written earlier.

[grove_temp_4d.py]

Then run the program. Time, temperature, and humidity would be displayed alternately.

$ python3 grove_temp_4d.py
display shows time, humidity and temperature

3. Assemble Environment Check Device

Finally, assemble those components into a compact device that can be hung from your neck or placed next to your computer.
We’ll also make the device periodically record the measurements in Google Spreadsheet so you can see under what environment (temperature and humidity) you are spending the day. It may be a good opportunity to review the usual situation of your room!

First, connect a small lithium-ion battery to the Raspberry Pi Zero.
connecting lithium battery

Then, place the Grove temperature and humidity sensor and LCD so that they fit well.
making everything compact

I put them in a case I bought at local store. Attach a gem clip to the back of this case, and you can get the environment check device!
complete project

Finally, let’s add a function to periodically upload measurements to Google Spreadsheet. Using the IFTTT mechanism, you can easily upload data from Raspberry Pi to Google Spreadsheet.

Go to the IFTTT.com page to create a new applet.
Select Webhooks as a trigger. Specify an appropriate Event Name (rpzero_temp).
searching IFTTT

Then, select Google Spreadsheets as Action.
Select “Add row to spreadsheet” to add a row to the spreadsheet each time the device measures temperature and humidity.
You can leave the data definition as default as shown below.
data definition

Now we have an applet that writes data to a spreadsheet when it receives an event called “rpzero_temp” from Raspberry Pi.
the event

Click on Webhooks and copy your account key (a string in black shown below). You’ll set this key in your Raspberry Pi.
webhook settings

Now, incorporate this connection information into the Raspberry Pi program as IFTTT_URL and IFTTT_KEY.
Set the data received from the temperature and humidity sensor to Value1, 2, and 3 for the passed data.

[grove_temp_4d_sheet.py]

If you run the program, the data will periodically be stored in Google Spreadsheet.
you can check if it's working properly

Attach the device to the side of your computer and check the temperature and humidity in your room or your surroundings.
testing the device

data shown on screen

Here is the result of using the device for one day. The data stored on Google Spreadsheet can be easily displayed in charts, which is useful for checking the environment.
data stored to spreadsheet

 

4. Conclusion

We connected the Grove sensor to Raspberry Pi Zero and ReSpeaker Hat.
I think that you can easily connect a temperature and humidity sensor or an LCD. Sample programs also enable you to measure and display the environment with ease.

The Grove sensors include sound, light, air cleanliness sensors, etc. You can use any of them according to what you want to measure.

Next time, we are proceeding to a more convenient gadget, a small device in the room to operate an air conditioner and a television.
I’ll see you then!

DevicePlus Editorial Team
DevicePlus Editorial Team

Check us out on Social Media

  • Facebook
  • Twitter

Recommended Posts

  • Using Crystal Signal Pi, Part 3 – Setup a Caution Light Solution made with Raspberry Pi – Creating ToolsUsing Crystal Signal Pi, Part 3 – Setup a Caution Light Solution made with Raspberry Pi – Creating Tools
  • Latest New Sensors, E-Textiles, Batteries from IDTechEx USA (Cont.)Latest New Sensors, E-Textiles, Batteries from IDTechEx USA (Cont.)
  • DIY Raspberry Pi Drone: Mechanics – Part 1DIY Raspberry Pi Drone: Mechanics – Part 1
  • Geekcraft: Easy Raspberry Pi Humidity & Temperature SensorGeekcraft: Easy Raspberry Pi Humidity & Temperature Sensor
  • Reading Temperature, Humidity, and Pressure with AE-BME280 and Raspberry PiReading Temperature, Humidity, and Pressure with AE-BME280 and Raspberry Pi
  • Tweet on Raspberry Pi via Twython! (Part 2)Tweet on Raspberry Pi via Twython! (Part 2)
Receive update on new postsPrivacy Policy

Recommended Tutorials

  • How to integrate an RFID module with Raspberry Pi How to integrate an RFID module with Raspberry Pi
  • How to Use the NRF24l01+ Module with Arduino How to Use the NRF24l01+ Module with Arduino
  • How to Run Arduino Sketches on Raspberry Pi How to Run Arduino Sketches on Raspberry Pi
  • Setting Up Raspberry Pi as a Home Media Server Setting Up Raspberry Pi as a Home Media Server

Recommended Trends

  • SewBot Is Revolutionizing the Clothing Manufacturing Industry SewBot Is Revolutionizing the Clothing Manufacturing Industry
  • All About The Sumo Robot Competition And Technology All About The Sumo Robot Competition And Technology
  • 5 Interesting Tips to Calculating the Forward Kinematics of a Robot 5 Interesting Tips to Calculating the Forward Kinematics of a Robot
  • Go Inside the Drones That Are Changing Food Delivery Go Inside the Drones That Are Changing Food Delivery
Menu
  • Arduino –
    Arduino Beginner’s Guide
  • Raspberry Pi –
    Raspberry Pi Beginner's Guide
  • Trending –
    Updates on New Technologies
  • Others –
    Interviews / Events / Others

Check us out on Social Media

  • Facebook
  • Twitter
  • About
  • Company
  • Privacy Policy
  • Terms of Service
  • Contact
  • Japanese
  • 简体中文
  • 繁體中文
Don’t Forget to Follow Us!
© Copyright 2016-2023. Device Plus - Powered by ROHM
© 2023 Device Plus. All Rights Reserved. Muffin group

istanbul escort istanbul escort istanbul escort