Go Down

Topic: Firsttimer trying plantmonitoring shortterm & home automation in the longrun (Read 414 times) previous topic - next topic

zanerelice

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.

dave-in-nj

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.
https://github.com/PaulRB/WemosSensor

zanerelice

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.

ardly

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.
https://www.arduino.cc/en/Guide/ArduinoGSMShield

Presumably the Uno will be battery powered and housed in a watertight enclosure. You might want to think about battery life.
"Facts do not cease to exist because they are ignored" - Aldous Huxley

zanerelice

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.
https://www.arduino.cc/en/Guide/ArduinoGSMShield

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

ardly

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.


"Facts do not cease to exist because they are ignored" - Aldous Huxley

zanerelice

  • 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.

xl97

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.


zanerelice

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. :) 
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. :P 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.

xl97

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.


marine_hm

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.

zanerelice

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.

wildbill

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.

dave-in-nj

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.

http://embedded-lab.com/blog/post-data-google-sheets-using-esp8266/

how to on the google spreadsheet.






dave-in-nj

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.


Go Up