Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

we are going to make a ebb flow gardening system in which i am controlling the lighting system and i am using Microgreen salad Mix

we are going to make a ebb flow gardening system in which i am controlling the lighting system and i am using Microgreen salad Mix and Ruby stem Radish seeds so i need to make the changes in this code const int ledPin =13;
const int lightPin = A0;
const int relayPin =3;
const int ledPin2=12;
void setup(){
pinMode(ledPin, OUTPUT);
pinMode(lightPin, INPUT);
pinMode(relayPin, OUTPUT);
pinMode(ledPin2, OUTPUT);
Serial.begin(9600);
}
void loop(){
int lightValue = analogRead(lightPin);
Serial.println(lightValue);
// Control the light relay based on time intervals
unsigned long currentTime = millis();
unsigned long elapsedTime = currentTime %86400000;
unsigned long elapsedTimeInHours =(currentTime /1000)/3600;
if (elapsedTime <64800000){// Vegetative Stage: 18 hours on,6 hours off
if ((elapsedTimeInHours /2)%2==0){// If the current two-hour block is even
digitalWrite(relayPin, HIGH); // Turn on lights
analogWrite(ledPin,255); // Full brightness
analogWrite(ledPin2,255); // Turn on the new LED
} else {// If the current two-hour block is odd
digitalWrite(relayPin, LOW); // Turn off lights
analogWrite(ledPin,0); // LED off
analogWrite(ledPin2,0); // Turn off the new LED
}
} else if (elapsedTime <86400000){// Flowering Stage: 12 hours on,12 hours off
digitalWrite(relayPin,(elapsedTime <10800000|| elapsedTime >=54000000)? HIGH : LOW);
}
delay(1000);
} So i need like 12 hours on lights for the seeds and 10 hours off or you can change according to seeds
Apart from this i also need to build the circuit with the rasberry pi explain me step by step to build the circuit with reberry pi code to run the code for lighting system in ebb flow gardening system just for lighting system

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

=+1 Is the decision fair to employees?

Answered: 1 week ago

Question

What is Constitution, Political System and Public Policy? In India

Answered: 1 week ago

Question

What is Environment and Ecology? Explain with examples

Answered: 1 week ago

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago