Skip to content

tobobo/plant-tamagotchi

Repository files navigation

Plant Tamagotchi

A face for your plant that might help you remember to water it, with a web frontend that lets you check how fast your plant dries up.

Hardware

Assembly

Display setup

I found it a bit tricky to connect the display to the board—it's kind of a flimsy ribbon cable that you need to push pretty firmly in to its connector.

Grove HAT + moisture sensor

The capacative moisture sensor is an analog sensor. Connect it to port A0 on the Grove base HAT.

Putting it all together

You should be able to stack the Grove HAT and E-Ink display. First push the Grove HAT (with the moisture sensor attached) in to the Pi, and then push the E-Ink display in to the Grove Hat's 40 pin connector. They don't fit as snug as they could, but it should make sufficient contact for everything to work.

Raspberry Pi setup

Prerequisites

I used the Raspberry Pi Imager to put a Raspberry Pi OS Lite image on the Pi. In order to be able to SSH to the Pi, I also added the following files to the SD card before inserting in to the Pi.

Sqlite3

You'll need to install Sqlite3 to save your plant's moisture readings and show them on the web server.

sudo apt-get install sqlite3

Python libraries

After SSHing in to your Pi (by default you should be able to do ssh [email protected] with password raspberry, which you'll be prompted to change), you'll need to do some initial setup to install the libraries that allow all the hardware to work.

E-Ink

  • Complete the "Enable SPI Interface" and "Libraries Installation" steps (on the "Hardware/Software setup" page) from the Waveshare 2.13" e-Paper HAT guide. Be sure to use the Python 3 instructions.
  • If you'd like to download and run the examples (not necessary to build this project), you'll need to change the pin definitions as described in this guide. For the E-Ink display I used, the epd_2in13bc_test.py file worked.

Moisture sensor

  • Use the Python 3 steps to install Seeed Studio's Grove.py library.
  • You can test that you're getting readings from your moisture sensor by running the grove/grove_moisture_sensor.py file—note that the default ranges seem to be off in my tests, they may be for a resistive moisture sensor (the output of the above script will always read "wet").

Setting up this respository.

You do not need to clone this respository to your Raspberry Pi—the deploy script can be used to sync your code from your development computer to the Pi so you can easily iterate on the code.

Copy .env.sample to a .env file to set up your configuration.

cp .env.sample .env

Edit .env and update the values according to your needs. PI_USERNAME and PI_HOSTNAME may need to be changed if you changed your pi username/hostname after setting up the raspberry pi. You may need to change SSH_LC_CTYPE if you see error messages related to LC_CTYPE when deploying the code to your pi, but the default setting should work if you haven't changed language settings on your pi. WEB_PORT is used to set the port if you want to test the web server locally.

Install Python dependencies

Deploying to your pi

If you've set up your .env file, you should be able to deploy the necessary files to your raspberry pi by running ./deploy. You may be prompted twice for your Raspberry Pi's password. If you'd like to avoid this, you can follow the instructions for passwordless SSH access on your Pi.

If all has gone well, you should be able to see your E-Ink display flash a few times and show an image based on the moisture reading its receiving from the sensor!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published