hey what's going on guys, I'm Mac you probably don't know me but I've been
working behind the scenes editing videos and doing some recording for the Urban
Farming Guys. This is the first video I've appeared in this summer, but
hopefully I'll be in some upcoming videos as well. Today we're going to be
doing a simple Arduino project. We'll be building APEX, a smart plant monitoring
device. This guy will plug into any plant and
display the happiness of the plant based on its soil moisture as the plant dries
out and the soil moisture goes down APEX will look sad but if there's plenty of
water APEX will look happy. It's a simple project that will teach you the
basics of Arduino, how to code, and also some simple wiring and soldering. It should
be a pretty fun video and I hope you guys enjoy it! Let's get into it. Alright
first up we're gonna need an Arduino this one is a cheap Chinese knockoff but
it'll do the job, next we needed 8x8 LED display it's important that you have the
5 pin version for our code so make sure to compare yours to the one in the link
below the video. We're also going to need a moisture sensor and we're going to
need a capacitive touch sensor, lastly we need a 9 volt battery arduino connector
these come in handy for making the project portable. Oh, I almost forgot this
one... We're also going to need a battery. okay that's all the materials we'll need
for this project. Next up: tools
at the top of our list is of course a soldering iron we're going to need this
to solder all the components together for a final project secondly you're
going to need a computer it doesn't have to be a laptop can be a desktop or
anything that's capable of downloading the Arduino IDE. This will work with
Linux, Windows and Mac. There's a few other things on our list for tools, not
all of them are necessary, but they're all good to have. These include wire
strippers a desoldering gun, rosin core solder, 22 gauge wire, electrical tape and
last but not least a breadboard. Next, I'm going to teach you the basics of setting
up the Arduino.First off, turn your computer on and plug the Arduino in. USB
cable goes in one end and the other end goes in the computer. All right, you're ready
to code! Once you're on the desktop, open up Safari and go to Arduino.CC, this is
the main website for Arduino. We're gonna navigate to the software tab and click
downloads. Once you get to this downloads page
scroll down and click on your respective operating system.This will take you to
another page, click "just download" and this will actually start the download.
Once it downloads we'll be able to click on it and click "open" this will install
the Arduino software and it'll be opened up right into the environment.
Alrigh,t that's all we have to do now navigate over to tools and make sure
that these match. With the arduino IDE setup it's time to put together our
breadboard.To start we're gonna grab the 8x8 LED as you can see it has five pins
so we're gonna plug this into the breadboard and then we're gonna grab the
cables that come with the LED, we're gonna plug them into the back. Now we're
gonna take these cables and we're going to take two of them to voltage and
ground, we're gonna plug them into their respective traces on the breadboard.Then
we're going to take the other three cables, these are signal cables, and we're
going to plug them into 12, 11,&10. Make sure that the colors match
up at the pins on the board. Refer to the circuit diagram if you need
help with this. Okay, it's time for our water sensor, this one has three pins
we're gonna go grab three wires and we're gonna plug these in. Now, for me I
have two female to females, so I plugged the female to female into a male, so I
could plug these into the breadboard. So plug in once again the voltage and
ground and that'll leave us with a signal pin, this signal pin will go into
A5 on the Arduino Uno. This is an analog pin which will give us variable
information. Once that's all hooked up we're gonna grab the button: this is our
capacitive touch sensor, it also has three pins: ground, voltage and signal.
We're gonna plug this into the board right beside our 8x8 LED display, we're
gonna grab another 3 cables. We're going to need one for voltage, one for
ground and one for signal. We're gonna plug in red to voltage, we're going to
plug in black to ground, and orange to the signal. Now we're gonna connect the red and the
black, which is voltage & ground, we're going to connect those to the positive
and negative terminals on the breadboard and then we're going to connect the
orange wire to the seventh position on the Arduino Uno. Okay, now it's time to
plug in the power cables for the Arduino Uno. This is what's going to be powering
everything. We want to put one into the ground and one to the 5 volts, we're
gonna run this in line with the positive and negative traces on the breadboard.
All right, it's time to test out the circuit. What we're going to do for this
is we're going to grab the 9-volt battery and we're going to plug it in.
It'll show a cancel sign for me because I have code already uploaded to the
Arduino, but for you it should just display a fully on 8x8 LED. Alright now
it's time to discuss the code. Here we have our folder on the desktop click it
to unzip it, that'll make a folder open up and double-click on the program.
This is the code we'll be discussing. I'm not going to get in depth on this
code, but I do want to give you a brief overview for those of you who are
interested in coding. Starting from the top, we have our include & define
libraries and then we also have all of our variables, these represent the values
from the sensors as well as including the libraries that are necessary for
controlling the 8x8 LED display, at the bottom you can see that there are bytes
these bytes represent the actual faces displayed on the 8x8 LED.These are bit
values, row by row, in an array, each array represents a different face such as
smile, surprise, meh, sad, dead, and error. Next is our setup
function; this is where we start up the serial output and set up the 8x8 LED. We
then have all of our methods for following the different phases of the
LED display. These aren't super important and they're fairly self-explanatory so I
won't get into detail. Okay, this is super important: this is our
right Arduino on matrix function. What this does is take the values from the
water sensor and calculate what face to put on the matrix, it then writes the
face onto the matrix and it updates every so often to make sure that the
faces are correct. Last, but not least is our loop function
this is what checks for button precedence. We have to make sure that
this is here so that we can turn the display on and off. And that's it for the
code! Once you're ready to push, just go up to the top left and click the right
arrow button, this will push the code to the Arduino. Okay, now that the code is
pushed we're ready to test it out! So you should be seeing a cancel sign: just a
little circle with a dash to it and if we put our finger on it you should see
that it's sad or dead. Now if I put it on my tongue you'll see it it's happy
because it senses moisture, awesome! That means the code is working. Great, so
now we can unplug it from the computer and let's test it on battery, just take
the cable get that out of the way and plug it in, and it works yes!
Let's test it one more time with our finger, Oh and its dead, so it's working.
Now it's time to put together the circuit so I'm going to do a short little montage
of me soldering everything...
Welcome back!! Now that the project is done, all we have to do is test it out
with an actual plant. Here I have a regular fern so we're gonna pick up our
little APEX, we're going to turn him on so we need to plug in the battery first
and he should automatically turn on and now it's time to plug him into the plant
and so in he goes. Awesome! He's happy! and now you'll see, Oh! he's surprised now so
obviously the plant is very very watered. If you guys need any help with this
remember there links in the description for everything. The link to the
instructables will be included which contains a PDF and the circuit diagram
for this project we'll be finishing this project in the greenhouse, so I'll see
you guys there. Alright, we're done! I hope you guys enjoyed this project wait look
the camera a little bit hope you guys enjoyed this project I'll be back soon
enough with another tutorial. Make sure to LIKE and SUBSCRIBE and follow The
Urban Farming Guys for more content. It's a great cause, so if you want to donate,
links below: and also there'll be links to the parts used in this video. If you need to
download the source code that's also in the description. If you finish the
project, leave a comment tell us how you did! Also I'd love to see spin-offs of
this. I'd love to see what you guys create so make sure to send me photos
send me links and stuff and show me what you guys have made! That'll do it for
this video and I hope to see you guys in the next!
Creepy Music......
What the... How...? "I'm sorry, but I can't let you leave Mac. No! No, no, no, no... this can't
be happening! This can't be happening. "Well of course it is Mac, after all you
created me!" HAHAHAHA!!! I gotta get out of here! I gotta get out, Open, open! "Stop struggling ,Mac,
it will all be over soon". HAHAHAHAhaha
Không có nhận xét nào:
Đăng nhận xét