Things used in this project

Hardware components:
A000053 iso both1
Arduino Micro & Genuino Micro
×1
Esp01
Everything ESP ESP8266 ESP-01
×1
10167 01
DHT22 Temperature Sensor
DHT11 will work just fine also
×1
Soil Moisture Sensor
×4
Stmicroelectronics l7805cv image
Linear Regulator (7805)
×1
Panasonic eca2am101
Capacitor 100 µF
×1
Mfr 25frf52 100k sml
Resistor 100k ohm
×2
Double-Side Prototype PCB - 4cm x 6cm
×1
Software apps and online services:
Ide web
Arduino IDE
Blynk logo avatars
Blynk
D94d qxu
Autodesk Fusion 360
Hand tools and fabrication machines:
3drag
3D Printer (generic)

Custom parts and enclosures

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

Schematics

Layout
Moisty schem vdqw44yvu1

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();
}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Web Piano (Control Buzzer by Web)
Intermediate
  • 30
  • 3

Web Piano (Web-based Buzzer Control with PHPoC Shield for Arduino)

NodeMCU Home Weather Station with Websocket
Intermediate
  • 310
  • 6

Full instructions

NodeMCU and BME280 Home Weather Station that serves a webpage using Websockets

Arduino 101 Clothes Recommender
Intermediate
  • 18
  • 2

Full instructions

Arduino 101 that tells you the inside and outside temperature and recommends what clothes to wear.

SORT4U
Intermediate
  • 72
  • 2

Full instructions

It's the sorting machine that you've been waiting for. Just throw all your junk in it and let it sort for you.

SORT4U

Team The Avengers

Flightduino 101
Intermediate
  • 494
  • 9

Full instructions

A drone project that uses the Neural Pattern Recognition Module and other aspects of the Curie Module to advantage for creating a cool drone

Arduino 101 BLE App
Intermediate
  • 2,030
  • 24

Work in progress

I want to show you how to make an application and connect it with the Arduino 101 platform for Internet of things applications.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback