Green House Automation Project


#1

Hi friends!
I am pretty new to coding and using arduinos, but as soon as i discovered it, I got more and more fascinated!
I’m currently in the mood to automatize as much as i can of a 1400sqft green house (in construction) in the south west of France. I face few problems in my project with the Cayenne plateform. I’m going to explain a little bit about the project and I’ll ask my questions in the end.
New photo by Raphaël Burkhardt

I planned, first of all, to get the rain water from my roof in tanks (4m³ in total), where an UV lamp is working in sync with a little pump to clean the water from bacterias from time to time. This water flows by gravity in the Green House with a Solenoid Valve mounted on a 8x relay to just turn it ON for water to flow and OFF for water stop. I will in the future add zones in the Green House (and Solenoid Valves) as the project evolves. I also planned to gather information about the humidity of the ground and temperature of the air in the Green House to eventually add a little extra heat in the greenhouse in winter or in the opposite case, command a motor to roll up the plastic windows for ventilation.
I also wish to gather information of wind with this anemometer that i haven’t tried yet… (I wish to gather this information in case of strong winds for rolling the windows down to avoid significant wind surface area). And also, luminosity (with a cheap luminosity sensor) to eventually add extra light at some point if really needed.

Beside all of that I also added 4 solar panels to generate up to 4x210W storing it on 8 acid batteries of 100ah each (I know I know terrible mistake in the choice of batteries…) 4 in series x 2 in parallel to have a 48V configuration of 200ah. I have a regulator of charge and an inverterto have a 230V output.

So coming back to my cayenne dashboard, it looks like this :https://photos.app.goo.gl/Gcn4YwZKM23qXlXq1

On the top you can see all the on/off boutons, and on the bottom there is the luminosity on the right and on the left the humidity of the ground.

So there comes the questions :
1 - How to calibrate the humidity sensor? I wish to make it go from 0% to 100%, 0% beeing dry and 100% beeing wet. By the way, there are probably better soil humidity sensor out there, does anyone know where to get a ±30€ soil humidity sensor (in Europe if possible) ?
2 - The anemometer seems great but how to add it to my Cayenne Dashboard and calibrate it like the soil humidity sensor (the wiring shouldn’t be a problem)?
3 - Where can I buy a weatherproof motor capable of rolling up (slowly but surely) and down a very heavy roll window? I thought of the something of greater power then a drilling machine.


I get most of my stuff on amazon but i don’t seem to find much things… is there a good online store in europe for all of these components? I’m also looking for door locks components…
4- Last question, i see tons of attention on the LoRa technology, is it better to wire everything 30m away from the arduino to the Green House or using LoRa sensors would be better with the distance?
5- I tried to add a DS18B20 thermometer and i have tons of errors, here is just an exemple of repeated errors :

libraries\DallasTemperature\OneWire.cpp.o (symbol from plugin): In function OneWire::write(unsigned char, unsigned char)': (.text+0x0): multiple definition ofOneWire::write(unsigned char, unsigned char)'
libraries\OneWire\OneWire.cpp.o (symbol from plugin):(.text+0x0): first defined here

I hope you enjoy reading about all of this, like i’m obsessed with it! I hope you the best and can’t wait for all of this to be functional. Don’t hesitate to add any comment about the project if you feel like.
Thank you in advance for all of your help!


#2

@burkhardtraphael wowww. really nice project.
First of all are you using MQTT or regular connection?

map function can be used and then send the value to cayenne.

you can use a “cayenne.virtualWrite(0, level);” where level is value of wind speed.

you can check this website and see if they do international shipping https://robokits.co.in/motors/dc-geared-motors.


#3

Hey! Thank you for all the useful information!
Ok a tech friend told me to use MQTT but i still have no idea what we are talking about. I understand its a “protocol”… I guess… but i don’t see the advantages, and how to implement it in cayenne. I’m reading more about it now…

I understand that from a tech professional point of view all of that seems pretty clear, but i’m still in the dark on how to code, how to send the value to cayenne, etc… for sure i’m gonna read a lot tonight and how to use the code/variables you just sent me, and complete. :sweat_smile:


#4

Hi, great job on effort and ideas for self sustained grow box.
First

You probably have multiple library calls with include in your code, check te code and librarys used that they dont call OneWire 2 times, next check the locations of library itself, so it does not contain multiple cop of it (C:\Program Files (x86)\Arduino\libraries or C:\Users\username\Documents\Arduino\libraries)

No need, for that, just use the ones you have linked and enjoy life :slight_smile: if you want to achive better watering control, use multiple soil measuring across the vegetables row get average result and let that average activate the pumps.
The only thing that can affect its reading is the lenght of the probes if you want to read data from lets say half meter depth :confused:

In case you want to stop wind from blowing your greenhouse away (maybe i missunderstood this), well in my corner of the world proper positioning and good construction stop this from happening. Get wind data for your location and position your greenhouse acordingly, the slopes give small resistance and front back of greenhouse should be opposite from most frequent wind blow directions.
Otherwise if you open your greenhouse to stop wind it can harm the plants.

A for motor i use this ones satellite dish motors assembly, very strong and rolls up 30m length with much power to spare

As an idea, you can add voltage monitoring to your dashboard for solar system


#5

Thank for your interest and your response!

I’m gonna check your solution right away thank you for it!

For sure thats a great idea! I’ll think about it as the projects gets ‘bigger’.

Its actually the opposite i want to close the plastic curtain if the wind speed is higher than lets say 20m/s, so the wind won’t blow in the green house but willblow around it. I guess it sounds a little gadget that may be useful once in a life time but i found it to be a great feature. The construction is well done, and is supposed to hold strong winds ‘if the windows are closed’, no worries about that.

Is that for tilting the solar pannels? In my case they are attached against a wall with heavy duty iron triangles that i weld myself… I tought about tilting the solar panels, but i technically will have much more power than what the batteries can take so i’ll just forget about tilting… and tilting is not really interesting where my solar panels are, i’m in the middle of mountains and trees. But still an interesting thing to do for sure! I just need to see where the brake even point is in between the loss of electricity that is used to action the motor and the extra gain of electricity that each panel will make. (and eventually the cost of installation).

Thank you again for your ideas!


#6

No this are motors used for satellite dish positioning, other than that they work great for various diy projects, in your case you can use them for rolling up and down the windows. They work from 9 to 28V and have sturdy mechanics, when you apply power the spindle goes in or out depending on the polarity. You can check YT videos for better usage presentation.


#7

have a look at the docs to get started with MQTT https://mydevices.com/cayenne/docs/cayenne-mqtt-api/


#8

I just Installed the MQTT API ! I’m looking now at all the exemples to map the sensors ! Thank you!


#9

Ho ho ho, the schematic image I sent seem a little confusing but the movement needed is rotary not linear. the motion starts from the left, the handle attached on the metalic frame rotates, convert the circular motion 90° along the green house to an arm that stretches as it rolls the plastic up or down, but there is no motor stretching the arm, it just mechanically adjust as the distance changes. This is why i refered to something like a drilling machine motor, to be attached instead of the handle. And its a 10 meters long heavy duty bar that needs some watts to be rolled! :sweat_smile: