# PyPortal IoT Plant Monitor with AWS IoT and CircuitPython

## Overview

Danger: This project's code utilizes the AWS IoT Library, which currently does not work CircuitPython or with AirLift hardware, such as the Adafruit PyPortal. As a result, this project does not currently work (but may in the future).

![](https://cdn-learn.adafruit.com/assets/assets/000/082/460/medium800/sensors_IMG_2519-min.png?1571250592)

**Give your succulent some smarts by building an internet-connected plant monitor with [Amazon AWS IoT](https://aws.amazon.com/iot/) and CircuitPython.**

This smart-planter&nbsp; **monitors your plant's vitals** &nbsp;on the PyPortal's screen,&nbsp; **logs data&nbsp;** to Amazon AWS IoT, and **sends an email to your inbox when your plant needs to be watered**!

Using **Amazon AWS IoT with CircuitPython** allows you to **prototype internet-of-things projects faster than ever before**. With CircuitPython, you're able to **instantly provision your device for AWS IoT**  **by dragging and dropping certificates/keys.&nbsp;**

We've adapted [the excellent Monitoring Soil Moisture with AWS IoT And Raspberry Pi guide on the AWS IoT Developer Guide](https://docs.aws.amazon.com/en_pv/iot/latest/developerguide/iot-moisture-tutorial.html) to work with CircuitPython on microcontrollers.

# AWS IoT

[AWS IoT](https://aws.amazon.com/iot/) is an IoT service for those looking for an incredibly scalable and secure Internet-of-Things (IoT) service.

### Integration with the AWS Ecosystem

Connect your CircuitPython device to integrate with Amazon Web Services such as Amazon S3, AWS Lambda, Amazon Kinesis, and more!&nbsp;

### Security

We've tried all the major IoT cloud service providers, and AWS IoT offers a higher level of security. This is due to features such as secure device provisioning, access-resource policies for device MQTT feeds, and a service to continuously monitor and report potential security threats.

![sensors_1_vIe-kMMyoKQKmxa-qUzIeA.png](https://cdn-learn.adafruit.com/assets/assets/000/082/382/medium640/sensors_1_vIe-kMMyoKQKmxa-qUzIeA.png?1571065612)

## CircuitPython

**CircuitPython is perfect for building Internet-of-Things projects**. This project uses the [ESP32SPI CircuitPython](https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI) library, which can use the ESP32 as a WiFi-coprocessor.

We've built an [CircuitPython AWS IoT](https://github.com/adafruit/Adafruit_CircuitPython_AWS_IOT) helper module to make interacting with AWS IoT _incredibly_ simple. Provisioning CircuitPython devices is as simple as adding your device certificate and private RSA key to a file.&nbsp;

**You can rapidly update your code without having to compile** and store WiFi information and AWS IoT device configuration on your microcontroller. This means that there's no editing code and re-uploading whenever you move the PyPortal to another network - just update a file and you're set.&nbsp;

![sensors_blinka.png](https://cdn-learn.adafruit.com/assets/assets/000/082/381/medium640/sensors_blinka.png?1571065478)

## Prerequisite Guides

This is an **intermediate-level** CircuitPython guide. If you're new to CircuitPython, take a moment to walk through the following guides to get you started and up-to-speed:

- [Welcome to CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython)
- [PyPortal Introduction Guide](https://learn.adafruit.com/adafruit-pyportal)
- [MQTT in CircuitPython](https://learn.adafruit.com/mqtt-in-circuitpython)

## Parts
Featured
### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

In Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
![Front view of a Adafruit PyPortal - CircuitPython Powered Internet Display with a pyportal logo image on the display. ](https://cdn-shop.adafruit.com/640x480/4116-00.jpeg)

Featured
### Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor

[Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor](https://www.adafruit.com/product/4026)
Most low cost soil sensors are _resistive_ style, where there's two prongs and the sensor measures the conductivity between the two. These work OK at first, but eventually start to oxidize because of the exposed metal. Even if they're gold plated! The resistivity measurement...

In Stock
[Buy Now](https://www.adafruit.com/product/4026)
[Related Guides to the Product](https://learn.adafruit.com/products/4026/guides)
![Demo Shot of the Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor in a small potted plant, with wires connecting it to an Adafruit Metro.](https://cdn-shop.adafruit.com/640x480/4026-01.jpg)

## Materials
### STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female

[STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female](https://www.adafruit.com/product/3568)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-PH female 4-pin connectors on each end. These types of JST cables are commonly found on small rechargeable battery packs, RC receivers and transmitters, tiny cameras, and other small electronic devices

We're...

In Stock
[Buy Now](https://www.adafruit.com/product/3568)
[Related Guides to the Product](https://learn.adafruit.com/products/3568/guides)
![Angled shot of 150mm/6" long 4-Pin JST-PH Cable](https://cdn-shop.adafruit.com/640x480/3568-05.jpg)

### Adafruit PyPortal Desktop Stand Enclosure Kit

[Adafruit PyPortal Desktop Stand Enclosure Kit](https://www.adafruit.com/product/4146)
PyPortal is&nbsp;our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Create little pocket universes of joy that connect to something good.

And now that you've made a cool internet-connected project...

In Stock
[Buy Now](https://www.adafruit.com/product/4146)
[Related Guides to the Product](https://learn.adafruit.com/products/4146/guides)
![Demo Shot of the Assembled Adafruit PyPortal Desktop Stand Enclosure Kit.](https://cdn-shop.adafruit.com/640x480/4146-03.jpg)

- [Next Page](https://learn.adafruit.com/pyportal-iot-plant-monitor-with-aws-iot-and-circuitpython/pyportal-wiring-2.md)

## Guide Products

### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

In Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
### Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor

[Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor](https://www.adafruit.com/product/4026)
Most low cost soil sensors are _resistive_ style, where there's two prongs and the sensor measures the conductivity between the two. These work OK at first, but eventually start to oxidize because of the exposed metal. Even if they're gold plated! The resistivity measurement...

In Stock
[Buy Now](https://www.adafruit.com/product/4026)
[Related Guides to the Product](https://learn.adafruit.com/products/4026/guides)
### STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female

[STEMMA Cable - 4 Pin JST-PH 2mm Cable–Female/Female](https://www.adafruit.com/product/3568)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-PH female 4-pin connectors on each end. These types of JST cables are commonly found on small rechargeable battery packs, RC receivers and transmitters, tiny cameras, and other small electronic devices

We're...

In Stock
[Buy Now](https://www.adafruit.com/product/3568)
[Related Guides to the Product](https://learn.adafruit.com/products/3568/guides)
### Adafruit PyPortal Desktop Stand Enclosure Kit

[Adafruit PyPortal Desktop Stand Enclosure Kit](https://www.adafruit.com/product/4146)
PyPortal is&nbsp;our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Create little pocket universes of joy that connect to something good.

And now that you've made a cool internet-connected project...

In Stock
[Buy Now](https://www.adafruit.com/product/4146)
[Related Guides to the Product](https://learn.adafruit.com/products/4146/guides)
### Pink and Purple Braided USB A to Micro B Cable - 2 meter long

[Pink and Purple Braided USB A to Micro B Cable - 2 meter long](https://www.adafruit.com/product/4148)
This cable is&nbsp;super-fashionable&nbsp;with a woven pink and purple Blinka-like pattern!

First let's talk about the cover and over-molding. We got these in custom colors, and if you&nbsp;_have_&nbsp;to have visible cables, then you might as well have the nicest fabric-bound...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/4148)
[Related Guides to the Product](https://learn.adafruit.com/products/4148/guides)

## Related Guides

- [Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor](https://learn.adafruit.com/adafruit-stemma-soil-sensor-i2c-capacitive-moisture-sensor.md)
- [Adafruit PyPortal - IoT for CircuitPython](https://learn.adafruit.com/adafruit-pyportal.md)
- [IoT Power Outlet with CircuitPython and Adafruit IO](https://learn.adafruit.com/adafruit-io-a-c-power-relay.md)
- [Burning Fire Wizard Staff](https://learn.adafruit.com/burning-fire-wizard-staff.md)
- [MakeCode Arcade Pixel Art Sprites](https://learn.adafruit.com/makecode-arcade-pixel-art-sprites.md)
- [Bluefruit Luminary Lanterns with Capacitive Touch](https://learn.adafruit.com/bluefruit-luminary-lanterns-with-capacitive-touch.md)
- [PyPortal Cutefuzz Image Viewer](https://learn.adafruit.com/pyportal-cutefuzz-image-viewer.md)
- [PyPortal Alarm Clock](https://learn.adafruit.com/pyportal-alarm-clock.md)
- [PyPortal Quarantine Clock](https://learn.adafruit.com/pyportal-quarantine-clock.md)
- [Discord and Slack Connected Smart Plant with Adafruit IO Actions](https://learn.adafruit.com/discord-and-slack-connected-smart-plant-with-adafruit-io-triggers.md)
- [Custom Controllers for MakeCode Arcade](https://learn.adafruit.com/custom-controllers-for-makecode-arcade.md)
- [League of Legends Level Trophy for PyPortal](https://learn.adafruit.com/league-of-legends-level-trophy-for-pyportal.md)
- [Quickstart using Adafruit eInk/ePaper displays with CircuitPython](https://learn.adafruit.com/quickstart-using-adafruit-eink-epaper-displays-with-circuitpython.md)
- [PyPortal Event Countdown Clock](https://learn.adafruit.com/pyportal-event-countdown-clock.md)
- [Mouse Painter: Emulate Mice with MakeCode ](https://learn.adafruit.com/mouse-painter-emulate-mice-with-makecode.md)
- [Epoxy Resin Torch Lamp with Touch Control & 3D Printed Base](https://learn.adafruit.com/epoxy-resin-torch-lamp-with-touch-control-3d-printed-base.md)
- [PyPortal IoT Data Logger with Analog Devices ADT7410, Adafruit IO and CircuitPython](https://learn.adafruit.com/iot-pyportal-data-logger-adafruitio-circuitpython.md)
