Its been nearly a year since we started working on using raspberry pi to monitor and control a reasonably sized (20ft x 22ft) greenhouse.
Press enter or click to view image in full size
We got started due a problem that some of our friends faced in rural parts of Nepal, where water is scarce and they cannot grow green vegetables for 4–5 months in a year(https://medium.com/@pravenj/a-bucket-a-day-a-hack-in-agriculture-8b8176b7d285 and https://medium.com/@pravenj/compost-digestion-monitoring-a-challenge-for-kale-d67d88226242). In conversation we realized that it would be possible to spare about 1 bucket (20 liters) of water per day. So we set out with the goal to find out what we could produce with that 1 bucket.
Our solution had to be extremely affordable, spare parts available and reliable as it is to be used in parts where normal access to any technology and sometimes even electricity is not there.
The “We” here refers to 3 electrical engineers (1 with CS major), 3 high school enthusiasts and 1 retired Government official who ran (not farmed) a large scale farm for 15 years very long time back — practically translating to no agriculture experience.
As we read online through a lot of projects that people had used raspberry pi and arduino for, we realized that this was not going to be the average project of monitoring a pot of plant or a small patch. With our experience in agriculture we started to reach out to experts to find out what we should care for.
First we made a small greenhouse where we tested all sensors and controllers individually. When we were satisfied as well as had consumed 2 crops of greens, we built the bigger greenhouse. The bigger greenhouse has been in operation for 5 months now and we have consumed multiple crops of green leafy vegetables, cucumber, pumpkin and produced scores of seedlings that we have transferred to outdoor garden.
Here are some of the ideas that we used and learnings so far.
Right at the beginning we set up some goals through discussions with agriculture experts and tips we got from reading dozens of articles on the Internet.
— Fully closed greenhouse. We visited many farms using greenhouses. Most were using the top covered ones for vegetables. We found fully closed ones mainly used for flowers. Upon discussions we came to the conclusion that this was determined by the infra-structure one needs to put up and the costs associated with them.
— Water, for irrigation, is sprinkled from the top like bath shower simulating the Monsoon rains here in Nepal. We looked at many different forms of irrigation from dripping to flooding. An agricultural scientist explained to us about leeching and thickness of soil in Nepal. That got us away from dripping and multiple other methods that used ground pipes. We looked how much water is taken for vegetables of different varieties. Looking at that we realized that was not too much. So we decided we would try and replicate nature and went for shower style flooding every few days. The pump, controlled by the raspberry pi, is started every couple of days or based on the soil moisture data from the soil moisture sensor and analyzing the temperature and humidity data
Press enter or click to view image in full size
— Carbon Dioxide, while in conversation with the Agricultural Scientist, he mentioned that introducing carbon dioxide to plants normally make them grow faster. He talked about how it is used quite a lot in tomato farming. We wanted to try that, but couldn’t pump carbon dioxide from commercial sources.
So we started asking around and people from the Open Agri team suggested that we could build a pit inside the greenhouse and compost biological waste there. So pit dug inside the greenhouse and all waste and weeding thrown into it. Now we have good compost as well as rise in CO2 levels — how much we have not monitored constantly.
Press enter or click to view image in full size
— LED Light, in many sites people talked about lights. We went through vertical farming, indoor farming, etc… etc… articles and all talked about lights. So we put in lights — LED lights. We put in 3 different colors over 3 different patches to see how they work. Red, Blue and white. From articles it seems blue is good for seeding and red is good for flowering.
— Air Circulation, currently we are using 2 fans, one as intake and another as exhaust.
For an exhaustive list here are a few learnings.
— Finding parts for raspberry pi is a challenge in Nepal. So we need to do more DIY and re purposing.
— Cheap raspberry pi sensors are very hard to work with for something at this scale, probably they are not designed for the kind of rugged use that we have put them in. The soil moisture sensor looses its material coating really fast. So we built our own 2 galvanized steel rod soil moisture sensor and read the data into raspberry pi using an A2D converter. Though not very accurate, this is cheap, rugged and solves our purpose of getting data on a regular basis. Soil temperature sensor also similar issues. We are currently working on trying to come up with cheap Ph meter. Temperature and humidity sensor is working fine, but needs dusting from time to time.
— We could not find extremely affordable CO2 sensor and we could not figure out how to isolate the data for CO2 from cheap gas sensor for raspberry pi. Currently we are using an old air quality egg sensor board mounted on arduino and getting data into rpi through the usb port. We use it time and again to measure CO2 levels. Though not extremely important it would be nice to try and continuously monitor CO2 levels mainly to see its variations with addition of new bio waste to the compost pit.
— We are currently controlling the fans, lights and water pump using 4 port relay found commonly in the local market. The pump is 0.75 horse power. There are 2 fans and 6 lights (2 of each color).
— Fan placement has been a learning. At the beginning we placed one fan on top of greenhouse (as exhaust) and another towards the bottom of the greenhouse at opposite end (as intake). When the intake fan was on, the air was blown directly at the soil surface, drying it up quickly. In this area we could not grow much. Then we changed the intake fan to the top opposite end from the exhaust and now things are better.
— Sprinklers are placed on top. So getting pressure right and making sure the water is received throughout the greenhouse needs us to work on setting right valve and sprinkler placement from time to time. Watering happens during the day after 3–4 days or when the soil gets too dry. Raspberry pi can take over the pump if required. It will control the pump based on temperature, humidity, soil moisture and time of day. Predictive modeling to get more accurate control is being worked on.
— Our LED lights don’t seem to have any effect on seeding, growth or otherwise. Maybe its the height or the light intensity, but we have not found good use of them. We need to learn more on this.
— To reduce humidity to optimal levels, 2 fans are not enough for fully closed greenhouse of that size. Since we are experimenting one idea that we have thought of is DIY atmospheric water generator. That way we could get droplets back probably reducing humidity. We are actively seeking ideas on this. Is 2 fans a requirement? No. Ideally we would want 1 or no fan as they increase initial as well as running cost.
— Seeding happens very fast in the greenhouse. Couple of days and the 2 leaves are out. It takes us by surprise every time. But replanting then outside requires staging them in a semi-open area for a while, then to an open area and finally outside. We tried to take ocra plants directly form greenhouse to outdoor garden, 1/4 of it died and the rest took a long time to recover. Then we tried the staging mechanism and it works well.
Press enter or click to view image in full size
— Green leaves come out very fast. Some green leaves, that normally take over a month outside, took around 21 days to go from seeds to eating size. Creepers grow very fast too. Pumpkin, cucumber and squash are among those that we have planted and got crops from.
— Leaves appear very fast and growth is also fast, but fruiting takes a while and some fruits rot very fast. It is the high humidity. So we are not looking at ways of reducing that.
— We planted tomato plants and it grew well and fast. The Agriculture scientist had told us about tests conducted in UK on tomato with artificial injection of CO2 in the greenhouse. It seems the CO2 from compost pit is having a good effect. We have not monitored it as it the next task on our list.
Regarding using raspberry pi as monitoring and controlling device, it has worked for us continuously for 8 months without a casing, no fans or anything to cool and left out there in the open. Proof is picture. All sensors have also worked well, in-spite of some hiccups. Those hiccups we attribute to scale at which these sensors were designed to work and where we are putting them to work. Though there is a lot more to do, this is a start where we can scale the raspberry pi to handle multiple greenhouses and produce the best green vegetables.
Note : we are looking for more suggestion, advice, collaboration and partnership to further this. Please contact if interested.
This project is a collaboration among Pravin Raj Joshi and Pramod Rijal.
Pramod Rijal is responsible for the circuit design and hardware setup. Pravin Raj Joshi looked after concept designs and greenhouse setup.
Pramod Rijal is electrical engineer who is currently employed by Nepal Electricity Authority.
Pravin Raj Joshi works in innovation, currently looking at setting up small innovation labs at public schools, called Tinker Lab.