49713 Designing for the Internet of Things
· 18 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
Watering plants have been a problem for my mom. The irrigation system is timed, which means the system will sprinkle water regardless of the soil's moisture level. The big problem with this is that a lot of water can be wasted, even when the soil might be wet already, and that watering can be lacking when the soils are dry. The system needs to be much smarter, while not complicated to employ. According to the client, my mom, the system is best if it can be automatic, because she can be away for a long period of time.
I found the solution to be quite intuitive and feasible, when I discovered that there are soil moisture sensors available in the studio. Since I don't have the irrigation system available around, I decided to use the motor to simulate the irrigation system.
The solution, "Automatic Irrigation System", is set up as the above picture. When the moisture level is low (set up as "<1500"), the motor is off, and the led indication off. When the moisture level is high (">1500"), motor on with different turn frequencies based on the level, and the led on.
int val = 0;
int soilPin = A0;
int motor = D3;
int speed = 0;
int led1 = D2;
void setup()
{
pinMode(soilPin, INPUT);
pinMode(motor, OUTPUT);
pinMode(led1, OUTPUT);
}
void loop()
{
val = analogRead(soilPin);
//
speed = map(val,0,4095,155,0);
//int speed2 = (int)
Particle.publish("Value", String(val));
Particle.publish("Speed", String(speed));//send current moisture value
//
if (val>1500) {
//
digitalWrite(motor, LOW);
//
digitalWrite(led1, LOW);
//
} else {
//
digitalWrite(motor, HIGH);
//
digitalWrite(led1, HIGH);
//
}
// }
analogWrite(motor,speed);
delay(1000);
}
Click to Expand
Ideally:
What really helped me is thinking backward and starting with problems, rather than seeing what sensors are available and figuring what to do with them. When you think of trying to solve the problem rather than connecting all the sensors to function, the solutions will actually be useful to the client.
From my case, I believe that this little prototype can actually solve the problem elegantly, adding a few tweaks. I showed it to my mom via video, and she liked it a lot. The concern is that it should not be the only mechanism that completely replaces the previous one. There should be a double mechanism that acts as fail-safe in case there are malfunctions. She would also want to get information on her phone of the status of the system while away. This can be implemented with deeper incorporation with IFTTT.
Thanks Robert, Dylan and Taylor for the extensive patience guiding me finish the project. Thanks Daragh for the critical insights and Q&As.
https://learn.sparkfun.com/tutorials/soil-moisture-sensor-hookup-guide/all
https://ifttt.com/applets/162588p/add_another_applet?return_to=%2Fapplets%2F94487049d
http://www.futurlec.com/Transistors/TIP120.shtml
A hands-on introductory course exploring the Internet of Things and connected product experiences.
~
January 31st, 2019