Forget Me Not is a simple Raspberry Pi-based system you can use to monitor your plant's soil moisture. Realtime moisture readings are displayed online in an easy-to-read graph. If the moisture drops below your chosen threshold, Forget Me Not sends you a text.
The Raspberry Pi (RPi) receives analog voltage readings from a resistive sensor placed in the plant's soil. The RPi only has digital input pins, so those analog readings are converted to a digital signal using an analog-to-digital converter (ADC). The RPi (already connected to the internet) then leverages a Python script to log the realtime readings in Firebase. If the reading is at or below a designated threshold, a text is sent to your phone via the Twilio API. The frontend reads the data stored in Firebase and displays it as an svg-powered graph, which you can access online with your favorite web browser.
These instructions assume that you are familiar with setting up a Node.js project
Connect your RPi to a monitor, mouse, and keyboard for the initial setup. From here on out, you can access the RPi remotely via SSH or a VNC client. For installation, I recommend using the pip package manager for Python.
- Enable the RPi's I2C bus
- Configure RPi for your timezone and keyboard
- Install Python 3
- Install Pyrebase
- Install pytz
- Install Adafruit ADC library
- Sign up for a free Twilio account.
- Install Twilio
- Clone the FMN-sensor repo on the RPi
- Make a commit so git ignores the correct files
- Create a file called config.py in your local FMN-sensor repo
Add the code below to config.py :
# Set the configuration for your app
# Replace credentials with your project's config hash
twilio_sid = '<YOUR TWILIO SID>'
twilio_token = '<YOUR TWILIO TOKEN>'
credentials = {
apiKey: "<API_KEY>",
authDomain: "<PROJECT_ID>.firebaseapp.com",
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
projectId: "<PROJECT_ID>",
storageBucket: "<BUCKET>.appspot.com",
messagingSenderId: "<SENDER_ID>"
}Sign in to Firebase with your Google account and set up a Realtime Database (not Cloud Firestore). Start without security rules (see below) but add security once you've set up the project because otherwise anyone can steal, modify, or delete data in your database.
Click on the "Rules" tab and disable security using the following code:
{
"rules": {
".read": true,
".write": true
}
}- Install react-easy-chart
- Install firebase
- Install Moment
- Clone the Forget Me Not repo on your computer
- Make a commit so git ignores the correct files
- Create a file called firebase.js in your local Forget Me Not repo
- Start up node
Add the code below to firebase.js :
import firebase from 'firebase';
// Set the configuration for your app
// Replace with your project's config object
let config = {
apiKey: "<API_KEY>",
authDomain: "<PROJECT_ID>.firebaseapp.com",
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
projectId: "<PROJECT_ID>",
storageBucket: "<BUCKET>.appspot.com",
messagingSenderId: "<SENDER_ID>"
};
firebase.initializeApp(config);
// Get a reference to the database service
var database = firebase.database();
export default firebase;Resistive moisture sensor
ADS1015 12-Bit ADC
Raspberry Pi 3 Model B or any other Wifi-enabled Pi
Jumper Wires
Raspberry Pi Cobbler Plus
- Connect the RPi to the Cobbler using the ribbon cable and then plug the Cobbler into the breadboard
- Using the jumper wires, connect the pin marked VCC on the sensor to the 3V3 pin on the breadboard
- Connect the GND pin on the sensor to a GND pin on the breadboard
- Connect the SIG pin (analog signal) on the sensor to the A0 pin on the ADC
- Wire up the ADC by connecting the VDD pin to 3V3 on the breadboard, GND pin to GND on the breadboard, SCA pin to SCA on the breadboard, and SCL pin to SCL on the breadboard
