BenHarrison
Published

FlowerShower

Automatically water a plant when soil is detected to be dry, publish environmental data to Adafruit dashboard, with email notifications.

BeginnerWork in progress5 hours50
FlowerShower

Things used in this project

Hardware components

Grove - Capacitive Soil Moisture Sensor
Seeed Studio Grove - Capacitive Soil Moisture Sensor
×1
General Purpose Transistor PNP
General Purpose Transistor PNP
×1
Resistor 220 ohm
Resistor 220 ohm
×1
Resistor 2.21k ohm
Resistor 2.21k ohm
×1
SoilWatch Capacitive Moisture Sensor v2.0
×1
Grove - Air quality sensor v1.3
Seeed Studio Grove - Air quality sensor v1.3
×1

Software apps and online services

Zapier

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Schematics

Moisture sensor and OLED display

For testing the moisture sensor with a cup of dry soil, wet soil, empty cup and cup full of water.

Code

Moisture sensor and OLED display

C/C++
testing moisture sensor with soil and displaying data with time stamps
/* 
 * Project L11 03 Moisture
 * Author: BH
 * Date: 11-9-2024
 * For comprehensive documentation and examples, please visit:
 * https://docs.particle.io/firmware/best-practices/firmware-template/
 */

// Include Particle Device OS APIs
#include "Particle.h"
#include "Adafruit_SSD1306.h"
#include "Adafruit_GFX.h" //dont install .. part of SSD1306


SYSTEM_MODE(AUTOMATIC);

//OLED
const int OLED_RESET=-1;
Adafruit_SSD1306 display(-1);

//const int TEMPFREQ = 10000, MOISTFREQ = 30000, MOISTPIN = A3;
int moistureRead;
String dateTime, timeOnly;
unsigned int lastTime;

void setup() {
  Serial.begin(9600);
  waitFor(Serial.isConnected,15000);
  pinMode(A1,INPUT);
  moistureRead = analogRead(A1);
  //TIME
    Time.zone(-7); // MST =-7, MDT =-6
    Particle.syncTime();
  //OLED
    display.begin(SSD1306_SWITCHCAPVCC, 0x3C); 
    display.clearDisplay();
    display.setTextColor(WHITE);
    //display.printf("Hello World!\n");
    display.setTextSize(2);
    display.setCursor(0,0);
    display.printf("SENSOR READY");
    display.display();

}
void loop() {
    dateTime = Time.timeStr(); //Current Date and Time from Particle Time class
    timeOnly = dateTime.substring(11,19);
    display.fillRect(0, 0, 128, 58, BLACK);
    display.setCursor(0,0);
    display.setTextSize(2);
    display.display();
    moistureRead = analogRead(A1);
  //Serial.printf ("Value =  %i\n", moistureRead);
  display.printf("M: %i\n",moistureRead);
  display.setTextSize(1);
  display.setCursor(0,26);
  display.printf("T: %i",timeOnly);
  display.display();
  delay(1000);
}

Credits

BenHarrison
2 projects • 8 followers
Fine art creator who also enjoys a good hack. Cheers to all the makers out there!

Comments