Notifications
Clear all

Greenhouse monitoring and control

13 Posts
5 Users
2 Likes
868 Views
(@pete60)
Member
Joined: 3 years ago
Posts: 4
Topic starter  

I have 7 Greenhouses, each served by its own cat5e cable to a central hub. I know arduinos are awesome for temperature and humidity monitoring and control. how would I best bring the info from each house together to an arduino/plc. some of the cables would be 150 ft. I2C and SPI are both good for short distances but wouldn't 150 ft be to far? I don't need any kind of speed,only communicating every minute or so. An arduino in every house would be OK. I can Get one arduino to control one house but how do get them tied together. I'm not experienced in any other language than Arduino IDE.


   
Quote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

@pete60

As you have an ethernet cable to each greenhouse then the best method of communicating would be via ethernet. 😎  Your greenhouse sensors would be attached to a greenhouse 'aurduino' type board (or similar, the arduino may not be the best for this) and this local microcontroller would need to be able to be connect to the ethernet (e.g. an arduino ethernet shield), Then you could send messages over the ethernet to some receiving device (desktop computer, single board computer (SBC) or another microcontroller. It all depends on what you want to do the the temperature and humidity info. The communication over the ethernet cables could be via the MQTT message protocol or the HTPP post/receive protocol, and you will find Arduino libraries for both these methods.

Another consideration is whether you have power to your greenhouses. If so, very good, but otherwise you will have to power your greenhouse devices with battery power or maybe Power Over Ethernet.

I give you a vision that is similar to a setup I have. (one greenhouse and one workshop both with power connections) My workshop also has an ethernet connections that has a local wifi router that covers both the workshop and greenhouse. I send temperature and humidity readings from my esp8266 microcontoller boards that have wifi abilities using the MQTT protocol to my MQTT broker running on a Raspberry Pi in my office. The MQTT message is read by my MQTT client program that also resides on the Rpi and the readings are displayed on an attached monitor. The readings are also stored in a database for later analysis. The days Min and Max temperatures are automatically calculated and displayed. Also, depending on the temperature readings, I communicate back to the workshop and greenhouse to trigger a relay to switch a heater on and off. Also a local LCD display attached to the microcontroller will show the current temperature and , on the push of a button, will show the max and min temperatures for the day so I can read the temperatures whilst in the greenhouse.

As I use low powered oil filled heaters that take a while to heat up to then keep a modest temperature, a recent improvement I made was to download the next 24 hour weather forecast that I could download in json format and use in my control program. If the temperatures are set to plummet the heaters will automatically switch on a bit earlier than the current temperature would indicate. A future project will be to trigger a greenhouse watering system to turn on and off at the behest of the main computer.

So it all depends on how ambitious you are. But It's a real luxury to have ethernet cables already in place so I would seek to take full advantage of this route for your comms, and have a read up on MQTT or sending HTPP messages from one microcontroller or SBC to another.

Good luck with your project. 😀 


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@pete60

Posted by: @pete60

I have 7 Greenhouses, each served by its own cat5e cable to a central hub. I know arduinos are awesome for temperature and humidity monitoring and control. how would I best bring the info from each house together to an arduino/plc. some of the cables would be 150 ft. I2C and SPI are both good for short distances but wouldn't 150 ft be to far? I don't need any kind of speed,only communicating every minute or so. An arduino in every house would be OK. I can Get one arduino to control one house but how do get them tied together. I'm not experienced in any other language than Arduino IDE.

To answer your first question... yes, I2C and SPI are not suitable for such long distances.  MQTT (a publish/subscribe messaging protocol), is a very good solution to your problem, that will allow you to connect all of your client devices, for communication with a central server over your network.

Likewise, distance is probably to great for standard WiFi as well, but you can also look into wireless radio devices such as the nRF24L01, or LORA device. The nRF24L01 with external antenna is said to reach ~1,100 metres (not bad for a very cheap device), and LORA devices can exceed that, and I've even heard of some being advertised as reaching ~30 kilometres, but they are more expensive.

Cheers.


   
ReplyQuote
(@pete60)
Member
Joined: 3 years ago
Posts: 4
Topic starter  

@byron Thanks for the help.Now I need to research MQTT


   
ReplyQuote
(@pete60)
Member
Joined: 3 years ago
Posts: 4
Topic starter  

@frogandtoad Thanks for the help. Now to Learn MQTT


   
frogandtoad reacted
ReplyQuote
vieuxgeek
(@vieuxgeek)
Member
Joined: 3 years ago
Posts: 12
 

@pete60 In addition to considering MQTT in the project you may want to look at Blynk.

I'm working on a project that monitors the water temperature, air temperature, and air humidity for a hot tub.  I hacked together a proof of concept based on MQTT and Blynk.  I think the Blynk version  was a little easier to do and the client side is better.  If you want to look at MQTT, let me know and I will post what I did.

Things that you may want to consider when designing your project (in no specific order).

  • Make sure the hardware you use works with the microcontroller board you select.  I'm using an ESP32 so my sensors (DHT22 and DS18B20) needed to be all 3.3v.
  • How will you power you project? I am lucky since I can just plug in the ESP32 using a USB charger.
  • What happens when that power goes out?  I my case, the sensor will be powered all the time but I plan to have a battery to act as a UPS (Uninterruptible Power Supply) to keep the esp32 running if power goes out.
  • If you are using the internet, what happens when the network goes down?  I am just having the client app send a notification when it loses contact with sensor.  Both the MQTT and Blynk options I used do auto reconnect which is nice.  
  • Do you need to be able to monitor or make changes for anywhere?   Using "cloud" services makes this easy - there are free/low cost option for MQTT and Blynk.
  • Are you concerned with security?  I want to have passwords protected but have not figure this out yet.  Mostly concerned about someone scanning and picking up WIFI SSID passwords or take the ESP32 and dump the flash.
  • How much coding do you want to do?  Blynk seems to reduce the amount of coding you need to do; primarily on client side. 
  • What will you use to package the project?  I'm just using a outdoor PVC electrical box.
  • How will you update the "program" on the microcontroller?  I plan to just use my laptop to update - just connect it directly to ESP32 when I need to make a change.  I am going to look at OTA (over the air) but that is just for fun - not concerned if I can't figure it out ...

Not an exhaustive list but hopefully will help. 

When you're retired, every day is Saturday.


   
ReplyQuote
TheOutlander
(@theoutlander)
Member
Joined: 3 years ago
Posts: 79
 

I use Cayenne for similar purpose to monitor temp/humidity in my basement workshop/office. I have sensors on a NodeMCU board, an Arduino and a RPI. I was comparing the different devices & sensors. 

image

"Hardware eventually fails. Software eventually works." - Michael Hartung


   
ReplyQuote
vieuxgeek
(@vieuxgeek)
Member
Joined: 3 years ago
Posts: 12
 

@frogandtoad WiFi could work if he uses a mesh solution.  He can put one node in each green house and one to act as router.  He can use the ethernet cable in a star topology, with an ethernet switch as the hub, as the backhaul network for the devices.  Using mesh devices is very nice since it manages like a single router/Access Point.  Price is not bad since mesh nodes now cost around $75-$100 per node.  

When you're retired, every day is Saturday.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@vieuxgeek

Posted by: @vieuxgeek

@frogandtoad WiFi could work if he uses a mesh solution.  He can put one node in each green house and one to act as router.  He can use the ethernet cable in a star topology, with an ethernet switch as the hub, as the backhaul network for the devices.  Using mesh devices is very nice since it manages like a single router/Access Point.  Price is not bad since mesh nodes now cost around $75-$100 per node.  

Posted by: @pete60

some of the cables would be 150 ft. I2C and SPI are both good for short distances but wouldn't 150 ft be to far?

Yes, that may well be possible.  It's a little unclear, so I'm not exactly sure of the distances noted above, as he mentions that "some of the cables would be 150 ft" (this implies that not all the houses are close to each other?), so, although Wifi is stated to handle that distance in direct line of sight, it's not necessarily the experience of many who've tried it before.

Perhaps we need some more detail?

By the way... those wireless radio devices I mentioned, are often used in a mesh configuration... hence the mesh library available for them 😉

If Ethernet cable is available for network connectivity, then IMHO, I would recommend that over and above anything else.

Cheers.


   
ReplyQuote
vieuxgeek
(@vieuxgeek)
Member
Joined: 3 years ago
Posts: 12
 

@frogandtoad I was thinking something like this : 

WiFi Mesh Example

 

WiFi in each greenhouse using the Ethernet cables to connect all the WiFi mesh nodes.  The Ethernet cables carry the backhaul traffic (inter node traffic).  The WiFI mesh looks like a single WiFi network - one SSID.  Also, you can easily add/remove mesh nodes.  If you need to expand WiFi coverage in a greenhouse then you can add an additional WiFi Mesh node in the greenhouse. The WiFi Mesh Nodes in the greenhouse will use WiFi for backhaul traffic between them.

The benefit of this is the you have WiFI coverage in each greenhouse.  This would let you deploy multiple sensors/controllers in the greenhouse. Also, the sensors/controllers do not have to be where the Ethernet cable terminates in the greenhouse.

Issues: 

  • You need power for the WiFi Mesh Nodes in each greenhouse.
  • If you are concerned about power outages then you need a UPS for each WiFI Mesh Node.
  • You are limited to 100 meters for the total length of an individual Ethernet cable.  You need a Ethernet cable extender if you cable runs are too long. 
  • Lighting likes these cables.  An Ethernet surge protector is a good idea. (Fiber is a better choice for this kind of application but then it cost a lot more ....)
  • Commercially available WiFi Mesh Nodes may not like the environment in a greenhouse.

When you're retired, every day is Saturday.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@vieuxgeek

Fair enough, that may well work too, but so will the nRF24L01 modules, without that cable limitation.

Have you looked at the capabilities of the nRF24L01 in a MQTT or mesh network?

Cheers.


   
ReplyQuote
vieuxgeek
(@vieuxgeek)
Member
Joined: 3 years ago
Posts: 12
 
Posted by: @frogandtoad

@vieuxgeek

Fair enough, that may well work too, but so will the nRF24L01 modules, without that cable limitation.

Have you looked at the capabilities of the nRF24L01 in a MQTT or mesh network?

Cheers.

I am not familiar with nRF24L01 but I will have to investigate when I have time.  When you say "mesh network" are you referring to using the RF24Mesh Library or to something else?  I see there is another mesh library called Painless Mesh.  These both look interesting.  Right now I am (slowly) investigation BLE Mesh since I have a project that may use that.

When you're retired, every day is Saturday.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@vieuxgeek

Posted by: @vieuxgeek
Posted by: @frogandtoad

@vieuxgeek

Fair enough, that may well work too, but so will the nRF24L01 modules, without that cable limitation.

Have you looked at the capabilities of the nRF24L01 in a MQTT or mesh network?

Cheers.

I am not familiar with nRF24L01 but I will have to investigate when I have time.  When you say "mesh network" are you referring to using the RF24Mesh Library or to something else?  I see there is another mesh library called Painless Mesh.  These both look interesting.  Right now I am (slowly) investigation BLE Mesh since I have a project that may use that.

Ah, yes... I was referring to use the "nRF24L01" with the "RF24Mesh Library".  I have not heard of the "Painless Mesh" library before, but will check it out, thanks.


   
ReplyQuote