Posted on

ProGrow Update #5 – Bluetooth using HC-06

Progrow Side - Feb 16 2017. HC-06 visible in the top right

I’ve been severely neglecting the ProGrow the past couple of weeks. The cat grass died a while ago, but I’m planning on planting some catnip in the future. Right now, I’m going to try to focus on getting some wireless functionality into it. I have an ESP8266 module that is capable of adding Wifi to the system, but I also have an HC-06 Bluetooth module. I’m going to test out the Bluetooth for now, so that I can send commands to it from my phone or PC.

The HC-06 and HC-05

HC-06 with Breakout Module Front View
HC-06 Bluetooth chip with breakout module, Front View

The HC-06 and HC-05 are inexpensive and easy to use Bluetooth modules. The 05 and 06 are virtually the same, but the HC-06 is only capable of acting as a slave, while the HC-05 is capable of acting as a master/slave. The blue board in the picture above is a breakout board with a voltage regulator for the primary chip.

Adding the HC-06

It’s incredibly easy to wire up the HC-06. All I had to do to connect it to my Arduino UNO was:

  • VCC to 5V
  • GND to GND
  • TX to Pin 2
  • RX to Pin 3

If your module has a breakout board attached, then it will be 5V tolerant. If it is a bare module, you’ll need to make a voltage divider in order to provide 3.3V to the chip.

 

HC-06 with Breakout to Arduino UNO Schematic
HC-06 with Breakout to Arduino UNO Schematic

Connecting with the HC-06

I’m using the library SoftwareSerial to utilize my digital pins 2 and 3 as RX/TX,  instead of 0 and 1. This is because when you have something connected to pins 0 and 1, and try to upload to the board via USB, it can cause a communication issue. At least it did that for me.

All I had to do was include the SoftwareSerial library, and then initialize pins 2 and 3 using:

SoftwareSerial HC06(2,3); //RX, TX

That way I can use “HC06” for serial functions on different pins. It has to go before the setup function.

 

I’m using a Bluetooth dongle on my PC to send commands to the HC-06. I can connect to it with the Windows Bluetooth interface, using the default password of 1234. I’m using PuTTY to connect to the COM port that is associated with sending data to the HC-06, and then I send commands through the PuTTY terminal.

I can read data that is sent to the HC-06 using:

btData = HC06.read();

Then I can use a simple if statement to make decisions based on whatever value I sent to the module. For example:

if (btData=='1'){
    displayData(); //displays all sensor values on screen
}

 

What’s Bluetooth needed for?

Right now I use the Bluetooth to issue basic commands wirelessly. I can send commands to the ProGrow from my computer using Putty. I can have the system output to the display, water the plant, write to the SD card, change the automatic sample delay and force a measurement.

 

What’s next?

I want to use an HC-05 module instead, which will give me many more connectivity options.

I am going to design new cases for all of the modules. My goal is to create a single box that will house all of the primary components, instead of having them distributed across the front or side of the container. I also want to get some catnip planted.

 

 

 

 

Posted on

ProGrow Parts List

Pro Grow

This is a rough list of the parts that I have used to make the first few ProGrow prototypes. Everything that I have used for the ProGrow prototypes has been purchased through AliExpress, because I’m super cheap. There are many alternative parts that you can use and find on your own that will achieve the same or better results. I’ll try to explore some alternative options. You can use this as a guide for what sort of modules you might want for your own personal projects.

Pro Grow
Pro Grow System

Parts List:

Main board:

An Atmega 328P development board is used as the main controller in the ProGrow. It’s basically an Arduino UNO clone. Any Atmega based development board should be able to do the same job. You could also potentially use an ESP8266 for integrated wireless function, but that is a different story.

Links:

Aliexpress – Amazon.ca – Amazon.com – Adafruit – Sparkfun – Arrow

 

Board Enclosure:

I use a simple acrylic enclosure on the Arduino UNO to make it easier to mount it to stuff. I have also had great success using a 3D printed UNO case, so I’ll include a link to that if you want to print one for yourself.

Links:

Aliexpress – Arduino UNO Case by Torsten

 

LED Display:

I use a green LED display from RobotDyn as my primary means of display and system monitoring. They’ve got all sorts of display types, modules and boards available, so I’ll include a link to their store page.

The display uses the TM1637 library.

Link:

Green LED Display – RobotDyn Store Home Page

 

Air temperature & humidity sensor:

I use the DHT22 as my air sensor. It’s capable of fairly accurate temperature and humidity measurements using the DHT library. It interfaces painlessly with the Arduino using only one GPIO for data, so it has a lot of function in a small footprint.

You can also use the DHT11 as an alternative. The only differences are that the DHT11 is cheaper and slightly less accurate.

You can use the DHT library that is accessible through the Arduino IDE.

Links:
Aliexpress DHT22Aliexpress DHT11 Amazon.ca DHT22 – Amazon.com DHT22

 

Soil Moisture Sensor:

I use the dirt cheap soil moisture sensors that you can find online. The ones from Aliexpress are less than a dollar, and they have worked fine for me for almost a year now. It’s always good to buy extra at these prices, though.

I use the sensors analog output with the Arduino, so that I can have the arduino make decisions based on the moisture value.

Some of the modules have the ability to be set so that they will output a logic high when at a certain moisture threshold. If the description doesn’t say it, you can look for this functionality by looking for a potentiometer on the board that connects to the sensor. You can do the same thing with programming, though.

Links:

AliexpressAmazon.caAmazon.com

 

Relay Module:

I use a relay module to control the water pump in the ProGrow. A relay module is a bit overkill for such a small DC pump, but it allows a lot of expansion opportunities and interfacing it with the Arduino is dead simple. I went with a prebuilt module, since I could just sticky-tape it right onto my project. You can buy relays of all shapes and sizes on Aliexpress.

Links:

AliexpressAmazon.caAmazon.com

 

BH1750 Light Sensor:

I use a BH1750 light sensor with the ProGrow. There are many light sensor alternatives out there that work great and basically do the same thing.

Link:

Aliexpress BH1750Aliexpress Generic Light SensorAliexpress RobotDyn Light Sensor

 

DC Water Pump:

I use a simple submersible DC pump to move water into the container for the ProGrow. Any pump will work, as long as you can control it using the relay and Arduino.

Link:

Aliexpress – Amazon.caAmazon.com

 

SD Card Module:

I use a generic SD card module to record data to a MicroSD using the SD and SPI libraries that are built into the Arduino IDE.

Link:

Aliexpress

 

Breadboards:

I use 170-point breadboards for handling the circuitry for the ProGrow. I love them because they make it very easy it to attach basic circuits to your prototypes.
There are all shapes, sizes and price points available online.

Links:
Aliexpress – Aliexpress Generic Breadboard Search

 

Push Buttons:

I use the cheapest, simplest push buttons that I could find. They slot into a board, and go clickity-click! You can find them anywhere, in all sorts of shapes and sizes and colors. I use momentary push buttons.

Links:
Aliexpress

 

 

I’ll update this as things change or if I think of something I missed.

 

Posted on

ProGrow Update #4 – SD Card, Analog Buttons & 3D Printed Enclosures

ProGrow Version 1.0

ProGrow Update #4

ProGrow Version 1.0
ProGrow Beta

 

I completely revamped the layout and configuration of the modules on the front of the ProGrow. I designed and printed some basic enclosures for all of the different little modules to help isolate each unit and tidy it up. It’s still a mess of wires, but I’m making progress on the overall design. I used 3DS Max to design the basic enclosures, and then I used my Kossel Delta printer to make them. Most of the things were printed using white PLA, but I ran out and used black PLA to print the 9V battery enclosure.

3D Printed Enclosures

This slideshow requires JavaScript.

 

I’ve successfully added an SD card module to store data for the long term. I have a spare 16gb MicroSD in there right now, so I have a few years worth of samples that I could store. I’m going to change the SD card to a smaller, more robust one to help avoid catastrophic accidental corruption. I use the SPI.h and SD.h libraries in order to read/write to the SD card and I store the sensor data in a .txt file. I’m working on graphing the data automatically, but it’s not a priority right now.

 

4 Buttons Connected To One Analog Output
4 Buttons Connected To One Analog Output

I removed the 4 digital buttons that I was using for manual control. I made a circuit that outputs an analog signal instead of a digital one, and connected the buttons to a free analog pin. This freed up 4 digital pins for future use. I use a few series resistors to create different analog signals that gets sent out through the purple wire in the image above. The buttons are placed so that they will see different levels of resistance from the chain of resistors when pressed. The programming simply reads the analog value and then makes decisions based off of the value. Much more pin-efficient than before!

 

The LED display made the old RGB indicator light obsolete, so I removed it. This gives me even more digital pins for future use.

 

I’m going to work on reducing the power draw, and implementing batteries next. I’ll be publishing a parts list sometime soon.

Posted on

ProGrow Update #3 – Growth, Batteries and Mold

ProGrow Update #3

The ProGrow has been exploding with growth over the past few days. Some of the blades are over 6″ now, despite Ozzies constant attempts to eat all of it. The soil started to develop a very small amount of harmless white mold. I assume the mold is due to the consistently high moisture levels. I treated the mold by adding a trace amount of potassium bicarbonate and cinnamon to the soil, and to the water. The mold vanished in less than two days and the grass seems to appreciate it. I also reduced the frequency of automated watering to once every 6 hours at the most, and changed the moisture threshold that turns on the pump. This should help reduce the moisture levels of the soil, to discourage further mold growth.

ProGrow Update #3 - Batteries and Stuff
ProGrow Update #3 – Batteries and Stuff

 

Batteries

I tested the 18650’s that I had laying around, and only two of the batteries were still functional. The other two seemed to be almost completely discharged and are most likely at the end of their life. I’m going to use these two to create the new battery pack for the system. I still need to test the Macbook battery that I have to see if it’s a potential solution, but I prefer the 18650s due to their profile. I’m still waiting on the charging modules from Aliexpress, and it could still be a while. Once the charging modules arrive, I’ll charge up the batteries and do proper measurements to get an idea of their health.

18650 Batteries
18650 Batteries

 

I am considering moving the system from an Arduino UNO to an Arduino Nano. I believe that it would let me reduce the footprint of the project as well as reduce idle power consumption. I’ve received my SD card module in the mail and intend to implement it into the ProGrow as the next step. I am going to remove the RGB indicator LED in order to free up GPIOs for the SD Card. Ozzie seems to like hanging out right next to the ProGrow. It’s like a grass buffet for him!

Ozzie chillin' next to the ProGrow
Ozzie chillin’ next to the ProGrow
Posted on

ProGro Update #2 – USB Battery Bank

ProGrow Update #2 – Battery Bank

ProGrow with USB battery bank
ProGrow with USB battery bank

 

I’ve upgraded the system to include a USB battery bank. I’m using a cheap 4400mAh battery at the moment, but intend to upgrade it to a better system. I have a bunch of spare 18650’s and a MacBook battery that I could use, and I’ve ordered some charging and voltage step-up/step-down modules from Aliexpress to build a custom charger. I’m also going to invest in some solar panels to make the system recharge during the day, but I will need to find out my current draw and other things before I buy them. Right now the system requires too much power to have a realistic solar panel recharging system.

ProGrow Powered On
ProGrow Powered On

 

I ran into some initial difficulties using the battery bank to power the Arduino. The bank is designed for charging phones, it has an automatic shutoff feature if the output current is very low. During normal operation of the ProGrow, the battery shuts off after approximately 10 seconds if current draw is under 50mA. I had to make the automatic sampling time ~5 seconds, so that the LED display would turn on and draw enough current to keep the battery active. From 1/4 charge, the battery bank was able to power the system in its current state for ~18 hours. Not bad for a first run I suppose, but future versions will be much better. I’ll have to make a better battery bank and find out my current draw before I continue.

 

 

Posted on

ProGrow is under development… again!

ProGrow Development

I’ve just started work on my ProGrow system after quite a long period of inactivity. Surprisingly, everything on the ProGrow still worked when I first plugged it in after so long. The moisture sensors didn’t seem to accumulate too much corrosion, and everything was still reading properly. It even had the program still loaded. Pretty crazy, considering it’s made using the cheapest parts available, went through a move and has sat idle for 6+ months. The plant that I used to have in the system was very dead. I replaced the soil, added a layer of cat grass seeds and then put an inch of soil over top. I chose cat grass because it’s super cheap, grows like crazy and I have two cats.

ProGrow Day 7 Growth From Front
ProGrow Day 7 Front

DC Pump

I bought a 3V-6V submersible pump from Aliexpress. It cost approximately $2 for one pump! That’s pretty darn cheap. I tested the pump by connecting it directly to a ~6V 18650 battery bank, and it pumped like crazy. It seems to work fine with a 9V battery as well, so I ended up using one of those because I had plenty of spares. I’m going to implement a more permanent rechargeable battery bank soon, possibly with some kind of solar power.

3V-6V DC Water Pump
3V-6V DC Water Pump

Relay Module

I added a double relay module to the project ( also bought on Aliexpress ), and connected the inputs on the module to digital pins 12 and 13 on the Arduino. It gets 5V and a ground connection from the nearby breadboard that holds the button inputs. A 4 digit segment display was added to the front to display the current sensor readings, instead of sending the information through the serial connection. I bought the display from RobotDyn on Aliexpress ( big surprise ), and it uses the arduino-tm1637-master library. Currently it displays the temperature, air and soil moisture, ambient light, run time and the delay between automatic samples. It also displays the project name and some other stuff while turning on.

ProGrow Day 10
ProGrow Day 10 with relay & LCD

Watering

I attached a mason jar to the side of the container in order to act as a water reservoir. With some hot glue and double sided tape, I attached the pump to the inside and ran some wires. I attached the pump to a 9V battery, and connected that to the relay that is controlled by pin 12 on the Arduino. I use the values read from the moisture sensors in order to control power to the pump. When the soil moisture falls below a certain threshold for a certain length of time, the pump will engage and water the plant until the average moisture rises back up. I plan to add another sensor to indicate when the water level is low in the reservoir, so that it won’t burn out the pump if there’s no water.

ProGrow Day 11 Status
ProGrow Day 11 Status

 

I intend to remove the RGB LED on the side to free up 3 more GPIOs. This will give me extra pins for future use. I am also going to move the relay modules to different pins.

I’m going to try to design and 3D print some customized enclosures for the modules that I have added. When my wireless chips and SD module come in the mail, I am going to implement wireless data logging and communication. I’m also looking into purchasing a sensor expansion board, and some silicon boards to clear up the wiring a bit. Not sure if the name “ProGrow” is going to stay.

I’m also going to try to make more detailed posts about the individual steps at a later date.