Setup your own hydroMazing

Setup and Use hydroMazing

  • The Controller ( Arduino Nano Expansion Board with nRF24L01 and DHT sensor ) uses 433MHz Transmitter to send codes to remote-controlled AC Outlets or can connect directly via a transistor, MOSFET, or relay.

 

  • Raspberry Pi Web Services Module ( with nRF24L01 ).

 

  • Optional The Advanced Controller ( Arduino Nano Expansion Board with nRF24L01 and uses 433MHz Transmitter to send codes to remote-controlled AC Outlets or can connect directly via a transistor, MOSFET, or relay.  Supports additional sensors:  E.C., pH, Light Intensity, more floats and flow-rate sensors.

 

  • Optional Web-Camera using Raspberry Pi ( with USB Web-Camera ).

 

  • Optional Zone/Node Controller(s) ( Arduino Pro-Mini with nRF24L01 connects directly via a transistor, MOSFET, or relay.  These units are solar-powered with a battery backup.  Also, supports additional soil-moisture sensors.

 

  • Optional The Monitor (Arduino Nano Expansion Board with nRF24L01 ) connected to an Arduino Uno with LCD w/ Buttons Shield.

Each module requires a standard 5 volts power source such as USB.

Setup hydroMazing

Plug-in appliances to their corresponding remote controlled AC switch units:

  1. Intake Ventilation Fan
  2. Exhaust Ventilation Fan
  3. Humidifier / Other
  4. Heater / Additional Lighting
  5. Pump(s)
  • Install the hydroMazing Controller Unit inside the growing area.
  • Provide power to the controller and monitoring devices.

hydroMazing’s default sensors:

  • DHT ( Temperature and Humidity ) Sensor
  • Dallas Temperature Probe Water Temperature Sensor
  • Flow Rate Sensor
  • Float Switch – Low water level
  • Float Switch – High water level

The hydroMazing controller is designed to operate ventilation fans for air circulation, water pumps, occasionally a humidifier, heaters, or any other appliance that is necessary to maintain an ideal environment for plants to grow.  Monitoring and controlling the system is mostly done for us, but when the hydroMazing needs to alert us to a problem it can by using the Raspberry Pi.

Using float switches:

  1. Top float switch used to indicate vessel is full of liquid.
  2. Middle float switch provides warning or triggers a pump to refill.
  3. Bottom float switch turns off pumps and notifies attendant that vessel is out of liquid.

Using the flow sensor’s data we can determine the flow rate of the liquid being pumped.

Hook Up Your Raspberry Pi

Connecting all your devices to the Raspberry Pi is very easy, but you want to do it in a specific order so it can recognize all your devices when it boots up. First, connect your HDMI cable to your Raspberry Pi and your monitor, then connect your USB devices. If you’re using an ethernet cable to connect to your router, go ahead and connect that as well.  Finally, once everything is connected, go ahead and plug in your power adapter. The Raspberry Pi does not have a power switch, so once you connect the power adapter, it’ll turn on all by itself.

Connect to Your Wi-Fi Network

Connecting to your Wi-Fi network works the same in Raspbian as it does it any modern operating system.

  • Click the network icon (it’s the one with two computers) in the top right corner.
  • Select your Wi-Fi network name, and enter your password.

That’s it, you’re now connected to Wi-Fi. This will work in both the command line and in the graphical interface, so you only need to set it once. If you have an older Pi and you’re using a Wi-Fi adapter like this, the process is the same.

You have several devices connected to your WiFi router, so how can you tell the outside where you are serving-up Raspberry Pi?

Getting Online

The following section assumes you have an updated and upgraded Raspberry Pi 3 or equivalent, and installed L.A.M.P. (Linux.Apache.MySQL.PHP.)  Excellent article for getting started and RaspberryPi.org’s installing LAMP.

You have several devices connected to your WiFi router, so how can you tell the outside where you are serving-up Raspberry Pi?  Let’s get familiar with our router’s advanced settings in your router manufacturer’s configuration tool.  Most home networks use one of these common IP addresses for their gateway to the Internet:

place-wifi-router

You will need to login to your router’s configuration tool.  The username and password should have been assigned at the time of setup.  First, we need to reserve an IP address for our Raspberry Pi to use on a regular basis.  Typically, the router will have a DHCP (Dynamic Host Configuration Protocol) Settings section, List and Bindings, etc.  The Raspberry Pi and all other devices on your LAN should be listed here.  Hopefully, your router will have a somewhat intuitive interface that will make sense as to how to assign an IP address to a device or MAC address.  If all else fails, consult your manufacturer’s instructions.

decapi-slider-raspberry-pi-casenetwork-782707_1280-980x637

The default port for web requests is 80.  You can leave the default unless your Internet Service Provider doesn’t allow port 80.  Next step in your router’s configuration is to have the router forward all incoming requests on port 80 to the Raspberry Pi.  Typically referred to as, Port Forwarding or Port Range Forwarding.  You will want to associate the Raspberry Pi’s IP address so that it will receive all incoming requests on port 80 or whatever port you find most appropriate.  (The most secure web server is one that is not connected to the Internet 😉  The default port for SSL is port 443.  Next step in your router’s configuration is to have the router forward all incoming requests on port 443 to the Raspberry Pi.  Motion Web-Cam Streaming:  The default port for motion is port 8081.  Next step in your router’s configuration is to have the router forward all incoming requests on port 8081 to the Raspberry Pi.

You could also allow Telnet, FTP, SSH, VNC, etc but I do not recommend unless you are familiar with the security risks associated with such services.

Get Yourself A Domain Name

http://www.YOUR_CUSTOM_DOMAIN.ddns.net

Check for the DDNS ( Dynamic Domain Name Service ) Setting in your Router’s advanced configuration settings.  Most routers will support one or more of the following, http://www.dyn.comhttp://www.noip.com, many others search Google for “Dynamic DNS”.  The service will offer the ability to register a domain name to associate with the Dynamic IP address that is assigned to you by your Internet Service Provider.  Typically, your router or a software plugin that you download and install will update the Dynamic DNS service’s database when your assigned IP address changes.

Secure Socket Layer

https://letsencrypt.org/

Let’s Encrypt our connection with the Raspberry Pi.

Install

Rather than apt-get Cerbot, I download the latest version directly from its repo:

sudo git clone https://github.com/certbot/certbot /etc/letsencrypt

Easy SSL through Automation

Certbot has a fairly solid beta-quality Apache plugin, which is supported on many platforms, and automates both obtaining and installing certs:

sudo /etc/letsencrypt/certbot-auto

 

Your domain name for your hydroMazing should now be secure.

Is Hydroponics a Scam?

What do you think when you hear the term “hydroponics”?

Do you imagine technicians in white lab coats tending sterile trays on a space station?

Or maybe you think of massive commercial operations that cost more thmuch-budding-in-tent-sman you make in a year?

 

Or maybe you think of a group of stoner’s growing weed?

 

Two of the biggest reasons that hydroponics has such a bad reputation, is that purists swear it is unnatural to garden in a medium other than soil, and hydroponics stores are often motivated by selling you the most expensive equipment and consumables.

plant-needs-chart

The truth about hydroponics, as with most things in life, is somewhere in the middle. If you are ultimately interested in gardening using aquaponics, consider hydroponics the gateway to aquaponics.

History of Hydroponics

The earliest examples of hydroponics date back to the Hanging Gardens of Babylon and the Floating Gardens of China. Humans used these techniques thousands of years ago. Although the general theory behind hydroponics remains the same, modern technology has enabled us to grow plants faster, stronger, and healthier.

The best way to find out, is to try it for yourself.

I enjoy helping people, like myself, who prefer to garden outside but want to be able to extend or even grow all year long.  Think of indoor gardening in the same way that you think of brewing beer at home.  Indoor gardening is a hobby for most people do not have access to large indoor spaces, so it is unlikely that they would be able to grow enough plants to make a profit.  The greatest benefit to growing your own consumables is that you will appreciate the amazing results even more because you’ll know how the plants were treated.

Where Do I Start?

 

 

The Making of hydroMazing

 

It was two years ago when I decided to try using an Arduino Uno microcontroller to replace my individual Lux WIN100 Heating & Cooling Programmable Outlet Thermostat.  These outlets control an appliance, such as a small heater or, in this case, a ventilation fan.  A device that is plugged into the outlet turns on and off the appliance by using temperature settings that you manually program into each device.  This technique for controlling the ventilation fans is effective, yet uses several extension cords.  The temperature outlet controllers use old-fashioned relays to switch the state of the device.  My initial attempt was to hack an extension box inserting my own relays into it and connecting them to the Arduino Uno.  It wasn’t very long before there was a mess of wires with lots of connector nuts and I was left feeling discouraged.

A home automation idea that I had bouncing around in my head for a 20150412_104406while was to use wirelessly controlled AC outlets that use a hand-held remote-control.  Hacking the remote control to send the signal for the ON or OFF button selected by a corresponding pin on the Arduino Uno shouldn’t be too difficult, right?  The nagging concern that was preventing me from testing this idea was the fear that the signal would not be reliable and the Uno might “think” it had turned on a device when it actually failed.  Eventually, I was able to convince myself that the best way to find out is to just try and see what happens.  Unfortunately, the results of this test wasn’t much better than the relay attempt.

A search on the web for nearly any sensor or electronic doo-dad with “Arduino” will result in a number of products being sold for a few bucks.  In this case, I found the 315Mhz and 433Mhz transmitter and receiver pairs that are within the frequency range of most commercial wirelessly controlled outlets.  The greatest advantage to using the Arduino family of microcontrollers for these types of projects, is that you can find open-source software to get started.  Another search on the web for an “Arduino library” and in this case, transmitter and receiver or tx/rx pair.  Now, it was getting exciting for me.  I could read the codes coming out of the remote-control, record them, and then program the Arduino to control the corresponding outlets.  Designing the software to operate on the Arduino Uno became the challenge.  The examples that come with the Arduino software and the examples included with libraries are an excellent start to a project.  In my experience, once you start combining and making modifications to the examples it doesn’t take very long before you hit a wall.  I don’t think I’m a good programmer, I think I’m a stubborn perfectionist.

In one of my favorite books, Zen and the Art of Motorcycle Maintenance the author, Robert Pirsig, speaks of the gumption trap.  Essentially, the gumption trap is an event or mindset that can cause a person to lose enthusiasm and become discouraged from starting or continuing a project.  Knowing when to push through the discomfort and frustration and when to take a break and walk-away from the project are personal challenges.  There have been times when if I had taken a break, I might not have come-up with an excellent solution to a conflict in my source code.  Contrary, there have been times when I have walked-away for a month and worked on a completely different type of project feeling reinvigorated.   Perhaps, if the project is important enough, we will be compelled to return to work on it.  The trap is convincing ourselves that the project isn’t worth returning to even when it could be amazing.  Maybe it really isn’t worth returning to complete and this is where many projects end.

 

The software I have developed has been programmed into the microcontroller and features a set of base parameters for timing, managing, transmitting, and receiving “sensor” objects and “appliance” objects.  Control of appliances is achieved through a set of algorithms I have named “TheDecider,” which makes decisions based on sensor readings and pre-programmed thresholds and prompts the microcontroller to turn on or off the wirelessly controlled outlets.  I wanted the system to be easily modified to work with other environments including aquaponics, growing mushrooms, and anything where control is achieved by reading sensors and operating appliances based on programmed rules.

 

The wirelessly controlled outlets proved to be a etekcity_outletsreliable method of controlling the fans using the Arduino to send the signals depending on the temperature sensor’s readings.  It didn’t take long for the source-code to evolve into a beast.  The Arduino family of microcontrollers is limited in how many instructions it can run and hitting the program size limit doesn’t take very long when you want to control more than a few blinking LEDs.  I have found that the size limitation has forced me to write better, more efficient code than I initially do.  Even with creative variable handling and custom libraries, eventually, there is a need for another microcontroller or to move to a larger one.  There are several ways that the microcontrollers can communicate with each other.  The least expensive wireless method I could find is the nRF24L01 wireless radio transceiver.  The module is a low-power, lightweight variety of bluetooth giving hydroMazing the ability to communicate with a monitoring unit.fpzexmwi7vqs7mr-medium

I decided to add another Arduino Uno with an Liquid Crystal Display shield so that I could display what the sensors were reading and state of appliances.

I made my own open and adaptable platform that can be custom tailored to a wide variety of gardening needs and conditions; yet, also a self-contained wireless system.  The open-architecture of the system allows for ease of integrating Internet connectivity and web services.

hydroMazing outside the box
hydroMazing outside the box

Today, the project, I named, hydroMazing uses a listening Raspberry Pi for logging and communicating via email and text messaging.  In addition to the main system, I have further developed hydroMazing to include solar-powered ‘nodes’ offering even greater flexibility to scale in size accommodating outdoor gardens and industrial greenhouses.