Magicbit
Published

Agri Irrigation System using Magicbit-(ESP-32)

Modern agriculture is heading towards automation nowadays. In this project, we will make an Agri monitoring and irrigation system.

BeginnerProtip98
Agri Irrigation System using Magicbit-(ESP-32)

Things used in this project

Story

Read more

Code

Agri Irrigation System code

Arduino
// Agri Irrigation System
// Magicbit


#include <ESP32Servo.h>

int SENSOR = 32;
int output_value ;
int upper_val = 70;
int lower_val = 40;

int M1A = 16; //motor drive input pins
int M1B = 17;

void setup() {
  pinMode(M1A, OUTPUT); //configure as inputs
  pinMode(M1B, OUTPUT);
  pinMode(32,INPUT);
}

void loop() {
    output_value= analogRead(SENSOR);
    output_value = map(output_value,550,0,0,100);
    if (lower_val>output_value && upper_val>output_value)
    analogWrite(M1A, 255);//pwm signal
    analogWrite(M1B, 0);  
}

Credits

Magicbit

Magicbit

57 projects • 30 followers
Magicbit is an integrated development platform based on ESP32 for learning, prototyping, coding, electronics, robotics, IoT and more.

Comments

Add projectSign up / Login