

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 教程：使用 Amazon IoT 和 Raspberry Pi 监测土壤湿度
<a name="iot-moisture-tutorial"></a>

本教程向您展示如何使用 [Raspberry Pi](https://www.raspberrypi.org/)、湿度传感器，以及 Amazon IoT 如何监测室内植物或花园的土壤湿度水平。Raspberry Pi 运行的代码从传感器读取湿度和温度，然后将数据发送到 Amazon IoT。您可以在中创建一条规则 Amazon IoT ，当水分含量低于阈值时，向订阅了 Amazon SNS 主题的地址发送一封电子邮件。

**注意**  
本教程可能不是最新版本。自本主题最初发布以来，一些参考文献可能已被取代。

**Contents**
+ [先决条件](#iot-moisture-prereqs)
+ [设置 Amazon IoT](iot-moisture-setup.md)
  + [步骤 1：创建 Amazon IoT 策略](iot-moisture-policy.md)
  + [第 2 步：创建 Amazon IoT 事物、证书和私钥](iot-moisture-create-thing.md)
  + [步骤 3：创建 Amazon SNS 主题和订阅](iot-moisture-create-sns-topic.md)
  + [步骤 4：创建发送电子邮件的 Amazon IoT 规则](iot-moisture-create-rule.md)
+ [设置您的 Raspberry Pi 和含水量传感器](iot-moisture-raspi-setup.md)

## 先决条件
<a name="iot-moisture-prereqs"></a>

要完成此教程，需要：
+ 一个 Amazon Web Services 账户。
+ 具有管理员权限的 IAM 用户。
+ 运行 Windows、macOS、Linux 或 Unix 的开发计算机（用于访问 [Amazon IoT 控制台](https://console.amazonaws.cn/iot/home)）。
+ 运行最新 [Raspberry Pi OS](https://www.raspberrypi.com/software/operating-systems/) 的 [Raspberry Pi 3B 或 4B](https://www.raspberrypi.com/products/)。有关安装说明，请参阅 Raspberry Pi 网站上的[安装操作系统](https://www.raspberrypi.com/documentation/computers/getting-started.html#installing-the-operating-system)。
+ 用于 Raspberry Pi 的显示器、键盘、鼠标和 Wi-Fi 网络或以太网连接。
+ 与 Raspberry Pi 兼容的含水量传感器。本教程中使用的传感器是 [Adafruit STEMMA I2C 电容式含水量传感器](https://www.adafruit.com/product/4026)，带有 [JST 4 针转母插座电缆接头](https://www.adafruit.com/product/3950)。