Firsttimer trying plantmonitoring shortterm & home automation in the longrun

Good afternoon folks,

I totally do not know what I am doing, so I am looking for pointers where and how to start and which electronic components I should buy on a tight budget.

Shortterm goal
Monitor 2 seperate outdoor tomatoplants (ph+moisture in the soil & light) and give a notification to my phone when paramaters get below or above certain thresholds.

Longterm goal
Home Automation/Notification system

  • I would like to get a notification on my phone when: 1) a room gets too hot or cold (fire or left window open in winter), 2) Plants need water or PH or 3) when motiondetectors get triggered;
  • I want to be able to set a lamp vacationtimers for the living- and bedroom;
  • I want to have 3 sections temperature controlled through 3 thermomotors on 3 heatinggroups;
  • And lastly I would like to automate garden-watertreatment-system (moisture and PH) for 20 tomatoplants based on 2 plantmeasurements.

I have pictured my requirements in the below picture:

The last row is an example of the notificationview i would hope to accomplish, very minimalistic. I do not have a need to see datagraphs regarding measurements on my phone at all. I just want to be able to import the logged data in (libre)office when I am working on my computer if need be & get notifications when parameters go apeshit above/below a certain threshold. Next to that, when a motiondetector gets triggered, I would like to get notified including a picture.

Questions so far

  • What would I need for hardware to get this project of the ground regarding a homeautomation-hub-component or something like that & monitoring 2 seperate tomatoplants? The rest of the components is not relevant at the moment. Lets start with monitoring the tomatoplants;
  • I read that the 3 most common options regarding the communicationprotocol for outside monitoring are: Wifi, Zigbee & 433Hz. Is it correct to assume that 433hz is the cheapest protocol and most optimal way to go here?
  • Well, the same questions basically goes for all other components which are installed inside the house. Should they use the same communicationprotocol as the tomatoplants?
  • I looked at ali express and found alot of cheap imitation stuff which looked descent tho. Are the chinese imitation components any good?

That is about it for now. English is not my native so my apologies for grammer/spellingmistakes. I still hope you guys can help an old geezer achieve his shortterm and longterm goals in this hobbyproject.

Nice list of goals.
got any accomplishments with the Arduino ?

I would offer that for the cheap-cheap-cheap way to go, an uno, the RF and some cheap soil moisture sensros.

Get a BME280 and put together PaulRB's project.

Luckily, I am not hampered by any previous arduino experiences at all! 8) 20 years ago i programmed in C++ and pascal and soldered some pcb's. So I am basically starting totally fresh, that is why I wanted to take something simple like monitoring 3 paramaters for a tomatoplant, just to get the hang of it. So many electronic components available for the arduino platform nowadays, it is quite the challenge to even begin with without any previous experience or mental coaching. It will take while for me to get the hang of it, but that is fine, I just want to learn something.

Thanks for the link. I will check it out.

Since you want to monitor your tomatoes from a phone using a Uno you could use a GSM shield and send SMS alarms when limits are exceeded plus a regular "all's well" message.

Presumably the Uno will be battery powered and housed in a watertight enclosure. You might want to think about battery life.

Since you want to monitor your tomatoes from a phone using a Uno you could use a GSM shield and send SMS alarms when limits are exceeded plus a regular "all's well" message.

Presumably the Uno will be battery powered and housed in a watertight enclosure. You might want to think about battery life.

GSMweb component, I will check it out, seems quite fitting!

I was planning on keeping the home automation hub, or the arduino like device, inside the house next to the computer and 2 seperate wireless outdoordevices in the tomatoplantsoil for 3 parameters per plant. But I can also use that GSMweb component dor an indoor arduinohub

I would have thought one device would be able to monitor two plants unless the plants are far apart.

You have not said how far the plants are from the house. You need to be sure any wireless connection to the house is viable or that there is mobile coverage if you are going the SMS route.

You should think if you want active or passive monitoring. If you use SMS messages then you will get alarms on your phone whenever anything important happens. If you put the monitoring information on a website then you will have to actively go to the website to check what is happening.

Cost also comes into it you may or may not get free SMS messages and you may or may be able to host or put data on a website for free.

  • Well I live in an urban area, so the distance is about 20 meters tops;
  • I do not need a website, I just want a file that I can import in excell or libreoffice calc if need be, else not. So logging data is important, but not viewing it.
  • The sms-route could be viable because I only want alarms for an emergency. Maybe I could make some software that could send data and a burglarpicture if need be. That sms route is not such a bad idea and I like that it is not directly connected to the internet, it has security advantages too. I do not like that some wizzkid that is smarter then me hacks my securitycams and that everybody is able to view inside my house or whatever. Just the thought makes me ill.

For your long term goals (and possibly the short term as well)

I would look into using a Raspberry Pi as an MQTT server.

This gives you a publish and subscribe type of platform. (So you dont have to keep polling and polling over and over to check for changes.. and if so.. THEN do something.) <-- that approach is garbage and a resource waster.

If you also make the RaspberryPi into a LAMP server (so you can have MySQL, Apache and PHP running, you can log your data to the database.. and trigger a response based on the values..etc)

IMHO.. this is a pretty powerful set-up that allows for much flexibility and scalability.

I have one of my Pi's configured this way.. and am using a PHP class for MQTT communication/triggers as well.

I have some ESP8266 modules throughout my house to either send back (publish) the temp or humidity in my house.. or others configured to let me know if the door is open or closed... all publish back to the MQTT server..

I have other modules 'subscribed' (listening) to these published events.. and and when something happens, my code/components behave/react accordingly.

This is by far the better approach.

Thanks for the idea about the raspberry pi.

The question for now is, will I in the next couple of years evolve this home automation idea of mine, like you did with yours? Probably not for a very long time. But if I ever wanted to do so, then I could always simply buy a Raspberry over a couple of years, the newest version ofcourse. :slight_smile:
If I remember the differences between the Arduino and the Raspberry Pi correctly: The Arduino is a microcontroller and the Raspberry Pi a microcomputer. The differences being that controlwise the Arduino is superior (in/outputwise), but as a total package a microcomputer logically offers alot more options then a microcontroller does. In/output jobs are great for the Arduino but if you want a neat looking interface, then you could go for the Raspberry Pi.
I was hoping that I could make the most simple low budget system possible that could do the job like I envisioned the project (I only want to notice the home automation system, when some parameters go apeshit. Else not, so I do not really need a very high quality look & feel softwarewise for now). If you still think I am better off starting my project with a Raspberry Pi instead of an Arduino, then please explain it like I am 5, why I should pick a Raspberry Pi over an Arduino? Because when I read Mysql/php/apache/MQTT and some other foreign languages :D, i get a little bit discouraged in the Raspberry Pi alternative. :stuck_out_tongue: But seriously tho, I am interested in the why question? Why should I go Raspberry Pi over an Arduino in this project...

Thanks in advance for your contributions.

The Raspberry Pi also have I/o pins to utilize..

it also (as you pointed out) is a micro computer.. so much MORE processing power and memory..etc than your average Arduino

it also supports HDMI if you ever need to create something to display your home automate state/status..etc or create the interface to turn on/off light in room #x (or whatever it is you set up)

The above being said.. I understand the discouragement.

I too am only a 'complete' noob when it comes to Raspberry Pi's.. (so that should help! lol).. and I know next to nothing and CLI (command line interface) for LINUX.. (so theres another booster for ya!) lol

I too however understand most other aspect fairly well.. and am a web developer by trade.. (to LAMP or more so WAMP is something I have experience in).. (thats the web, database, php scripting language portion)

But thats not really needed.

The MQTT server/platform was really the point of it all.

For your initial 'short term' goal.. that might be over kill.. as it seems the devices will really only have one 'function' anyways.. so constantly checking it and then executing an action at a certain threshold seems fine to me.

However, for your home automation, you will have A LOT more things going on than just the one responsibility of checking soil PH/moisture..etc.

If you do not go with a MQTT 'type' of solution, it boils down to this:

You are constantly checking (over and over,..often called 'polling') to see if a value/state has changed. even if nothing has happened

sorta like you going over to your buddies house every 5 minutes to see if he is home.

If you go with an MQTT 'type' of solution.. the focal point is the 'publish and subscribe' behavior it offers. (I know,.. I know.. huh? lol).. I'll explain.

The publish and subscribe event/behavior is you do not have to constantly check (poll) for a change of state/status to trigger another behavior.

So using the scenario above (again)..
you dont have to go to your buddies house every 5 minutes to see if hes home, so you can go to the movies...
he can just call you and let you know that hes home.

Heres an example:

If I am checking a room temperature, and at a certain level I want to turn on a fan. but also turn on an led/alert in another room...

I just have the fan and led/alert 'subscribe' to this roomTemp 'event'.. and when the event 'publishes'' a change.. my 'subscribed' device to this event are alerted to this change. Nothing has to constantly check for changes.

Makes it nice and easy to have a 'central' hub (brain) and all devices spread out through the house, (especially if all devices are little $2.00 wi-fi devices)

For my project..

I have a things (ESP8266) call/load a PHP script I wrote, located on the web server on the RasPi..

I (sometimes) log data, read data from the database.. and then also make/update an MQTT event.
all 'subscribed' devices do their 'jobs' based on whatever updates/events are happening.

As for starting off with a Pi? no.
I think its important to get familiar with the Arduin platform with its strengths and weaknesses.

But I dont think any kind of (good) home automation can be done without an MQTT/IoT type of service. It will get bulky fast.

The Pi3's have wi-fi, making it awesome to use the ESP devices as well.

For your long term goals (and possibly the short term as well)

I would look into using a Raspberry Pi as an MQTT server.

You beat me to it! I use the Arduino for tiny tasks.

I'm fairly new at all this too, managed to get the Raspberry Pi configured with Home Assistant, MQTT Server. With Home Assistant you can configure automations based on sensor data. Wemos ESP8266 wifi modules are cheap but Highly Reliable wifi units for PuB-SuBing over MQTT. Possibilities are limitless. Since most is all wireless, there's no wiring strung throughout the entire house.

So, the biggest advantage of MQTT server is batterylife of the iot devices in my simple home automation/notification setup? As you can see I am trying to quantify the MQTT server argument.

So, the biggest advantage of MQTT server is batterylife of the iot devices in my simple home automation/notification setup?

No, the advantage is that pub sub gives you separation of concerns. Your temperature sensor just publishes the temperature, it doesn't need to get involved in what you do with it. Initially, you may only have a single subscriber that enables you to view the data on your phone. Later, you may add a subscriber that adjusts your heating or one that sends your data to weather underground. Eventually, there may be many more subscribers doing stuff based on the temperature and the MQTT broker allows the original sensing function to be blissfully unaware and unchanged.

I too like the idea of the R-Pi for the heart, a MUCH better long term solution. but then, you said cheapest way..... for the cost of the pi, you can use an ESP8266 can send data to a google spreadsheet.

there are lots of ways to peel those potatoes.

how to on the google spreadsheet.

google spreadhseet has a limit of 400,000 rows.
that means one row per minute, per day, is
60 minutes x 24 hours x 31 days = 44,640 per month.
one sheet could fill in 10 months.

or, go to 15 minutes and you use 2,960 rows per month. and that pushes out to about 11 years.

Again, I am a complete newbee regarding iot stuff. Sorry for all the dumb questions and thanks for all your contributions in this topic to help me get started.

Before I came to this forum, someone on another website suggested to go for a nodecmu esp8266 wifi-module to monitor each tomatoplant i.c.w. an arduino at the time. You guys also dropped an argument for the esp8266 modules in discussing the Raspberry Pi as an alternative hub, which you suggested as better suited for homeautomation and datalogging. Seeing the concensus about the esp8266 no matter which platform-hub, is it safe to assume that going for an nodecmu esp8266 module to monitor 3 parameters regarding a tomatoplant is a good way to approach tomatoplant-challenge?
Then atleast I will have chosen a communicationprotocol and a component for both wireless monitoring-devices. I could start with engineering a fully functioning monitoringdevice for 3 parameters before making it even more complicated then it allready is.

The cost of these components seems really low and it is not even blackfriday yet! 8)

€ 15,00 esp8266 module + starterkit with cables+breadboard etcetc
€ 01,00 two soilmoisture probes
€ 02,50 a second esp8266 module

Hopefully a nodecmu esp8266 has enough i/o's for 3 measurements no matter which version, they probably do right?

I have not found a ph probe in a store yet, but I can make one myself according to youtube. Maybe when I understand the basic technological stuff behind IOT home automation, I could retrofit a standard soilmoisture/ph meter to IOT. Those measuring probes look nicer then a pcb with some copper on it and it can also measure ph.

When the time comes that I finished 2 fully functioning monitoring devices, I probably will have a better understanding about iot/arduino/raspberrypi and other alternatives. Is this a good approach to go about?

My 1st Raspberry Pi Was the Zero W. I configured it as an access point and MQTT server. Still working strong at almost a year in service 24-7. Total of about $25. Wemos D-1 Minis are about $4.00 each. Then when you want to grow up. Get the Raspberry Pi3 B for $35. Now you have a milestone that can handle all your automations, sensing and whatever else you may want to do with it. You won't regret it.

I think you can get 1 Wemos to collect readings from 8 sensors then Publish that data via MQTT. You can save the data to a SD card. Set up Home Assistant to water the plants when the soil sensor meets a certain range or just send you a text that the plants need watering.

It's still LOW COST. And there's tons of help out there to get you going. You can do this!!!

I'd suggest you get started with your proposed hardware. The plan will change as you experiment, learn and probably destroy components. No need to over think it at this stage.

I'd suggest you get started with your proposed hardware. The plan will change as you experiment, learn and probably destroy components. No need to over think it at this stage.

^ ditto.
its good to have the knowledge and understanding of how to expand (with less headache over-all).. but for now.. your current small term project is fine with a couple $2.00 ESP modules..

I will start with making a wireless monitoring station for 3 paramaters with an ESP8266 module. I'll eventually even try that MQTT stuff what marine_hm suggested. Wemos D-1 Mini is still being sold, so I will even get the same component and be sure "it could work" prehand.

Thx guys! You helped me alot.

Have a nice day.