What's new
  • Please note members who been with us for more than 10 years have been upgraded to "Veteran" status and will receive exclusive benefits. If you wish to find out more about this or support IcMag and get same benefits, check this thread here.
  • Important notice: ICMag's T.O.U. has been updated. Please review it here. For your convenience, it is also available in the main forum menu, under 'Quick Links"!

IOT - Irrigation Controller - Xiaomi Plant Monitor/Sensor

D

dutty

Just wondered nobody is going nuts with the new possibilities out there, even my cats blanked got an IP address now..

Im talking about mini computers like raspberry pi, wireless sockets like the sonoffs (eps8266) and in detail xiaomi flower/plant sensors/monitors

Im a geek from birth so it was just a matter of time to automate and log my grows. It took me far to long but im finaly there and im asking myself why i didnt start years ago. Guess the biggest problem was the lack of hardware and the naked code that had to be written.
Alternatives are f.e. the smartbee controller. But prices are heavy. Just the irrigation system costs 3000..

so i started my own.. and ended up with under 100 bucks. How?!

My central unit is a raspberry pi ZeroW running Linux.

3409-00.jpg


Released this year, it is smaller than a credit card, with wlan and bluetooth. Sd card slot, miniusb, mini hdmi. Basicaly a little computer with the power (and power consumption) of a 4 year old smartphone. Thats enough for my purpose.
Costs 11eu (without a case, micro usb power cable or sd card).

I couldve wired some relays to the pins of the raspberry and turn pumps on and of this way, but since i have more than one room and more than one tank/pump i was looking for a more flexible solution.
Ir switches are not reliable enough since there is no confirmation about the switch state...

I came up with sonoff wlan sockets.

sonoff1.jpg


They cost 5eu (china) and with some soldering skills that i havent had before i flashed them with custom firmware (tasmota). They can now be controlled by webapp + raspberry pi and can carry additional sensors. I wired a high class bme280 temperature/humidity/pressure sensor to it (6eu).

But the actual star in my team is this little guy here: The xiaomi plant sensor

Original-Xiaomi-Mi-Flora-Monitor-Digital-Plants-Grass-Flowers-Soil-Water-Light-Smart-Tester-Sensor-for.jpg


I saw some other sensors, but they were not reliable or to expansive.

Pros:
Wireless (Bluetooth 4.1 BLE)
4 Sensors in one - Moisture, conductivity (EC/ppm), light and air (not soil) temperature.
Cheap: Ordered from china i payed 11eu a piece (International Version)
Lasts a year with one little battery
capacitive (they dont disolve in soil like cheaper sensors)

Cons:
A bit short
Just Bluetooth (with all its disadvantages, more later)
Initially just to use with the android/ios app

the sensors are meant to be used by the app only. Biggest disadvantage of them are the lack of notifications. They dont call when the soil is to dry. The information can just be retrieved (by smartphone), not sent by sensor on its own.

Thats why you need a "computer" thing that scans the sensors in a regular bases and process them to send the data to the database or a notification service or...
There is a fan base already. A guy wrote a python script that can easily be installed. After that (and some configuration) it collects the data.

I said something about coding... well, even thats different these days. Yes, coding skills are necessary, but the skill can be at script kiddy level, like mine is.

There is a tool called node-red

node-red-screenshot.png


Its a graphical programming tool. A web app that let you easily wire components together without coding them. There are a lot of "nodes" that take care of functions you would have to code, like filter data, implement switches, write data to a database and so on.
For special functions theres also a function node where you can write your own javascript code (i used it to f.e. calculate my tank level).

Additional software i used:
InfluxDB, database for time series data.

Grafana, a beautiful visualization tool for time series data

687474703a2f2f646f63732e67726166616e612e6f72672f6173736574732f696d672f66656174757265732f64617368626f6172645f6578312e706e67


Node red Dashboard
an easy to customize dashboard for node-red.

(Mosquitto, a service that controls the communication between sockets and pi)

What my system does:

It logs the sensor data based on room and plant(name)
it calculates average, min max, pitches and so on
It shows predictions (when to water, when to fill tank next time)
it starts the pumps based on calculations by a water content calculator (inspired by cannas recommendations about watering a container plant).

Im still to lazy to write my own android app to get notifications, and so far it was to risky for me to make the node red dashboard public to the internet, so i took the easy route and used the telegram chat bot node. With this its easy to get notifications and control the system.
F.e. i get a message when my pots are at 60%moisture. In this message i include 3 buttons like "water now" and "later" that react instant after pressed. Its lovely.

With this i didnt drown my roots even once - no claws
I havent forgot to fill my tank because i was to lazy to raise the cover.
My mothers didnt freeze after lights off because i found problems in my climate.
i dont have to open rooms to check climate/lights/water.. I look at my smartphone.. on the train
My fogger wasnt empty for days.. hours, if any
I differentiated my strains by thirst

the real power of the sensors is in soil. I use them in coco and had to make some adjustments so the moisture content can be used (automatic max min calibration). The conductivity/ppm sensor cant be used properly in coco, shows really low values, the coco seem to store the nutrients in the fibres...


My system still isnt ready for public. I would like to release it or a manual and some code after the second run without any bigger problems. But i can help with tutorials and documentation if somebody is interested..

I just want to show whats possible and give some ideas. I worked 3 loose months on it with little to no clue about linux or related stuff. I had changed code (script kiddy level) here and there but never did a whole project.

Next i will implement a smart climate controller to the pi. My step transformer has 8 steps and i use 2 with a stone age thermostat... future here we come.


love.. beep buuup
 

queequeg152

Active member
Veteran
there is no point imo.

all you really need is a gateway(even this is debatable) to log data and or push data- realtime or otherwise, to your email or phone or SMS or what ever, and you dont need a zigbee network to do this.

also IOT is- in general and abomination of, "because you can, doesn't mean you should".

there is no value added in programming a climate controller verses a simple 2 stage thermostat w/ either a heating contact, or an additional heating thermostat.

there is also no value added in programming plug loads to be controlled via a wireless relay board or a wired board or Ethernet board or usb board... there is also no value added in a microcontroller based irrigation controller verses a 100 dollar drip irrigation controller.

i think folks are looking at programmable micro controllers and seeing them as a panacea because they dont understand standard hvac control schemes, or relay logic in general they assume this is the only way or the best way to build very very simple control schemes.

also the sensors sold with these microcontrollers are generally shit, or not suitable for anything beyond hobby use. the RH sensors you see on on these arduino websites sometimes dont even have shields over the film sensors... meanign they are easily contaminated with moisture or dust.

the sensors they do sell with stainless screens and or fritted glass protectors are coupled to shitty Chinese humidity sensors... you are better off just buying a honeywell RH transmitter and feeding it into a standard analog input controller or just an RH controller.
 
D

dutty

I worked with simple logic about 10 years now. And while i agree that a climate controller has not much use except smoothing the transitions between stages, insert day AND night temp/hum threshold, and reduce noise (since largest stage wont be used much anymore) there is much use for a soil moisture sensitive irrigation system. In my eyes this is one of the most problematic tasks for a grower. When to water and when not.
Yes, experienced growers know their job. But while you can control EC, ph and stuff, there is just the "finger in soil" or "weight the container method" and a lot of ppl get claws from oxygen deficit without even knowing what they did wrong.

F.e. you are watering 2 times a day by timer. You stress them i dont know why, lets say the EC is to high.. the girls stop drinking and after 2 days you threw to much water at them so they drown.
Most growers would assume the high EC is the reason for the claws...

the sensors you are talking about are not different from the sensors built in all in one ready to use sensor stations you know.
These stations use cheap dht11 or dht22 sensors for the most part with open grid housing and stuff. There are manufacturers producing sensors and manufactures using them. I dont believe they invent their product from scratch, from battery to lcd to sensor. They are just parts put together and sold as new product. To assume there are special sensors just used by Hobbyists and IOT folks is wrong.
This post was not for "buy some plug and play be happy" folks or beginners, maybe i shouldve mentioned this more. But for ppl that are interested in tinkering. Sometimes including building a proper housing/shield for a sensor.
Also i said that i spent some more for my temp/humidity sensor which passed a lot of tests against expensive industry sensors.

To say generally shit is generally shit if you dont know shit about that shit :tiphat:
 

getpulse.co

New member
I fully support your DIY project, I'm a tinkerer for life, but that's just my experience with IoT in the grow room.

I've tried many IoT products, both in my home and grows. Bottom line is that even the major networking equipment companies are not able to execute on reliable remote automation. This in mind, I would have hard time changing my entire setup to implement an all-in-one controller as this would introduce a single point of failure.... and we aren't talking about Belkin, D-Link, or Linksys that are manufacturing these products. So why would they be able to get it right when the megacorps can not.

I was patiently waiting for a simple, reliable WiFi outlet to control my irrigation pump. I wanted to be able to turn the pump on for a few seconds while I was away. Problem is that they don't always work, so you think you've watered but you didn't. Ok fine, still was still a little bit convenient to not have to plug/unplug the pump when watering. Until I came home to a flooded room -- the WiFi outlet had activated itself and emptied 200gals. That was the end of that. These were TP-Link and Belkin WeMo "smart" outlets.

Most people have "dumb" controllers already and they incredibly reliable, why mess with that? The controllers work fine, you can dial them in by understanding your environment better through data.
 

queequeg152

Active member
Veteran
I worked with simple logic about 10 years now. And while i agree that a climate controller has not much use except smoothing the transitions between stages, insert day AND night temp/hum threshold, and reduce noise (since largest stage wont be used much anymore) there is much use for a soil moisture sensitive irrigation system. In my eyes this is one of the most problematic tasks for a grower. When to water and when not.
Yes, experienced growers know their job. But while you can control EC, ph and stuff, there is just the "finger in soil" or "weight the container method" and a lot of ppl get claws from oxygen deficit without even knowing what they did wrong.

F.e. you are watering 2 times a day by timer. You stress them i dont know why, lets say the EC is to high.. the girls stop drinking and after 2 days you threw to much water at them so they drown.
Most growers would assume the high EC is the reason for the claws...

the sensors you are talking about are not different from the sensors built in all in one ready to use sensor stations you know.
These stations use cheap dht11 or dht22 sensors for the most part with open grid housing and stuff. There are manufacturers producing sensors and manufactures using them. I dont believe they invent their product from scratch, from battery to lcd to sensor. They are just parts put together and sold as new product. To assume there are special sensors just used by Hobbyists and IOT folks is wrong.
This post was not for "buy some plug and play be happy" folks or beginners, maybe i shouldve mentioned this more. But for ppl that are interested in tinkering. Sometimes including building a proper housing/shield for a sensor.
Also i said that i spent some more for my temp/humidity sensor which passed a lot of tests against expensive industry sensors.

To say generally shit is generally shit if you dont know shit about that shit :tiphat:

yea random thermostat/humidistat, or humidity transmitter manufacturers DEFINATLY do not build their own finicky SMD humidity sensors or LCDs... thats was never my point obiviously.

Im saying all of these random projects you see popping up on these boards using arduino boards and 5 dollar adafruit humidity sensors are misguided as serious solutions because there is much more that goes into sensing humidity than just a bare chip.

i have an array of Omega humidity sensors/transmitters that use honeywell analog RH cans w/ an RTD to compensate... they all have stainless mesh and glass fiber filters to protect the PCB... the PCB itself has a pair of trim pots for temp and humidity calibration... the PCB is conformally coated, and the connections are all booted with heyco glands etc.

these Omega sensors dont even cost that much... which is more to my point, why fuck around with these I2P chips and and a micro controller when all you are doing is LITERALLY controlling relay operations... what is the point? on is on and off is off whether you do it with a micro controller or a humidistat or some cheap 4-20ma controller.

you just dont need a microcontroller for this shit.

i get that you would want to tinker with shit, but you honestly just dont need or even want to do it with a microcontroller, if you want to build something you are going to be way better off starting with quality parts and sensors like the johnson controls thermostats, and process controllers( EC, Ph ORP etc) from HACH, emerson/rosemount etc.

you do have a point so far as data aquisition or data logging though. But again daq shit is literally a multi billion dollar industry already, and because there is nothing particularly unique to greenhouses or grow rooms ... you are going to have to do an insanely good job with your software to make any inroads there, though i would not discourage you from trying.

microcontrollers are cools as shit dont get me wrong, i mean you can do shit like build a pinball machine with a 15 dollar micro controller and a set of relay boards. back in the day it would have required an ungodly expensive PCB. but its just not worth while for something so simple, there is just no value added... EVEN with respect to EC and PH and moisure control.

now so far as soil/media moisture?

again this is just not necessary... its much much much easier to simply monitor runoff quanties with a tipping bucket for total volums. this is a much better solution and is what is( and has been) used at greenhouses for years and years...

i suppose you could monitor soil moisture for growers outside where runoff is not possible to measure? but even if thats what you were tying to do... this xiaomi sensor is complete shit.

its a conductivity based moisture sensor. these have never been particularly usefull.
capactive sensors are better, but what you really want are tensiometers geared towards what ever soil type you are using... this is because tensiometers actually measure the so called "available water" which is actually able to be drawn into the root sytem.

resistivity is too sensitive to changes in soil conductivity from fertilizer solutions, and without noble metal anode/cathode they are prone to slowly changing resistance at the electrodes.

capacitive sensors are much much better, but they still cannot distinquish between water that is held tightly in capillary boundaries via small grains or clay content etc- from water that is available to be drawn in via osmotic pressure.

irrometer makes EXCELLENT low bulk density tensiometers for peat lite/ coco lite and rockwool, but they are expensive, much more so than these xiaomi, and require periodic maintenance. there is another tensiometer company... but i forget their name.

moreover these xiaomi sensors are limited in depth to what looks like 6 inches maby? ... where as with a tensiomter you can purchase just about any depth you need up to 36" from what i recall.

far as PH and EC control via micro controllers?

im sorry but you are deluding yourself if you think you can engineer your own EC and PH control schemes and meet or exceed what you can get from a HACH GLI 53/63 or any number of process controllers coming with NEMA enclosures, truely excellent sensors, and cell constant programming, cell faulting and relay outputs and analogue or rs232 outputs already baked in.
EC controllers are also VERY important industrially speaking, so there is a PLETHORA of controllers available on the second hand market. i bought a series of GLI 53's and 63 for literally 25-50 dollars. i have some yokogawa units too, but they have a shitty non backlit display.

EC sensors are fairly trivial, but this xiaomi thing is honestly a joke, im sorry but it just is. its literally 2 chrome or nickle plated buttons or rivets mounted on some through hole PCB thats been coated.

contrast that with a rosemount EC sensor ( comes with an actual factory cell constant btw) which you can get for a few hundred bucks and literally thread into a PVC tee or a mount on an immersion mast...

and PH? Ph is not a trivial phenomena to measure.
i have no clue how you plan on incorporating PH, but online ph sensors are either cheap and disposable(see pool automation sensors) with high maintiance, or VERY expensive and servicable(hach combinations sensors or accuglass sensors) with generally low maintenance. you simply cannot get both.

ph controllers are also very very mature and( id guess) are going to be difficult to replicate. again stuff like sensor faulting, milivolt tracking( for long term sensor health), automatic buffer solution detection, all of the outputs etc.

again PH controllers are also VERY important industrially speaking so again- they are available for next to nothing second hand.

the sensors are another matter, but the controllers themselves are very very cheap and are going to be very hard to beat with a micro controller.
 

Bobby Boucher

Active member
Ay yo, Grandpa! Lmao!

Sorry queequeg, but from this point forth, in the playground of my mind, you will always be the sage and patient grampgramp I never had.

Killer beard, btw.
 

Ringodoggie

Well-known member
Premium user
I love the bluetooth moisture sensors. I am using the wired ones. I am definitely going to have to buy some of those. I'll check eBay but if you have a good source, I'd love to know about it. :)

I only use the RPi to monitor and record the data. I have an Arduino to activate micros based on the RPi data but I have not put it into the loop yet.

Here's my interface. I couldn't find anything pre-written at the time I was doing this so I just wrote a little HTML page to display the data. It's still in beta... LOL

The charts on the top left are the moisture levels. Top right is live streams of my 2 rooms (flower and veg). Click on the pic and it goes to that room and shows that data. Pretty simple stuff. I want to add a drop down to adjust the time shown on the historical data charts.

Pretty fun. I love my RPi. I have 4 or 5 of them. LOL I run KODI on a couple.

attachment.php
 

queequeg152

Active member
Veteran
isnt KODI that media server software?
i didnt know the rasberry Pi could do that... thought you had to have some beef in the kodi boxes to do all of the transcoding etc?

i know the new Pi is very powerful... but still on the order of like an atom e3xxx series?
 

Ringodoggie

Well-known member
Premium user
KODI will run on just about anything. Old PC's, smart phones (most), Firesticks, etc.

RPis are awesome. A complete LAMP server you can put in your pocket. LMAO Sure have come a long way from my TI99-4a.
 

queequeg152

Active member
Veteran
can you actually do the transcoding though?

i understand that it would take basically 0 power to just serve the files up to another device on the network or even over the internet, and have that device do the decoding... but im talking about how with kodi you can take basically any encoding or even ripped dvd's and transcode them down to MP4 and stream those to your phone or little smart tv or what ever else.

maby im out of the loop, but transcoding from one format to something else used to be insanely processor intensive. i remember transcoding some stupid dvd's down to mkv way back in the day with an E6700... i think it was literally 6 hours to do a pair of dvd's. i think GPU accelerated transcoding is huge now, but im guessing the rasberry pi has a piss weak integrated GPU or something along those lines.

i imagine its a few orders of magnitude faster now, but still.

edit:

btw i ask because a while back i was looking to get into a NAS box that could run kodi rather than a nasbox w/ another kodi box along side... i got sidetracked onto something else tbh, im just curious to hear if you can actually do the full transcoding on a pie. Id love to be able to serve shit from my PC to my roku box w/o a dnla server running on my pc.
 

CrushnYuba

Well-known member
I use sonoffs for allot. It can do almost anything you need without the extra stuff. Humidity and temperature reading. Everything gets turned on and off with relays. What else do you need?
I even use it for my auto light dep motor controllers based on time and for my motorized greenhouse sidewall vents based on temperature. Basically everything. You can even use as an irrigation controller with some simple 24vac power supplies/valve with sprinkler valve.

Moisture meters are great but but those cheap ones are total crap. They don't work period. They use electric conductivity or something. You want one that uses a watermark sensor. Or even better a real tensiometer. I have seen tensiometers that connect to irrigation controllers for less then 100$. Basically a blumate with a switch on it. Irrometer makes watermark sensor based switches for 100$.

You can let ewe link servers do all the work for you with no computers.
 

queequeg152

Active member
Veteran
I use sonoffs...

never heard of these. im looking at google images, and these things look sketchy AF? i mean it does not look like they even have a fuse?

am i wrong here? do they have a good history?

i guess i am just weary of non UL listed Chinese stuff.
 

Ringodoggie

Well-known member
Premium user
can you actually do the transcoding though?

i understand that it would take basically 0 power to just serve the files up to another device on the network or even over the internet, and have that device do the decoding... but im talking about how with kodi you can take basically any encoding or even ripped dvd's and transcode them down to MP4 and stream those to your phone or little smart tv or what ever else.

maby im out of the loop, but transcoding from one format to something else used to be insanely processor intensive. i remember transcoding some stupid dvd's down to mkv way back in the day with an E6700... i think it was literally 6 hours to do a pair of dvd's. i think GPU accelerated transcoding is huge now, but im guessing the rasberry pi has a piss weak integrated GPU or something along those lines.

i imagine its a few orders of magnitude faster now, but still.

edit:

btw i ask because a while back i was looking to get into a NAS box that could run kodi rather than a nasbox w/ another kodi box along side... i got sidetracked onto something else tbh, im just curious to hear if you can actually do the full transcoding on a pie. Id love to be able to serve shit from my PC to my roku box w/o a dnla server running on my pc.


The New ARM chips can decode video like a hot knife through butter. That's what's in the smart phones, Firestick, etc.

I'm not sure if they were originally designed for video processing or not but that seems to be their biggest use.
 

Bobby Boucher

Active member
I was gonna put kodi on a pie for my auntie for Christmas, but i decided to try out a $40 micca speck which plays all my ripped shows and movies perfectly. Tiny little thing, no larger than a pie. Turned out a lot cheaper considering it comes with a remote. Had to format the external to master boot record.

I run a wdtv, which I bought for 50-60 bucks a few years ago. Cant seem to find one selling now for less than 3-400 dollars.

The specks interface is total garbage, but it's played every format I've thrown at it and does a great job loading and scrubbing. Would recommend over pie if using solely as media player.
 

CrushnYuba

Well-known member
The op had a sonoff in the original post. They are just wifi enabled single throw relays. Like the wifi enabled outlet timers.
They also make one (th16) that has a port for temp/humidity guage. It interfaces with the server to turn outlets on and off.
 
D

dutty

@queequeg152

sorry, took me some time to dig into tentiometers... but at the end you always have some trouble/irritation with roots, at least in little pots like we use to use. Doesnt matter if you use a capacitive (like the xiaomis seem to be https://wiki.hackerspace.pl/projects:xiaomi-flora) conductivity or a tensiometer type. For last one roots start to suck at the bottom of the clay cone in later rooting stages. There are interesting DIY tensiometers out there too.
However, for this price the xiaomi sensors are still good for a impression of how your plants drink. The lux readings are quite interesting too and doesnt differ much (i own 12). For temp and humidity i use better sensors (bosch bme 280 which are really reliable). The mS/cm readings are near to my 60eu milwaukee ec meter (at least in water).
Again, i do my job since 15 years. I come from oldschool and im on guard, testing everything three and four times. The xiaomi sensors will never replace professional equipment but they are better than i thought and useful overall. Did i manage to harvest high grade before?! Ofc. But they gave me an advantage, ofc. And im still using them.

the sonoffs come in different settings (1-4 relays, power consumption monitoring, temp/hum sensor) and shapes(low cost "between the cable" or timer/socket-like). Basically they are wifi switches/relays. But since they are based on a kinda arduino low level chip with wifi (esp8266) they are capable of more. Google tasmota or espeasy, a custom firmware for these. Atm i connected waterproof temp sensors for my tanks, a hum/temp/pressure chip and a co2 sensor is on its way. For me they are more like wireless outposts than just relays to turn smth on and off. This is just a bonus and not even in use jet. (Waterlevel)Switches, more relays, alot is possible. Without coding.

I like to compare my stuff with the smart bee system. And it was, is and will always be wow expensive compared to my 100 bucks sensorium.
 
Top