Smart Farm with Wio Terminal
45-60 min
Ages 14+
What Will You Learn?
Learn to program sensors to monitor the weather, using a light, temperature and humidity sensor to present this data on an LCD screen. Like programming a servomotor, for an indicator of this data, creating an incredible Smart Farm with Wio Terminal.
Set Up Arduino IDE
Step 1
Connect your Wio Terminal, with the help of the following tables:
Step 2
Open the Arduino IDE, at the top, go to “Preferences”, in the “Additional Boards Manager URLs” section paste the second link: (https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json).
Now press “Tools” -> “Board:” -> “Boards Manager”, search for “Wio Terminal” and press “install”. This will allow us to program the “Wio Terminal” board.
Step 3
Enter the project repository on GitHub, it contains all the digital files of the project ((MakerCamp-with-MoonMakers—Smart-Farm)) download it.
Step 4
Open the zip you downloaded and open the file “Smart_Farm – Wio-Terminal.ino”, this is the code you will use.
Step 5
First add the libraries, go to “Sketch” -> “include Library” and click on “Add .ZIP Library” and select both missing folders in the Zip.
Now go to “Sketch” – “include Library” and click on “Manager Library”, search for “Adafruit Zero DMA” and click Install. You already have all your libraries!
Run Your Code
Step 6
Now analyze the code:
The first section of line 2-5 you find the keyword, “#include”, this defines each library that you are using in your code.
The next section defines the servomotor together with the temperature and humidity sensor, line 7-10.
Next in line 12 – 21 the variables for the control of the servomotor are declared and the TFT LCD screen is started together with the temperature and humidity sensor.
Then start the “setup ()” section of line 23-45. What is in this function will be executed only once, when you turn on the board the communication of the sensors will begin, such as declaring the pins and placing information on the screen, starting with MoonMakers
In line 47-125 is the “loop ()” function, defining what will be executed while the board is working.
The visual structure of Smart Farm is placed on the screen, along with the sensor values and Makey’s face. Then we have an “if” that checks the data from our sensor to activate the servo motor as well as deactivate it.
You have finished your code!
Step 7
Now download it to your motherboard, select “tools” – “board” – “Seeed SAMD” and press “Seeeduino Wio Terminal”, connect your computer to the Wio Terminal. Then select “tools” – “port” and select your board.
In the upper left there are two buttons, press the arrow, wait a few minutes, while you check your code and download it.
Congratulations! Smart Farm is up and running.
Building
Step 8
Print the templates, cut them out and assemble your indicator with your servo motor.
Step 9
Take a bottle and cut a window on one of its sides, this will be the base. Now with the second bottle, cut it in half, which will serve as a lid. Take the base bottle and cut a small rectangle the size of the Wio Terminal pins, this should be on the opposite side of the window.
Step 10
Cut a circle at the top for the servo motor wires. With the help of the double-sided tape, place the electronics, the Wio Terminal in front and the indicator on the top, do not forget to place the cables inside our bottle, as well as the temperature and humidity sensor. Finally place your power supply to the Wio Terminal.
Step 11
Place the lettuce or plant in the small plastic container and leave it in the base bottle, then put the lid on. You are done! Watch how it grows.
Further Resources
What's Next?
Add Sensors
You can experiment with adding more sensors or indicators for different characteristics on your Smart Farm.
About MoonMakers
MoonMakers — led by Camila and Diego Luna — are a community of creators passionate about knowledge. A Makerspace, an open space with different digital manufacturing machines. And a YouTube channel where we promote science, technology and the maker movement.
MoonMakers have collaborated with companies such as: Sesame Street, Make Community and in Mexico with Educational Television and Fundación Televisa, creating educational content.
We have given workshops throughout the Mexican Republic with: Talent Land, Secretary of Education in Jalisco, Conacyt, Centro Cultural España.
- Wio Terminal.
- USB-C cable.
- DHT22 sensor.
- Sg90 Servomotor
- 3 Cables M - H
- 3 M-M Cables
- Computer with internet access.
- Repository: https://github.com/Diego-Luna/MakerCamp-with-MoonMakers---Smart-Farm
- Wio Terminal Drivers: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
- Arduino IDE on your computer.
- Two PET bottles
- Scissors, cutter or an exact
- Templates
- Double-sided tape
- Small plastic container
- Lettuce or a plant of choice
- Power bank
Vocabulary:
Libraries: The Arduino environment can be expanded through the use of libraries, just like most programming platforms. Libraries provide additional functionality for your use of your programs, for example: working with hardware or manipulating data.
function: is a section of a program that calculates a value independently from the rest of the program.
void: The keyword "void" is used only in function declarations. Indicates that the function is not expected to return information to the function from which it was called.
void setup: The “setup ()” function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The “setup ()” function will only be executed once, after each power-up or reboot of the Arduino board.
void loop: After creating a setup () function, which initializes and sets initial values, the loop () function does just what its name suggests and repeats consecutively, allowing your program to change and respond. Use it to actively control the Arduino board.
pinMode: Sets the specified pin to behave as input or output.
delay: Pause the program for the time (in milliseconds) specifying as a parameter. (There are 1000 milliseconds in a second.)
if: Execute the following statement or set of statements if the condition is 'true'.
bool: Has one of two values, true or false.
int: They are one of the main types of data, and it is used for storing integers.