วันศุกร์ที่ 28 กันยายน พ.ศ. 2561

Arduino 11



To accomplish this project, you will need:

1 x Arduino UNO MEGA Duemilanove or Teensy 2.0 +
1 x LCD display with I2C communication
1 x RTC module with I2C communication
1 x Relay Module opto-coupled to 250V/10A
2 x Modules "Driver" LM-393 general purpose
1 x Soil Moisture Sensor (Hygrometer) KDQ11
1 x Water Level Sensor (Homemade)
1 x Buzzer piezoelectric
2 x LEDs - 10mm, Green
1 x LED - 10mm, Red
1 x LED - 10mm, Yellow
4 x Resistors 150 Ohm 1/4 W
1 x Water pump for aquarium, with filter system (127 or 220V)
1 x Electric Power Cable, 127/220VAC - 10Amps
1 x Socket 127/220VAC - 10 Amps

#include <Wire.h>


#include <LiquidCrystal_I2C.h>


#include "RTClib.h"



// frequency musical notes


#define NOTE_C6  1047


#define NOTE_C3  131


#define NOTE_G3  196

// pins definition


int levelSensorPin = 0;


int moistureSensorPin = 1;


int audioPin = 2;


int soggyLEDPin = 3;


int moistsoilLEDPin = 4;


int drysoilLEDPin = 5;


int pumpLEDPin = 6;


int pumpPin = 7;

// variables


int levelSensorValue;       // stores the level sensor values


int moistureSensorValue;    // stores the moisture sensor values


int j = 0;

String fixZero(int i)
{
  String ret;
  if (i < 10) ret += "0";
  ret += i;
  return ret;
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น