Project showcase
Moisture Monitor - Orchid & Plant IoT w/ Blynk

Moisture Monitor - Orchid & Plant IoT w/ Blynk © GPL3+

A simple 4 channel design/program for monitoring orchid and plant moisture levels.

  • 2,862 views
  • 0 comments
  • 11 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)

Apps and online services

About this project

Project

This is a plant media (soil, rockwool, moss, etc...) moisture sensor and ambient temp & humidity sensor. The case was printed with a Ultimaker2 clone. I designed it to house the soil sensor boards on the underside of the case, with just the probe leads going out.

There is a section in the code that is commented out for push notifications that you can uncomment to enable it.

I needed something to monitor the moisture of my orchids since the media is dense and hard to gauge how moist it is. This program uses the digital pics to momentarily power the sensor, and then takes its reading and sends it back to analog inputs. You need to run this AT command on your ESP8266-01 chip to get the right UART settings: AT+UART_DEF=9600,8,1,0,0

You also must be running the correct AT version on your ESP8266-01 or it won't work either. See this link: https://github.com/blynkkk/blynk-library/wiki/ESP8266-with-AT-firmware

Libraries Needed

  • Adafruit_Sensor.h
  • DHT.h
  • SimpleTimer.h
  • BlynkSimpleShieldEsp8266.h
  • ESP8266_Lib.h

Code

blynk_AT_4x_soil.inoArduino
// AT+UART_DEF=9600,8,1,0,0

//#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <SimpleTimer.h>
#include <DHT.h>
#include <Adafruit_Sensor.h>


#define DHTPIN 9
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);


char auth[] = "you code here";
char ssid[] = "your wifi SSID here";
char pass[] = "Wifi password here";

SimpleTimer timer;

#define EspSerial Serial1

#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

const int soilPin1 = A0;
const int soilPowerPin1 = 5;
int soilVal1;

const int soilPin2 = A1;
const int soilPowerPin2 = 4;
int soilVal2;

const int soilPin3 = A2;
const int soilPowerPin3 = 3;
int soilVal3;

const int soilPin4 = A3;
const int soilPowerPin4 = 2;
int soilVal4;



const int boardLed = 17;

const int numReadings = 6;

int readings[numReadings];      // the readings from the analog input
int readIndex = 0;              // the index of the current reading
int total = 0;                  // the running total
int average = 70;                // the average


int notifyMe = 0;

void setup()
{

	EspSerial.begin(ESP8266_BAUD);
	delay(10);

	Blynk.begin(auth, wifi, ssid, pass);
	timer.setInterval(10000, check);
	dht.begin();
	pinMode(soilPin1, INPUT);
	pinMode(soilPin2, INPUT);
	pinMode(soilPin3, INPUT);
	pinMode(soilPin4, INPUT);
	pinMode(soilPowerPin1, OUTPUT);
	pinMode(soilPowerPin2, OUTPUT);
	pinMode(soilPowerPin3, OUTPUT);
	pinMode(soilPowerPin4, OUTPUT);

	pinMode(boardLed, OUTPUT);

//  digitalWrite(boardLed, HIGH);
}





void check()
{

	total = total - readings[readIndex];

	readings[readIndex] = (dht.readTemperature(true));

	total = total + readings[readIndex];

	readIndex = readIndex + 1;


	if (readIndex >= numReadings)
		{
			readIndex = 0;
		}

	average = total / numReadings;

	Blynk.virtualWrite(V10,average);

	Blynk.virtualWrite(V12,(dht.readHumidity()));
	delay(500);

	digitalWrite(soilPowerPin1, HIGH);
	delay(500);
	soilVal1 = (1024 - analogRead(soilPin1));
	Blynk.virtualWrite(V0, soilVal1);
	digitalWrite(soilPowerPin1, LOW);

	digitalWrite(soilPowerPin2, HIGH);
	delay(500);
	soilVal2 = (1024 - analogRead(soilPin2));
	Blynk.virtualWrite(V1, soilVal2);
	digitalWrite(soilPowerPin2, LOW);

	digitalWrite(soilPowerPin3, HIGH);
	delay(500);
	soilVal3 = (1024 - analogRead(soilPin3));
	Blynk.virtualWrite(V2, soilVal3);
	digitalWrite(soilPowerPin3, LOW);

	digitalWrite(soilPowerPin4, HIGH);
	delay(500);
	soilVal4 = (1024 - analogRead(soilPin4));
	Blynk.virtualWrite(V3, soilVal4);
	digitalWrite(soilPowerPin4, LOW);



//  uncomment if you want push notifications

//    if (soilVal < 150)
//      {
//        if (notifyMe = 0)
//          {
//             Blynk.notify("Dry Plants");
//             notifyMe = 1;
//          }
//      }
//    else
//      {
//        notifyMe = 0;
//      }

}




void loop()
{
	Blynk.run();
	timer.run();
}

Custom parts and enclosures

Case - Bottom
This is the bottom part for the enclosure
Case - Top

Schematics

Layout
Moisty schem vdqw44yvu1

Comments

Similar projects you might like

Moisty v2 - a Plant Moisture Sensor

Project showcase by Mitch K

  • 1,871 views
  • 1 comment
  • 13 respects

The Quantified Cactus: An Easy Plant Soil Moisture Sensor

Project tutorial by Jen Looper

  • 7,386 views
  • 2 comments
  • 26 respects

Plant Monitoring System using AWS IoT

Project tutorial by CJA3D

  • 30,472 views
  • 6 comments
  • 77 respects

IoT Treat Dispenser For Pets

Project tutorial by Arduino “having11” Guy

  • 12,694 views
  • 0 comments
  • 48 respects
Add projectSign up / Login