book collections email follower instructable user

I designed a CNC Arduino Plant Watering machine for my local high school science and engineering fair. I ended up getting second place in the maths and engineering category, won $200 from the Missouri Society of Engineers, and was invited to compete in an international science fair in New York. With all that said this is not going to be a full Instructable of how to create this step by step. It is more of how I went about doing this along with tips to hopefully inspire others to want recreate my design and improve upon it.

Also I would really appreciate a vote for my project in the gardening contest! Thank you

Step 1: Gathering Parts

I started off this project by gathering my parts. This includes,

*10 Pack Black 2020 Aluminium Rods

*1kg Green PLA Filament

*1kg Black PLA Filament

*1X Endstop Switch

*12v LED Grow Light Stirp

*4X Linear Bearings

*12v Submersible Water Pump

*4X Arduino Soil Hygrometer

*6mm 20 Tooth Belt, Gear, and Pulley

*Arduino Uno

*3X 5v Single Channel Relay Module

*Nema 17 Stepper Motor

*Nema 17 Cable

*L298n Stepper Driver

*Water Reservoir

*PC Power Supply

*LOTS of Jumper Cables

*RTC Module

*Perf Board

*5ft of Acrylic Tubing

*4x Metal Bread Tins (Used to Hold Plants)

*Potting Soil

*Clear Spray Paint

*Wire Connector

*Multiple Screws and Bolts

I also used many 3D printed parts I designed along with other small random parts. In total the cost of this project was a little above $400.

rohr463 months ago
Hey nice project. I hope its not unpolitely to ask, but next
year i am going to have a final project in my crafts teach mechatronic.
And I am thinking about rebuilding this project. So my question is to
you have detailed plans or files of this project that i could use to get
through this hard final exam?

thank you in advance

daily3dprinting (author)  rohr463 months ago
This and my YouTube video I made are the most detailed things I have put out about my project so far, sorry. But if you want to email me with any more questions you have about the project I would be glad to try and help you out.
bruno624 months ago
Where have you found your water reservoir please?
daily3dprinting (author)  bruno624 months ago
The water resevoir was a plastic tank made for holding drinking water ffrom Walmart.
Ok thanks!
Beautiful project !!!
Captain_Nemo4 months ago
Those strip lights are junk, regular old florescents are much better.
JustinS3594 months ago
Nice job! Would you ever create something like this to sell on the retail market?
daily3dprinting (author)  JustinS3594 months ago
I have had a lot of reccomendations to market it, but I dont see myself doing it anytime in the near future.
Well if you decide, then I wish you the best!
I was on an irrigation project for 12 plants, which I then increased to 16 plants using self-irrigating pots.
These vessels are plastic vessels, which have a hole in the middle. In this hole you put a tight rope, which absorbs the water from the bottom up, so that the plant does not get low water, but rather constant direct moisture in the roots. The ambiance is the natural, over a large table.
Well my project was to keep those pots with enough water.
I used one gallon of water, a small hose attached to a PVC pipe with individual valve outlets for each pot. Each vase had 3 wires to control the pot level of the pot. I did not use arduino, I used analog electronics (there are kits for sale - mounted or mounted, on Aliexpress). I bought one of these kits and made the 16 controllers myself. Each valve was controlled by a good amperage relay.
But it did not help me. Just tests. At the moment of putting everything together, I had to get rid of all the plants, because of the dust (here the environment is a lot of industrial dust -> Ipatinga-MG / Brazil -> Usiminas and Cenibra. pulp mill). Usiminas = 19 ° 21'10.97 "S 42 ° 32'36.98" W.
Cenibra = 19 ° 18'48.42 "S 42 ° 23'30.20" W.

OMG! This monster is huge! How can you tolerate that?,-42.5422102,3326m/data=!3m1!1e3
I live to the left of the industry (Northwest), and there is a hill reducing wind and dust / gases. Worse is for those who live right or south of the industry.
It looks like the picture was taken during a blast from the blast furnace, because it's quite black in that area.
daily3dprinting (author)  Maurilio-gm C.C4 months ago
That sounds like a really cool roject, thank you for sharing!
ChristopherS34 months ago
Great post. My son has built some remote monitoring devices and is looking into working on a device to manage in door shrimp farming so he will get a lot out of what you have done.
daily3dprinting (author)  ChristopherS34 months ago
Thank you for letting me know, I love it when others can learn from things I have done and are able to use it to help them in some way.
RobertM7054 months ago
This is a important technology for feeding people on Earth and maybe more directly feeding space colonists. I hope you continue developing this and conciter working with space x on ideas for their Mars colony.
daily3dprinting (author)  RobertM7054 months ago
Thank you, I would love to be able to work with Space X on something like this!
Pashn814 months ago
I was thinking same thing. That if you didn't get first must have been some pretty remarkable competition.
ChrisD547 Pashn814 months ago
My thoughts exactly!
JohnyModem4 months ago
Very cool project.
To help with plant root growth it often helps to have a little breeze blowing over the plants.
Good strong roots will help to reduce time growing as nutrient uptake into leaves etc occurs more quickly allowing your plants to get the most out of the "daylight".
daily3dprinting (author)  JohnyModem4 months ago
I waswondering if not having a breeze would affect the plants, would just a pc fan mounted by the power supply be sufficient?
For small plants, perfect.
daily3dprinting (author)  JohnyModem4 months ago
Great, do you think it shoudl run 24/7 or should I have it on the same relay as the lights?
I think that running of the same relay should be ok.
azureblue4 months ago
I don't know how well this is going to format, but here's a partial code rewrite, with plenty of comments inline to explain the motivation behind it:

int p1 = A0; //Plant One Hygrometer
int p2 = A1; //Plant Two Hygrometer
int p3 = A2; //Plant Three Hygrometer
int p4 = A3; //Plant Four Hygrometer

// Group together all attributes related to a single plant
struct plant {
int hygrometer; // Analog pin the hygrometer is connected to
int threshold; // How moist the plant likes to be
int stepOffset; // Where the plant is

// A relic from 'C' (the language) that allows us to work in terms
// of 'Plant's rather than having to type 'struct plant' all the time
typedef struct plant Plant;

// Description of all of our plants. The values inside {...} are assigned
// to the properties of a Plant in the same order (so for the first plant,
// hygrometer = p1, threshold = 700, stepOffset = 50)
const Plant plants[] = {
{p1, 700, 50},
{p2, 600, 900},
{p3, 700, 1750},
{p4, 900, 2550}

// Have the compiler work out how many plants we've got by dividing the size of
// the data structure which describes *all* the plants by the size of the structure
// to describe *one* plant. This way, we can add or remove plants (in the array above)
// and we won't need to remember to update the count.
const int plantCount = sizeof(plants) / sizeof(Plant);

// Declare functions that we'll define the implementation of further down the file
// Breaking code up into small chunks of closely related functionality makes our code:
// a) easier to understand when we come back to it a week/month/year from now
// b) easier to change (maybe re-order things? change how a decision is made?)
// c) at the highest level, it reads more like a sentence. All the fine details are
// hidden away further down. (See loop(), below)
void moveToEndStop();
void moveBySteps(int steps);

// Specifying a default value gives us the option of asking for a specific
// delay if we want to (runWaterPump(7000)) or getting the default if we don't
// care (runWaterPump())
void runWaterPump(int duration=10000);

void loop() {
// By having several descriptions of *what* we want to do something to,
// but only one definition of *how* to do it, we no longer have to update
// four pieces of code to make one change. This makes for less error-prone code.
for (int plant = 0; plant < plantCount; plant++) {
// Get the dampness
int moisture = analogRead(plants[plant].hygrometer);
// If *this* plant needs water, move to it
if (moisture > plants[plant].threshold) {
// ... and water it

void moveToEndStop() {
// Logic for finding moving to end stop here

void moveBySteps(int steps) {
// Logic for moving a set amount here

void runWaterPump(int duration) {
// Logic for running the water pump here

I hope the comments explain things, but ask questions if they don't.
daily3dprinting (author)  azureblue4 months ago
Thank you for taking the time to help out, above are you grouping each action into its own loop. For instance there is a loop for just controlling the ligths, and a loop for just controlling the water oump. If so does this make it easier for the Arduino?
I didn't try to reproduce all of your code, so I have left the lighting bit out. I was just trying to show a neater way of doing the same thing (test, move, water) to each of the plants, without repeating the code over and over (basically what kcribbs is asking). Your own version of loop() was fine - call one function to handle the lighting, call another to handle the watering logic. To turn my suggestion into a complete solution, you'd want/need to reintroduce some of your own code (the lighting, the end-stop detection etc.). I'd suggest copy/paste it into the Arduino editor, fix the indentation and then see if it's clearer.

One thing that might be worth considering is putting a big delay into the main loop (1 minute? 10 minutes? 1 hour?) - this is quite a slow moving system (plants take a while to dry out), so you don't really need to keep checking every few milliseconds (or whatever speed loop() would naturally run at). Not a major problem in your case, but if it was a battery powered system you'd want to use as little power as possible.
daily3dprinting (author)  azureblue4 months ago
Ok, I will try to mix some parts from both codes. Thank you
Anytime you find yourself writing the same code more than once, it's a good idea to ask yourself if you could make it into a function (or a loop).
If you get stuck, comment on here again and I'll try to help out.
Wow. Unfortunately the Instructables formatter thinks it knows best and it removes all leading white spaces, ruining any attempt to indent code for readability.
kcribbs4 months ago
Why static functions for each plant? Why not build a loop with a static number of plants listed. That way this code can be dynamic?
kcribbs kcribbs4 months ago
using namespace std;

int main () {
// Local variable declaration:
int a = 10;

// while loop execution
while( a
cout a++;

return 0;
daily3dprinting (author)  kcribbs4 months ago
Oh ok, Thank you
daily3dprinting (author)  kcribbs4 months ago
Do you have an example? Like I mentioned above this is by far the biggest code I have undertaken yet so it is very rough still.
Malhar264 months ago
That's really a great idea. Great work. I wish that I could built something like this.... Anyway Good luck!!
daily3dprinting (author)  Malhar264 months ago
Thank you, with enough time to read through all the Instructables on this website you can learn some pretty amazing stuff too.
butter144 months ago
You got second place? Should of been first place if you asked me.
daily3dprinting (author)  butter144 months ago
Thanks, there was some competition
I was thinking same thing. That if you didn't get first must have been some pretty remarkable competion.
This is a really great project idea and build! Thanks for sharing it as your first instructable. :) Congrats on your science and engineering fair achievements and good luck with the International Fair!
1-40 of 52Next »