Posted on Leave a comment

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 Leave a comment

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 Leave a comment

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 Leave a comment

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.