Office plant monitoring


  • Mod

    I work as development team lead at a software company. We do server and network monitoring. Yesterday we hosted a customer event, and I presented my houseplant monitoring project based on MySensors and Domoticz. The presentation was a hit, and it has been decided that we'll use MySensors to monitor all plants at the office.

    There is not that much to tell from a technical perspective. I hooked up everything according to the MySensor build page and created a simple sketch.

    Thanks to everyone from the MySensors community for a great library, clear instructions and great suggestions for projects. And thanks for making me look like a hero :-D Let's continue conquering the world.



  • Thank you very much works very well for Domoticz :+1:
    Schowek-3.jpg Schowek-2.jpg 2015-10-10 18.27.06.jpg


  • Contest Winner

    @mfalkvidd I totally agree with you. I don't think we thank the people behind MySensors and Domoticz enough. As a matter of fact, MySensors is helping me to have a good night of sleep. I'll post more on that project soon. I watched your presentation and the product you're working on, sounds like something one of my customers could use. I've sent them an email.


  • Mod

    @TheoL cool! It might be worth noting that our product is free for monitoring up to 20 things, so your customer might not even need to pay anything (unless they want access to our awesome support).



  • Is it possible to use more than one sensor? And if it is, how would the sketch look like?


  • Mod

    @Lars65 Something like this should work with up to 4 sensors:
    Note: I have not tested this sketch. Feedback is welcome.

    Connect the power for all sensors to pin 8 (note: if your sensors draw too much power, you might exceed the maximum rating of 40mA, measure how much current your sensors use before you connect too many)

    Connect the analog pin for the each of the sensors to A0, A1, A3 and A3 respectively.



  • Thanx!
    I will test this.
    :)


  • Mod

    Great.
    Arduino Pro Mini has 6 analog pins, so you can use a maximum of 6 sensors. The Nano has 8 and the Micro 12.


  • Mod

    btw, I had a bug in the code.

    for (int sensor = 0; sensor <= NUMBER_OF_SENSORS; sensor++) {
    

    needs to be changed to

    for (int sensor = 0; sensor < NUMBER_OF_SENSORS; sensor++) {
    

    I have updated the sketch, but if you copied the code before I did the change you'll need to update your code for the two for-loops.



  • Could it be possible to use different power pins? So if you have more than one senor you measure in a sequence?


  • Mod

    @Lars65 Yes, absolutely.



  • I know that I am a pain in the *ss. But I have tried to change this code to accept more than one power pin.
    But I don't know how. I know how to mill a PCB, and lot of other stuff, but programming is not my cup of thee.
    I really need to try to study how.
    Bot for now, is it anybody who could help me?


  • Mod

    How much power do your sensors need? (How many sensors can use the same pin?)


  • Mod

    This is a VERY quick and dirty solution. I'm off to the movies now. Let me know if it works :-)

    Edit: have updated the sketch


  • Mod

    @Lars65 Just a question before things get too crazy: Will you be running your node on battery power? If you will be using wall power you can just power all sensors continuously from Vcc and get rid of the code for turning on and off the sensors, and get rid of all the battery reporting code.



  • Hi!
    At the moment do I only have three sensors, and I will be using them on the same arduino. Those will be powered by wall power.
    But I have ordered some more sensors, and some of them will be battery powered.
    Though both me and my wife often forget to water our plants, do I really like this.
    I use Domoticz, and it's easy to get a notification when it's time to water.
    You have been really helpfull. Tomorrow will I mill a new PCB, to test this code.
    :)



  • Hi @mfalkvidd and thank you for your nice work and sketch.
    I just have one question about the power pin, I saw on datasheet that the adruino pro mini can handle 40mA max per powerpin. I Have four of these soil moisture sensors but cant find how much current they need... they use a LM393, and the datasheet say 0.4mA..
    Did you think than i coul plug all of them on the same powerpin or i need to use your second sketch ?
    Thanks in advance !


  • Mod

    @damien: I don't know, unfortunately. Maybe @Lars65 can do a measurement on his moisture sensors?



  • @mfalkvidd Ok thanks for your reply, i will wait for @Lars65 to see if he has done the measurement, else i will do it by myself on mine when i receive them.
    Thx



  • Hi Guys!
    No I haven't made any measurements.

    { 4, 0, 1, // This assumes 2 sensors per pin. First two sensors are powered through pin 4, using analog pins 0 and 1
    **5, 2, 3, **// Second two sensors get power from pin 5 and are connected to analog pins 2 and 3
    6, 4, 5 // Third set of sensors get power from pin 6 and are connected to analog pins 4 and 5
    }
    So I did change 4,0,1, to 4,0,. What I saw with this was that I use power pin 4, to the analog input A0. So now have I made it so A0, has powerpin 4, A1 has powerpin 5, and A2 has powerpin 6.


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.