Simple Urban Farming Project
by ALP Electronic Innovation in Circuits > Arduino
529 Views, 0 Favorites, 0 Comments
Simple Urban Farming Project
For sustainable communities we need to be equipped ourselves with right tools & equipment to adapt with the changes.
Here's a simple project if you are thinking about setting up a small to wide scale Urban farming to monitor your plant's condition even on your busy schedules.
This device is expandable to use Internet to post data to the Cloud & send notification to your phone the condition of your farm, so you don't need to bother to monitor every now & then.
This project can monitor the following: - Temperature - Water Level - Light - Push notification to your Smart Phones (expandable to additional features)
Make Your Own Casing
Below is the raw file sets of code that you can refer, there are many ways of doing this. I posted here my sample so that you can start from here to modify. Goodluck! Let me know if you have questions :)
int ledNorm = 8; // if temperature sensor is Normal
int ledPhoto = 9; // if it's Dark it will light up int led = 10; // reserve LED for additional feature int ledDanger = 13; // if temperature sensor reach 30C
const int photoPin = A2; // photo sensor is connected A1 analog int SensorValue = 0;
// include the library code: #include
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// named constant for the pin the Temperature sensor is connected to const int sensorPin = A0; // room temperature in Celcius const float baselineTemp = 20.0;
void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); // initialize the serial communications: Serial.begin(9600); pinMode(ledNorm, OUTPUT); pinMode(ledPhoto, OUTPUT); pinMode(led, OUTPUT); pinMode(photoPin,INPUT); pinMode(ledDanger, OUTPUT); } // this code is for PHOTO SENSOR void photoLight()
{ Serial.println(SensorValue); SensorValue = analogRead(photoPin); delay(5); if (SensorValue == 0 ) { digitalWrite(ledPhoto, HIGH); } else { digitalWrite(ledPhoto, LOW); } }
void loop() { // this code is for TEMPERATURE SENSOR int sensorVal = analogRead(sensorPin); float voltage = (sensorVal / 1024.0) * 5.0; float temperature = (voltage - 0.5) * 100;
lcd.setCursor(0,0); lcd.print("Degree C = "); lcd.print(temperature); delay(1000); if (temperature > 30 ) // if temperature sensor reach 30C { digitalWrite(ledNorm, LOW); digitalWrite(ledDanger, HIGH); } else { digitalWrite(ledNorm, HIGH); digitalWrite(ledDanger, LOW); } photoLight(); }