Mist Controller

How’s it going?

I started the idea of this mist controller on 4/20 around 9:00 am. A little history on my use of micro-controllers: Before I was sure of what I wanted to do in college, I took some electronics, radio, robotics, etc. classes. In robotics class, I was introduced to the BASIC Stamp. This was around ten years ago, and it was a good introduction to micro-controllers. I got my first Arduino in 2012. I was never able to get into Raspberry Pi, as over the years, failure rate was unacceptable. Thankfully, the OPSEPP Uno I had still worked, and I decided to bring it back into my hobby space.

My inspiration was the greenhouses in horticulture class. We used a few different ways at school to work with seedlings and cuttings. I don’t want to have to hand water what looks like a dead cutting of Vitis in 50/50 mix for 5 months. I don’t think anyone does, so we used mist technology. We used this one system for a while that had a control container with one of those pressure moisture sensors to know when to mist. Then, we had a “leaf” system that used some sort of gravity/resistance reading to know when to mist. I didn’t grow up in the 1970s, so i’ve never seen my type of controller in operation; however, they exist.

The second part of the total mist system is the irrigation. This part gave me a friggin headache, and it was one of the biggest reasons why I wanted to do this. It started long ago in my backyard garden. I wanted to bring portable mist technology in the garden where I wanted to plant a row of corn, beans, or anything really. I made this.

This setup never came to be a full system, so the mist water system was moved all over the yard. At one point it sat behind my greenhouse for at least a few years. Rewind to like 3 weeks ago, and I had my idea: make a mist controller using some spare parts. I thought that I could finish this project on 4/20, and it would be great. It took around four revisions to complete.

I knew that my Rio 2100 in a bucket wouldn’t be able to supply water to all the misters on the original setup, so I trimmed the number of misters down to four. This worked with the hose, but it was never enough pressure from the pump. So, I chopped it down to two misters. Still the pump couldn’t create fog from both. I tried 1/2 in drip supply tubing, and it still didn’t work. I began doing some research and I made this in blender.

Looking more into RO, ice makers, outdoor mist systems, I decided to take an idea from an inkscape that I made a while back.

The pumps may work for the above system and the second one is for redundancy, but I knew that I needed a higher water pressure for the mist foggers. I decided to use one of those 12v NC h2o valves with the pressure from a hose.

By changing to 12v, I had to redesign the control unit. I brought in earlier ideas to finish it up. These are HV, MV, LV modules made to work with arduino; they can be driven from a slave unit via i2c.

The LV mod was selected, because the h2o valve is 12v. I’ve been torn over using a MOSFET and flyback diode to switch the solenoid, as I have a bunch of songle opto-isolated single relays that will work. The price is around the same, unless I was going to make a run of these. I think the MOSFETs may work out to be around 50 cents cheaper. Either way, I needed the 12v power supply from LV unit for the greenhouse.

Here is the complete set.

The first thing that I had to fix throughout the revisions was getting rid of the 120v in the controller. After that, I found the photo-resistor attached to the front top left corner of the unit seemed to not want to work. It became over saturated, I guess. Anyway, here is the insides.

The photo resistor problem was fixed using a light sensor on a comparator board as seen in the center. The relay in the upper right corner is now connected to the 12v power supply and the water valve. I do not have a eagle file, as I have not learned KiCad yet. However, I do have the code for the arduino nano.

/*
Mist Bench Controller
By peat
Created 4/20/2018
Modified 5/06/2018

Two potentiometers drive the on and off time of a relay.
A photoresister causes the system to work only during daylight.
*/

const uint32_t SEC_DELAY  = 1000;
const uint32_t MIN_DELAY  = 60000;
const uint32_t HOUR_DELAY = 3600000;
const int relayPin        = 3;
const int onTimePin       = A6;
const int offTimePin      = A5;    
//const int lightPin        = A7;
const int lightPin        = 13;
const int valveOffset     = 200;
bool relayState           = HIGH;
int onTime                = 0;
int onDelay               = 0;
int offTime               = 0;
uint32_t offDelay         = 0;
bool lightValue           = HIGH;  

void setup() {
  digitalWrite(relayPin, relayState);
  pinMode(relayPin, OUTPUT);
  pinMode(lightPin, INPUT);
  }

void loop() {
  lightValue = digitalRead(lightPin);
  if (!lightValue){
    onTime = analogRead(onTimePin);
    if (onTime >= 0 && onTime <= 84) {
      onDelay = 5 * SEC_DELAY;
    } 
    else if (onTime >= 85 && onTime <= 129) {
      onDelay = 10 * SEC_DELAY;
    } 
    else if (onTime >= 130 && onTime <= 303) {
      onDelay = 15 * SEC_DELAY;
    } 
    else if (onTime >= 304){
      onDelay = 20 * SEC_DELAY;
    }
    digitalWrite(relayPin, LOW);
    delay(valveOffset);
    delay(onDelay);
    digitalWrite(relayPin, HIGH);
    offTime = analogRead(offTimePin);
    if (offTime >= 0 && offTime <= 86) {
      offDelay = 2 * HOUR_DELAY;
    } 
    else if (offTime >= 87 && offTime <= 128) {
      offDelay = 4 * HOUR_DELAY;
    } 
    else if (offTime >= 129 && offTime <= 244) {
      offDelay = 6 * HOUR_DELAY;
    } 
    else if (offTime >= 245) {
      offDelay = 8 * HOUR_DELAY;
    }
    delay(offDelay);
  } else {
    delay(15 * MIN_DELAY);
  }
}

I have a new seed recipe that I want to try from Plant Propagation Principles and Practices first published in 1959. The book was used for inspiration really, if the medium is too wet. I’ll probably switch to 50/50 with perlite or a 3:1 peat perlite mix. Here’s what I did use:

4.5 qt peat
4.5 qt verm
1 tbsp kelp meal
1 tbsp blood meal
0.5 tbsp lime

I’m trying veggies to start, until I can figure everything out. I put a camera in the greenhouse. Here is a shot.

I’m using jumbo six packs with some tomatoes, bell peppers, and sweet peas. The camera is nice. I have it send push notifications when there is motion to track misting. I have to put my phone on the bench when i’m working in there, because it blows up with notifications. Hope this was somewhat easy to follow, as I wrote it over a few weeks. Feel free to ask for clarification. Ask any questions, too. This continues to be a fun project.

19 Likes

Awesome! Awesome! Awesome!!!

1 Like

That’s bad ass @peat. Thanks for ssharing!

Stay hazed
Jake

That is really high tech… :nerd: Very smart!

Wow, back to the future all over again.

Nice set up.

99%

Anyone building and sharing there arduino projects get a thumbs up from me :wink:

As for the relay vs mosfet debate your having with yourself, ive gone down both routes for my own projects, but i prefer the mosfet route when working with dc voltage, relays if im working with say 120vac. But really even though a bit more work like the mosfet route overall.

Also watch out feeding your arduino with 12+v, if its a genuine one or a well build knock off it isn’t a problem, but i have run into issues with some cheap pro micros with crappy/lesser spec linear voltage regulators that would burn if you even waved anything higher than 7v at them.

5 Likes

I’m powering the Arduino nano from a USB cable. One of the pictures was cutoff, but here is a better view.

I’d like to soon move to using the arduino’s vin pin; however, this allows me to upload code changes quickly.

3 Likes

looks really cool. i want to learn that stuff one day, probably after i move and my grow is in a more permanent location i’ll start decking it out with automation and stuff. do you have any video footage of the misters actually operating?

I made a video with ffmpeg, but i’ll have to work on a way to host it. I was going to point out in the video that the spray hits the sides of the trays, yet one or two of the corners is still a bit dry. Here is a picture from the end of the movie; I’ve been thinking of ideas to even out the spray patterns.

Since my greenhouse is not climate controlled, I ran into another possible problem. I had the controller set at 5 seconds on and 2 hours off, because we were in a bit of a heat wave. As the temperature outside cooled down the watering cycle became too aggressive. I’ll probably soon move to tracking the soil’s moisture level. I’ve used both of the sensors pictured below, and they each have their own unique properties.

I’m thinking of adding a CAT3 jack to the mist controller. Then, I could hook these straight in. I need to get all the pictures together for my indoor boxes, as I have them wired for automation also. With those, I get to use other parts of the Arduino like one wire.

4 Likes

I love the DIY stuff. Nice work. And innovative.

The power strip next to the water hose is a bit worrisome though :cold_sweat:

1 Like

That soil moisture sensor will fail. I ended up making my own and changed my code and wiring around to fix the issue.

You will want to have your soil sensor only have power when its taking a reading. I can go through my old code if you would like.

Currently though i just dedicate a attiny85 specifically for that duty and my code is way simpler as i dont have to work in timer registars and remembering when things were last checked.

My little water circuits there is a resistor hiding under the attiny85 board, and one of the pins i had to change 5 to 4

But one of the terminals is for the probe and the other goes out to the pump, but im running small stuff (12v pump running at 7v) and the leads on the top are just a 2 way small rc electrical connector that plugs into my source power

My probe are stainless steel rc axle rods, just cut and epoxied into a non conductive separator. Though my newer versions use more flexible wire (stranded vs solid core) and are completely epoxy encased on the top.

But ive had your style sensors fail for me within a couple of days to a week due to corrosion “electrolysis”, where as my stainless steel ones some have been in use for over 2 years with still next to no sign of use, but thats mainly due to coding.

4 Likes

Thanks for sharing. It’s always nice to meet other electronics enthusiast.

I heard horror stories surrounding the moisture sensors, but I figured that I’d give them a try anyway. I’ve used them for data logging here and there, but nothing serious. If I remember correctly, I had the 5v for the sensor connected to a digital out pin on the arduino. Every half hour or so, I set the digital out high, read the sensor, and set the pin low again. It seemed to work, but I have always been trying to find a better way. Here is a page from a soils class I took called Soil Science & Management by E. J. Plaster:

It’s good to know that there are more rugged solutions out there.

2 Likes

yeah i ended up doing my programming so that the soil sensor gets turned on for 2 secs before its reading, then shuts off right after, and is off for the length of the duration time between checking, in my case 1hr

1 Like

Have either of you tried the technique where you alternate the polarity of the sensor? It’s supposed to prevent the electrolysis.

It just extends the life of the sensor, as instead of just the anode side being consumed, both become that way.

Saying that for myself i can just swap the leads of the sensor to achieve that say every cycle if i wanted to keep things even. its not the same as alternating each time the senor is used, but its just a simple alternative if i was so inclined.

2 Likes

Why not using interrupts ? That way system can react to changes and not have a fixed timeframe for reading…
Just my 2 ¢
Ds