1. IMPORTANT - NEW & EXISTING MEMBERS

    E-MAIL SERVER ISSUES

    We are currently experiencing issues with our outgoing email server, therefore EXISTING members will not be getting any alert emails, and NEW/PROSPECTIVE members will not receive the email they need to confirm their account. This matter has been escalated, however the technician responsible is currently on annual leave.For assistance, in the first instance, please PM any/all of the admin team (if you can), alternatively please send an email to:

    [email protected]

    We will endeavour to help as quickly as we can.
    Dismiss Notice

Plant for electronics project recommendation please.

Discussion in 'NEW Gardeners !' started by T_i_m, Jul 14, 2021.

  1. ricky101

    ricky101 Total Gardener

    Joined:
    Jun 15, 2016
    Messages:
    3,290
    Gender:
    Male
    Location:
    Sheffield
    Ratings:
    +4,201
    Hi @Ademission

    Nearly did, but not bought the Ender v2 yet, its not that we have a lot to print, more the interest in the whole system, hardware and software.

    Have used some 320x240 SPI TFT touch screens and they operate well, but made a mistake in buying one of the Nextion serial screens before properly looking at its software control which seems a Pita for our needs.

    Hi @T_i_m

    When you come water reservoirs in your project you might find these sensors handy over the typical float switches.
    Have tested the stick on type which works ok but have used the opto one in the aquarium for several years.

    000717.jpg 000716.jpg
     
  2. T_i_m

    T_i_m Apprentice Gardener

    Joined:
    Jul 14, 2021
    Messages:
    20
    Gender:
    Male
    Ratings:
    +17
    Hi Ademission,

    You could be a handy person to know iyou are a coder as it's something I have tried many times but has proven to not be my 'thing'. I can sometime copy > paste and tweak, but if that doesn't work I'm generally stuck. That's why using Home Assistant (software) as a coordinator helps make things more manageable for me.

    Both Ricky and I are using 'capacitive' sensors and you can see one in use in one of Rickys posts up thread (you can buy them (V1.2 and V2) for around 10 for £10 on the likes of Amazon). They potentially have an advantage over the twin probe type because *they* require a voltage to be passed between them to measure the resistance that ends up setting up an electro-chemical reaction and sometimes corroding the electrodes.

    The capacitive type rely on the changing capacitance between the PCB tracks / traces (using an NE555 IC as an oscillator) and render that as a voltage. The microcontroller then reads that voltage using it's ADC, and that value converted into something useable. ;-)

    The output voltage is inversely proportional to the moisture with say 2V relating to 'dry' and 1V to 'wet' and within ESPHome you can tell it that 2V=0 and 1V =100 (%) and it sorts out the rest (luckily for me). ;-)

    They use a 'sliding window' to help average out the value. I think the ESP8266 only has a single 10 bit ADC and given the sensor output voltage range only covers around 1V, and the input would allow up to 3.3, I'm not sure how accurate / repeatable the output could be. That said, as mentioned elsewhere I don't think there is any temperature stabilisation and considering the bigger picture, I'm not sure that really matters, as long as it can indicate when the plant could do with a drop of water. ;-)

    I also have an ESP32 running a sensor and I believe that has multiple 12bit ADC channels so you have the opportunity there to monitor several plants at once (maybe only 8 of the 16 available if you are using WiFi (which is part of the beauty of it for me)). You could then drive several small peristaltic pumps or one pump and solenoid valves to direct the water to your individual plants. ;-)

    Re your matrix display ... I *nearly* had a ZX81 running an 8x8 large (1m / 1m) LED display (9 LEDs making up each pixel) on my mobile disco (that I assembled 40 years ago <g>), just that I didn't have the coding skills. I ended up with just a switch on it for a new years eve party and flicking the switch at midnight changed the display from 81 to 82. ;-)

    How much easier I could have done it today! ;-)

    Cheers, T i m
     
  3. T_i_m

    T_i_m Apprentice Gardener

    Joined:
    Jul 14, 2021
    Messages:
    20
    Gender:
    Male
    Ratings:
    +17
    It was my idea to use a small manually filled reservoir with a closed loop system for any 'overwater' but a sensor to tell me that needed topping up could be handy. ;-)

    As an aside, a mate has been running Home Assistant (first on a RPi and now on an Odroid N2+ like me) and he too has a couple of fairly big fish tanks that we have been integrating. Like, he now has HA stopping his CO2 for running at night and we are working on the idea of using scales (load sensors / ESP32) to 'measure' the RO water as he fills them. No tank present, automation doesn't run. Empty tank present, pump runs and continues till the maximum weight reached then pump stopped. Pump is also run at a 50:50 duty cycle to stop it overheating.

    I thought weight would be easier than having to fit and connect sensors to all his tanks. That said, I dropped a couple of those capacitive sensors to said mate yesterday as I was thinking they should be able to 'sense' the water level though the wall of a plastic container (saving him having to make holes etc). He could stick them to the outside with double sided tape and cover them with Gaffa tape to keep any splashes off etc.

    Cheers, Tim
     
    • Like Like x 1
    • ricky101

      ricky101 Total Gardener

      Joined:
      Jun 15, 2016
      Messages:
      3,290
      Gender:
      Male
      Location:
      Sheffield
      Ratings:
      +4,201
      As you can see we use a stand alone Esp32 in our aquarium controller , originally marine now planted freshwater, which includes a timer for the Co2 solenoid plus a PWM fan for cooling the tank in this hot weather.
      We use the touch icons/submenus to offer manual overrides and function/colour change indicators.
      Took some time do as we coded in C++ from scratch apart from the screen and ds1820 libraries.

      Its seems a far cry from the Assembly coded PIC one we made nearly 20 years ago using just 2 push buttons and 2x16 lcd.
      We web published it at the time and had quiet a few individuals from around the world build them and a marine club did a group build so know about 100 were used.
      The most rewarding aspect was over the next 10 years years when several folk sent us emails and photos of their tanks still using the Pic controller as it had been so reliable and bug free.


      000719.jpg

      000720.jpg
       
    • T_i_m

      T_i_m Apprentice Gardener

      Joined:
      Jul 14, 2021
      Messages:
      20
      Gender:
      Male
      Ratings:
      +17
      Wow, that's very impressive Ricky with the touch screen adding that extra bit of style. ;-)

      And yes, it is a good feeling when others can make use of what you have done (especially if it was originally for yourself). ;-)

      Do you actually read the CO2 sensor with your solution or interface another controller of some sort? I ask because my mate has a fairly expensive CO2 controller (or erS) and I believe has to replace the sensors themselves every 6 months or so?

      His controller has a 240V switched outlet that normally drives the gas solenoid directly but to be able to 'manage' the process though Home Assistant we plugged the solenoid into a smart socket and took a 5V supply off of the CO2 controller (just a USB phone charger PSU thing) and fed that though an opto (for safety) and into the ESP32 as a binary input. A condition for the solenoid to be activated by HA is that it wasn't between 22:00 and 08:00 and not only can he easily change those times (just edit the Automation) but monitor to see when the CO2 was being called for and when it was being allowed etc. The USB PSU solution was just an easier / safer way (for him) of determining when the controller was calling for CO2 than opening up the controller and tagging the feed to the relay, both because of his risk of electrocution and potential damage to the controller.

      I have made a couple of PCB's in my time (often from projects in ETI or Elektor) but now days I believe it can be done online cheaply in the far East over email! ;-)

      I did also have some small PCB's milled by a guy here in the UK for an IR model train proximity sensor I was working on for my BIL (to automate some of his analogue layout) and whilst the PIC based IR sensors worked, BIL moved to Norfolk before we could really test it and is still in the process of laying it all out again.

      The prototype was based on an Arduino UNO and I successfully had a railcar running from one end of a test track to the other with PWM control of the speed, inertia and acceleration and deceleration then running back the other way but around a side loop with a couple of points being driven via bridges and capacitive discharge points driver.

      The final goal was to have a length of track with two sidings at each end and 3 railcars available to run on it (easier than a loco with carriages / trucks etc). The track was broken up into 5 (or more) electrical sections and each section monitored for occupancy by current sensors. The idea is that you could place 3 locos in any two of the 4 sidings and have one on the main track and the system would drive the train to one of the empty sidings than randomly drive one of the two from the two end to the empty siding at the other end. Rinse repeat. ;-)

      Not that I would have been able to code all that on my own of course!

      It would have all been pretty easy with digital but he has *loads* of analogue rolling stock and wanted to be able to use whatever he wanted, maybe just with the addition of a reflector underneath etc. Because you really needed feedback on the PWM to cover the wide range of stock he had (with wildly ranging motor efficiencies) I was going to see if I could find an existing 'good' PWM controller and then just drive that with the Arduino.

      Cheers, Tim
       
    • ricky101

      ricky101 Total Gardener

      Joined:
      Jun 15, 2016
      Messages:
      3,290
      Gender:
      Male
      Location:
      Sheffield
      Ratings:
      +4,201
      Hi,

      We are using Co2 in a freshwater planted tank which just needs the co2 turing on and off once a day, no sensor needed, though it is possible to use one, if a little overkill.

      Sounds like your friend is using it in a marine tank as part of a calcium reactor ?
      Another advantage of a graphic display is that you could have an icon turn on or change colour to indicate when the Co2 is switched on, and assuming the sensor is a PH probe, actually display the PH value which will probably be more informative ..?
      But if his controller is doing all the work, why does he need the detail displaying ?

      That early Pic board was done with a computer program printed out with an iron on mask and hand etched, though as you say its so cheap to use the china based places now, its just the high DHL costs to get the boards back quickly and the time to create your pcb design.

      Yes, so many things you can do with model rail and micros and there are many forums doing things like that, where do you stop !! :biggrin:

      If you want to look into using a TFT screen they are quiet interesting to program up and adding touch control gives it a new dimension.
      Needs a few more i/o pins and no problems with memory if you use the ESP32.
      3.2 inch Colour TFT Module with Resistive Touch
       
    • T_i_m

      T_i_m Apprentice Gardener

      Joined:
      Jul 14, 2021
      Messages:
      20
      Gender:
      Male
      Ratings:
      +17
      Hi Ricky,

      I think you are right re the calcium reactor and mate has two fairly large tanks, one marine and one freshwater / tropical. Both have CO2 systems etc.

      Re the system feedback, it's not the quantities of anything he's monitoring with HA in this instance but the function, checking / noting (OOI etc) how often the system uses CO2 and proving that it is (or isn't) when it should. I think the controller displays the actual values of things.

      You can buy model railway automation solutions but they are quite expensive and you are sorta stuck with buying all the bits to make it do what you want and even then, you still might not be able to do what you want. Further, they rarely offer circuit diagrams and even less often, the source code for anything with firmware and so you are reliant on them and their support should something go wrong. I am really uncomfortable with wiring instructions that just tell you what connector to join to what, as opposed to describing what the wires are actually doing.

      I did find one example of something that I used to get me going where a guy had used an Arduino and published the sketch and a coding friend helped me fix the rest.[1] ;-)

      I did think of having a screen and even a button box to run some of the major home automation functions but given it's all available on a mobile phone, tablet or PC screen in a second, there isn't really much point.

      My mate with the fish tanks has a dual monitors setup on his PC, one monitor typically displaying his CCTV cameras and the other his Home Assistant home screen (so he has his on a 21" TFT display). ;-)

      (The funny thing is the use of electronics to manage the CO2 in a fish tank for the plants is nearly still on topic). ;-)

      Cheers, T i m

      [1] What was bizarre for me to witness was him connecting to my PC remotely using Teamviewer and then browsing my 3 pages of Arduino IDE code for the first time ever and no longer than 20 seconds, making some changes then passing it back to me to compile / install / test ... and it worked!
       
    • ricky101

      ricky101 Total Gardener

      Joined:
      Jun 15, 2016
      Messages:
      3,290
      Gender:
      Male
      Location:
      Sheffield
      Ratings:
      +4,201
      Will have to make some time to look at that HA in proper detail ! :thumbsup:

      My concen with similar Free online things is that everything has to run via their servers so if there is a problem with the connection or they either decide to make it chargable or just shut down you have a big problem ?

      Can the core functions of your HA system run without their servers being connected ?

      With trains, aquariums and such like you can do so many things with the tech stuff these days, but perhaps with being older, we prefer to have it all in one local box, its done us proud for many ,many years.:)
       
    • T_i_m

      T_i_m Apprentice Gardener

      Joined:
      Jul 14, 2021
      Messages:
      20
      Gender:
      Male
      Ratings:
      +17
      Yes, that's pretty much the whole point of Home Assistant Ricky or (as you say), you may as well use any one of the propriety 'online' apps out there.

      That's why you run it on your own box, like a RPi, PC [1] or Odroid etc.

      If you want remote access then I think you can have that but may have to pay (I don't so don't). ;-)

      Cheers, Tim

      [1] If you have an old PC spare you can stick Ubuntu Linux on then you can run a 'Supervised' (all bells and whistles) version on that. You can even run it on a Virtual Machine and you can download ready-to-run instances in most of the VM formats.

      Generic x86-64
       
    • ricky101

      ricky101 Total Gardener

      Joined:
      Jun 15, 2016
      Messages:
      3,290
      Gender:
      Male
      Location:
      Sheffield
      Ratings:
      +4,201
      Hi @T_i_m

      Had chance to have a good read about HA and it does look quiet comprehensive allowing so many methods and devices to connect, can see why you younger ones find it so useful.

      Would it be any use for us ? not sure as the ESP32 would probably do the few things we wanted to communicate locally.

      What we can see as its achilles heal is the Raps Pi or similar acting as the server, if doing such a system, might be worth connecting a second unit in parallel or having it in module form so it can replace the failed one with minimum work.
      That said your micro board looks good with its large fan and heatsink built in, but even fans only last so long.

      Thanks for enlightening us and let us know how you plant pot watering system develops, sure folk here will be interested. ( we like pictures )

      Enjoy :)
       
    • T_i_m

      T_i_m Apprentice Gardener

      Joined:
      Jul 14, 2021
      Messages:
      20
      Gender:
      Male
      Ratings:
      +17
      Hi peeps,

      I thought I'd just share a graph of the soil moisture level for the begonia over about 10 days.

      Begonia 8-17.jpg

      I just added about an egg cup of water to the pot (away from the sensor) and you can just see that at the end. You might also notice the 'noise' on the line reduced around the 14th and I did that by extending the 'sampling window', the number of values it reads and averages before reporting the value (from 5 to 21 (it should be odd for some reason)).

      The capacitive sensor electronics aren't particularly sophisticated and the one above is version 1.2 and I now also have some V2's. Neither are likely to be that sophisticated at around a pound each!

      V2 capacitive sensor.png
      They are very simple, using just an NE555 timer IC, a 3.3V voltage regulator and a capacitor to integrate the output into a voltage that can then be read by other electronics and turned into something human readable .. and / or initiate an alarm / email or to start some automatic watering system.

      In my case the sensor is connected to an ESP8266 microcontroller board:

      ESP8266 D1 Mini.jpg
      ... that is connected to my home network by WiFi and reports back to my central home automation system that is running some free (and open source) software called Home Assistant.

      Home Assistant

      It can be run on the most basic of hardware, including the tiny / cheap Raspberry Pi microcomputer (model 3 onwards):

      RPi3B.jpg

      ... and you can download an image onto a micro SD card that is ready to run (no real installation / configuration needed). There is loads of support, are loads of updates, ever increasing range of supported devices and that are being use to control all sorts of things, including lighting, heating / cooling, irrigation and pretty well anything else you can think of! ;-)

      The only soldering needed to make the whole thing work are the three wires (5V, Gnd and A0) and between the capacitive sensor and the ESP8266 and you might not even need to solder if you bought a board with the header pins already soldered in. ;-)

      Integrating the ESP into Home Assistant is mad very easy in Home Assistant via the ESPHome integration. Once installed (a couple of mouse clicks), you connect the ESP to your Home Assistant host system via a USB cable then create the 'node' in the software using a wizard. It asks you the type of board (ESP8266 Wemos D1 Mini in this case), the name of your wireless network and it's password. You then install that onto the board over USB and then can click on the Log to see what it's doing, if it has connected to the WiFi etc. Assuming it has, you can then disconnect the board from the HA host and re-position it anywhere within WiFi range and a power point for a cheap USB phone charger / uUSB plug and then carry on monitoring or reprogramming the board over WiFi. ;-)

      This is the sort of code you end up (that you see) for the ESP8266:

      esphome:
      name: moisture_probe_1
      platform: ESP8266
      board: wemos_d1_mini

      wifi:
      ssid: <Your wifi name>
      password: <your wifi password>

      (everything above is automatically generated for you by the ESPHome software using pulldown menus and you entering your WiFi stuff)

      sensor:
      - platform: adc
      pin: 2
      name: "Soil moisture probe 1"
      update_interval: 10s

      (That bit above is the only bit you need to add (copy and paste from the Internet <g>) and you can change the pin to match the pin you used (On the ESP8266 there is only one pin you can use to monitor things like the moisture sensor and that's Pin 2 (in grey) for the purposes of this process):
      esp8266-wemos-d1-mini-pinout.png

      then the name you want to see in Home Assistant and how often you want it to report a value (10 seconds is way too often for something changing as slowly as the moisture level in a plant pot). ;-)

      And then it's just a matter of displaying that sensor on your Home Assistant 'desktop' and you can do that as just a value, or a graph and it logs the history etc should you want it (as showed in the graph at the top).

      HA Desktop clip.jpg
      The above is an example of of how the HA desktop can display things (that you could equally see on your PC, tablet or smartphone) showing a couple of ways of reporting the moisture sensor and a bit of the values from my 3D printer. ;-)

      Even if you aren't interested in looking at the values, you can use them to make HA to do something, like ... 'If the moisture level goes below 75%, turn on a relay (connected to a small pump) for 5 seconds'. It actually looks like this when creating the automation with most the options entered using pull-down-menus (so you can't enter the wrong thing):
      Automation.jpg
      So that one looks for the device 'moisture_probe_1' to show a value below 50% for 6 hours before it does something, in my case, send me an email reminding me to water it. ;-)

      I hope the above gives people a bit of an insight as to what might be involved and considering I'm not a programmer, I found that bit much easier than I have with other projects because just how much of it is done for you and how many examples you can find out there to get ideas / answers ... or even complete solutions from. Plus, if anyone fancies giving any of it a go, I'd be more than happy to help. ;-)

      Cheers, Tim
       
      • Informative Informative x 1
      • T_i_m

        T_i_m Apprentice Gardener

        Joined:
        Jul 14, 2021
        Messages:
        20
        Gender:
        Male
        Ratings:
        +17
        I'm not sure how young is young Ricky? I'm 65 for example? ;-)

        Re resilience, you can (and it takes when doing updates) 'Snapshots' of the system that can be restored to new system (or more likely on a replacement uSD card) if required by a couple of clicks. They are also transportable between platforms, should you replace a RPi with an old PC etc.

        Re the fans ... both my RPi and now OdroidN2+ were / are fanless (partly for the reason you state and partly because most of my kit is fanless because it annoys my Tinnitus).

        As I said, there are very few things in life I would speak so highly about but Home Assistant is one of them. And I don't just mean for those who have a specific / practical task, but also those who like to tinker with things and have their lives made easier. Nothing safer or more energy efficient (and so saving money) than being able to walk from the kitchen, hall and into the lounge whilst carrying two plates of food and have the lights turn themselves on and off automatically as you do. ;-)

        Or have a plant email you telling you it needs watering. ;-)

        I assume you use a remote control on your TV and don't still get up and push the buttons. ;-)

        Cheers, Tim
         
        • Like Like x 1
        • ricky101

          ricky101 Total Gardener

          Joined:
          Jun 15, 2016
          Messages:
          3,290
          Gender:
          Male
          Location:
          Sheffield
          Ratings:
          +4,201
          Hi @T_i_m

          Well surprised to learn your age, just little younger than us :biggrin: - really thought you were of the younger generation, so hats off to you for being so up to date with the technology.:yay:

          Think your above detailed description of how to get a simple HA sytem running has changed our minds and will give it a try, just to say we have if nothing else, we have a wemos 8266 somewhere.

          One thing you might be able to help with as we have are not into wifi, for sake of the test rather than hooking up all the kit for the Rasp pi, we have a 14 year old Toshbia laptop with wifi and w10 that could act as the server but will its old wifi still work of with the wifi of the ESPs 8266 and 32 ?

          cheers

          Ricky
           
        • T_i_m

          T_i_m Apprentice Gardener

          Joined:
          Jul 14, 2021
          Messages:
          20
          Gender:
          Male
          Ratings:
          +17
          Just in case it helps clarify, your 'host' (RPi in your case) doesn't need to be on WiFI and would better be connected using Ethernet. Assuming you *have* WiFi at home, the ESPs will use the WiFi to then connect back to the HA host.

          And remember, the RPi would run 'headless' so the only kit you need to connect to it would be the Ethernet and power. ;-) Once you have done that, you then access it from your PC / Laptop over your network using it's IP address that you can find (without hooking up a screen to the RPi) by scanning the network or possibly looking in your router.

          I can recommend Advanced IP Scanner (free) for this:

          Advanced IP Scanner - Download Free Network Scanner.

          You can check to see what IP address the RPi has come up on and also see what IP the ESP's have been allocated etc. The reason the RPi is good as a host is because you can just download an image and load it onto the uSD card and you are good to go. ;-)

          Cheers, Tim
           
          • Like Like x 1
          • T_i_m

            T_i_m Apprentice Gardener

            Joined:
            Jul 14, 2021
            Messages:
            20
            Gender:
            Male
            Ratings:
            +17
            Morning all,

            Just another graph reflecting some Begonia watering I did yesterday:

            Begonia 2 drinks.jpg
            I gave it maybe an egg cup full at about 11 in the morning and you can see the moisture level immediately went up but more or less straight away started to drop, presumably as the water dissipated within the media.

            At about 9:30 that evening I gave it a bigger water from a small watering can (but no so much as it drained through the pot appeard in the tray) and this time the moisture level went up much higher and seems to have stayed there.

            So the thing that interests me from that is I'm guessing there would typically be an optimal moisture level for each plant species and further from what I have read in the replies here, even the time of the year?

            So, if adding 'n' quantity of water allowed the moisture level to balance across the entire growing medium (through capillary action etc?) then as long as we apply enough water for that to happen, in theory we should be able to automate and maintain whatever moisture level might be considered ideal for that plant in that location at that time?

            That automation process could be quite straightforward.

            If moisture level below X then add small quantity of water and wait 30 mins.
            Rinse / repeat. ;-)

            I think my next experiment (when the moisture level falls again) might be to add known / small quantities of water and see if the moisture level does increase linearly and stay at that value.

            Thinking of how the water might migrate thought the pot, I think I'll rig up 3 sensors (spread around the same pot) and just see if the moisture does typically spread evenly.

            'You can manage what you can measure'. ;-)

            Cheers, Tim

            p.s. I have a bottle of Tomato feed left over from my veg growing days. Did I read that this would be good for a Begonia and if so at what sort of dilution and feeding interval please?
             
            • Like Like x 1
            Loading...

            Share This Page

            1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
              By continuing to use this site, you are consenting to our use of cookies.
              Dismiss Notice