Due to the coronavirus outbreak, my family and I decided to go to the countryside. Since I had nothing better to do, I decided to buy an Arduino. I bought the Environmental bundle, which includes an Arduino MKR WiFi 1010 and an Arduino MKR ENV Shield.
The HardwareYou will need:
- An Arduino MKR WiFi 1010
- AN Arduino MKR ENV Shield
- A moisture sensor
- 4-pin Grove to 4-pin male connector
- A waterproof box
- A power supply
To build this project, follow the instructions in the following images:
Once that is done, you will have to dig a hole or find come place safe to put it.
Before you continue, you must know that I didn't have a way to plug it in, so I temporarily used an external power supply. You can use whatever you want, from batteries (DO NOT USE 9V BATTERIES!!!!) to solar panels.
First, we have to include the MKR ENV library, to use the ENV Shield.
#include <Arduino_MKRENV.h>
In the setup, besides the usual code for the cloud, we must add ENV.begin
to initiaize the shield.
if (!ENV.begin()) {
Serial.println("Failed to initialize MKR ENV shield!");
while(1);
Then, for the values to update themselves, we must declare the values as int
in the cloud when creating the thing properties. Then, change the values in the variables, like this:
if (!ENV.begin()) {
Serial.println("Failed to initialize MKR ENV shield!");
while(1);
And that would be it for the code.
Once it is uploaded, you can go to the cloud and see the values received by the Arduino.
This is a great way to monitorize your garden and plants, and it could also be used agriculturally. If instead of an Arduino WiFi you used an Arduino GSM, powered it through a solar pane during the day, and a Li-Po battery at night, It would really revolutionize crops!
Comments