Build Log January 16th

I’m excited to see if I can connect to the Sparkfun’s esp8266 shield with the FTDI “thingy” I got yesterday.  I’m also hoping to hear back from Sparkfun…could this be the day I figure out what is stopping the esp8266 wifi shield from not working…..could it…the answer is…maybe.

I also want to make progress on the Grow Chamber housing.

Debugging Sparkfun’s ESP8266 WiFi Shield

I soldered on headers to the esp8266 FTDI pinouts and connected the Shield to the FTDI board/cable:

NewImage

set up CoolTerm:

NewImage             NewImage

and it worked!  

NewImage

I played around with the commands Sparkfun had laid out in the wifi shield tutorial.

So the wiFi shield works as expected when not mounted onto an Arduino Uno.  This leads me to believe the challenge is with the connection between the Arduino Uno and the (software) serial ports.  Most likely this is a software issue.

  • step 1: check that I have the right version of the Arduino IDE.  It has to be at least 1.6.4.  The version I have installed is 1.6.11. OK
  • step 2: check that I have the right library installed for the esp8266 shield.  See the link on Sparkfun’s hookup guide under installing the AT Library. OK
I found this dialog box highlighting the Sparkfun esp8266 AT library for Arduino was installed:
NewImage
hmmm….no updates since 2 years ago….whoa…no bugs in two years?  I wonder how much this shield has been used/tested.
  • step 3: check out if the software serial port is working with this configuration.
Checking YET AGAIN to make sure the UART switch is set to SW:
NewImage
code can upload to the Arduino Uno from the IDE…so all is fine here.  Load and run ESP8266_Shield_Demo.ino.  The serial monitor shows:

Before test()
Error talking to ESP8266.
Error: 0
Looping forever.

Frustrated FAIL

 Looking at the header file (SparkFunESP8266WiFi.h):

/////////////////////

// Pin Definitions //

/////////////////////

#define ESP8266_SW_RX9// ESP8266 UART0 RXI goes to Arduino pin 9

#define ESP8266_SW_TX8// ESP8266 UART0 TXO goes to Arduino pin 8

 

bool begin(unsigned long baudRate = 9600, esp8266_serial_port serialPort = ESP8266_SOFTWARE_SERIAL);

Since the code fails in the test() function (see SparkFunESP8266WiFi.cpp) sends:

sendCommand(ESP8266_TEST);

and ESP8266_TEST is defined as:

const char ESP8266_TEST[] = “”;// Test AT startup

in ESP8266_AT.h, I changed this to:

const char ESP8266_TEST[] = “AT”;

No luck. Waiting for Sparkfun support…sigh…

I’m going to do an early publish so Sparkfun support has access to what I’ve done.

 

Build Log for January 15th

I am very grateful for Dom’s comment today.  It made me reflect on how clueless I can be…

Simpson DOHDOH!

I cluelessly thought – actually I wasn’t thinking – I could talk to the esp8266 through the Arduino. I didn’t bother to consider the esp8266 programming pins on the shield.

 

From here: The ESP8266 WiFi Shield can also be repurposed and reprogrammed through the programming port. Whether you want to add AT commands of your own, or flash custom firmware on the ESP8266, this port may come in very handy later on.

With that said, part of me questions my decision to make the Internet my interface versus collecting data on an SD card and displaying readings on an LCD screen.  There are pros/cons with either option.  I like the Internet experience (for now 🙂 ) because it “should” be a simpler user experience – i.e.: instead of going to an LCD screen, look up the results on my phone, the measurements are captured, stored, and displayed with no effort on my part and the BoM is less expensive – i.e.: no need for LCD display or SD reader.  On the other hand, networking adds a risk in security and complexity that I see repeated with every project.

So where is an FTDI cable?  I thought I had one…sadly, I couldn’t find one so I ordered this one from Amazon.com.

 

Fixing Leaks

A YIPPEE! Moment…I’m delighted to say the leaks have been stopped.  I started with PVC cement, let that dried, then followed up with silicone.

NewImage

The Water Pump

The water pump is a bit too strong for this set up.  At it’s lowest setting, it can just work…but I see it as overkill.  I’m going to try the 160 GPH model.

Housing for the Grow Chamber

I want the plants to grow within a controlled environment.  This means I need to figure out a housing for the Grow Chamber.  For my first attempt, I decided to sew together a housing using canvas tarp.  Stuff that usually covers wood piles.  I got the tarp at Home Depot awhile back but cannot find the link to the product.  I think it was discontinued.

I’m starting to sew together the pieces:

NewImage

I’m not focusing on getting the silver material “the best” for reflecting the LED light.  In general, I do not have a strong knowledge in maximizing the emission angle of the LED.  

I went to a Jo-Ann store and got clear vinyl fabric for the front.  I want to be able to see the plants.  I’ll attach stuff with velcro so the front (vinyl) can be opened up in order to get to the leaves.  More on this as I get further along.

Onward….

I wish Jo-Ann’s had Home Depot’s feature of publishing the location of their products.  It took a L-O-N-G time to find the clear vinyl.

Build Log for January 14th

The goals for today is to

1. test:

  • reading temperature, humidity, and CO2 level.
  • posting readings on Adafruit.io.
  • update the design as I update the code.

2. fix leaks.

Test

Connecting to WiFi

As I mentioned in a previous post, I’m using a Sparkfun ESP8266 WiFi Shield.

Frustrated A GOTCHA!

Sparkfun notes this hereWatch out! When you’re programming your Arduino (assuming it’s an ATmeg328P-based ‘duino), make sure the UART select switch is slid over towards the “SW” position. If it’s set to “HW”, all of those bits and bytes being programmed into the Arduino will also be sent over towards the ESP8266 — there’s a chance the spurious data might put the ESP8266 into an unknown (though recoverable) state.

I’m following along Sparkfun’s tutorial starting with downloading and installing their Arduino Library.  The tutorial points to the ESP8266_Shield_Demo as a reference point for programming.  So I try out the sample code…and…and…BUMMER.  The shield doesn’t initialize.  Now what?

Looking in SparkFunESP8266.h:

#define ESP8266_SW_RX9// ESP8266 UART0 RXI goes to Arduino pin 9

#define ESP8266_SW_TX8// ESP8266 UART0 TXO goes to Arduino pin 8

 

static SoftwareSerial swSerial(ESP8266_SW_TX, ESP8266_SW_RX);

bool begin(unsigned long baudRate = 9600, esp8266_serial_port serialPort = ESP8266_SOFTWARE_SERIAL);

 

and in SparkFunESP8266.cpp:

bool ESP8266Class::begin(unsigned long baudRate, esp8266_serial_port serialPort)

{

_baud = baudRate;

if (serialPort == ESP8266_SOFTWARE_SERIAL)

{

swSerial.begin(baudRate);

_serial = &swSerial;

}

else if (serialPort == ESP8266_HARDWARE_SERIAL)

{

Serial.begin(baudRate);

_serial = &Serial;

}

 

if (test())

{

//if (!setTransferMode(0))

//return false;

if (!setMux(1))

returnfalse;

#ifdef ESP8266_DISABLE_ECHO

if (!echo(false))

returnfalse;

#endif

returntrue;

}

 

returnfalse;

}

After littering the code with Serial.println()s, I found the failure is in test().  Sending the test AT command failed.  I’m going to try to manually send AT commands using CoolTerm.  I discussed CoolTerm in this post.

Frustrated EPIC FAIL

Thank you for contacting Sparkfun Technical Support

SparkFun Electronics  |  Jan 14, 2017 02:53PM MST 
Hi, Thank you for submitting your Technical Support request with us.

…and so I anxiously await expert advice from SparkFun’s technical support instead of spending more time banging my head. I guess my goal of connecting to Adafruit.io will not happen today. Not a surprise. Connecting shields together can turn into a slog.

Fixing Leaks

Slowly making progress waiting for the glue to dry…

NewImage

Build Log January 13th

My goal for today is to make progress on the Arduino code and fix any leaks in the water pump system part of the Base.

The Arduino Code

The gist of the Arduino code is to:

  • periodically take humidity, temperature, and CO2 level readings.
  • send the readings to Adafruit.io.
  • display Adafruit.io readings on my iPhone.
  • Adjust the CO2 level to 1200PPM if the LEDs are on.

For “best practices” I will:

  • include debugging macros.
  • display the amount of free RAM available when in debugging mode.
  • use interrupts instead of polling where possible.

Pre-setup

DebugLib:  (GitHub location is here). I put the DEBUG macros and function to determine the amount of RAM in a small CPP library so that the code is readily available to any Arduino sketch.  I used the steps given in this post to manually load the library into the Arduino IDE.  Awhile back I wrote a post that included a discussion on how the Arduino uses RAM.  This is where I got the function freeRam() from.
avr/eeprom.h:  EEPROM is used to load/save the global settings variables:
  • CO2Level – the amount of ppm to adjust the CO2 level to when the LEDs are on (default = 1200PPM).
  • secsBtwnReadings – the number of seconds between reading the humidity, temperature, and CO2 level. (default = (DEBUG == 1)? 30 : 15*60)

setup()

I’ve started the design of the setup() function in this Google drawing.

The code I’m working on is located at this GitHub location.

loop()

The design of the loop() function is in this Google drawing.

The code I’m working on is the same one as with setup() (this GitHub location).

Note

These files will change as I work on this part of The Leaf Spa.  I will be modifying the design and code as I go along.  

Leaks

Tried another water run.  Still fixing leaks at the Gutters’ endcap.  Not surprised.  Using PVC cement and silicone to close leaks.

 

…that’s it for January 13th….excited to see what I can get going tomorrow.

Build Log for January 12th

While I wait for the pump to be delivered to start testing the water flow through the Gutters, I’m starting the design of the Arduino code.

What to Monitor and Automate

For this prototype, I’m keeping automation and monitoring to a minimum.  I’m monitoring temperature, humidity, and CO2 level.  The only auto adjustment will be the CO2 level.

 

There are many things that can be monitored.  The trade off I am attempting to make is monitoring the elements in the environment that have the most affect on the health and happiness of leafy plants.  Based on my current knowledge, I am focusing on monitoring

 
Given the work/learnings I have done on pH and EC circuits, I surprised myself by not monitoring pH and EC values.  As I evolved my hydroponics practice over the last year, I’ve decided to change the nutes every one or two weeks.  So far I have not had an issue with unhealthy plants due to an unadjusted nute bath.  However, I am still experimenting.  Please let me know if you have had different results that require constant pH and EC measuring.  I have been advised to check the pH and EC level daily.  I don’t follow this direction because the advice was given as if I am a professional grower.  Since I am not growing professionally, I am opting in this round for simplicity over optimization.
 
I do use a pH and EC meter when I am mixing up the nutes.  I really like the one recommended to me by one of my professors – the Hanna HI9813-6:

NewImage

Hardware

When there is something I don’t know much of, I enjoy getting into the weeds to better understand.  However, this is not my goal for the Leaf Spa prototype project.  One of my goals is to get the Leaf Spa prototype working as soon as possible.  I decided for the prototype hardware to use an Arduino Uno as the micro controller.  I added a Sparkfun ESP8266 WiFi Shield and Seeed’s Base Shield.  I liked the idea of the Grove connectors to make it easy to plug in a Grove CO2 sensor and Grove temperature/humidity sensor.

NewImage

CO2

I haven’t used a CO2 canister before.  I got excited and bought a filled 5 lb. canister from a local place called Central Welding Supply.  This is probably a more expensive way to get CO2 – at least initially.  I ended up buying this canister because I could easily go back to Central Welding Supply to get a refill at a reasonable price.

I also got a CO2 Regulator with Solenoid Valve and a relay (data sheet).  I found some tubing in the garage that should work.

Arduino Sketch

I spent some time on this.  I’ll say more tomorrow.

Update on Pump

A YIPPEE MOMENT!  The pump arrived early PM and I hooked it up.  

Simpson DOHUnfortunately, I had not glued the Gutter’s lower end caps and I also hadn’t put on the 2nd spigot.  So while the water was pumped through the Gutters, the majority ended up on the floor.  Doh dee doh…

Build Log for January 11th

Time to finish up the intake and outtake manifold.  I wanted to be able to detach the plumbing from the Coleman.  In order to do this, I glued another coupling to the Coleman.  This way the 1/2” PVC pipe can be taken out of the coupling when I want to clean the Coleman.

NewImage

So I’m drilling a bigger hole in the lid of the Coleman with a hole saw.  Bummer…I didn’t have the drill straight up which caused the drill to break off.  

NewImage

I’m pretty sure Home Depot is not going to go bankrupt anytime soon if there are more DIYers “like me” 🙂 .

I got the manifolds put together.

NewImage

On to the water pump.  I decided to try out the Active Aqua 250 after watching this video.

NewImage

I liked that the water pump could not only pump the nutes up to the plants, but could also aerate the water without the need to add an additional air pump.  The docs refer to this as the “Venturi Intake Aeration Kit.”

 

That’s it for today.

Build Log January 10th

Time to put the intake manifold together.

NewImage

NewImage

The BoM part of the drawing is not accurate as far as material.  This is because it is not useful for me to change this.  I am more interested in what PVC parts are needed and how they fit together.

As I was putting the manifolds together, I noticed I didn’t have a 7/8” hole saw to drill holes for the 1/2” Sch 40 PVC pipe.  So I went to Home Depot and got one of these.

NewImage

It was a bit pricy.  Too bad I didn’t find this one:

NewImage

While at Home Depot, I picked up a 1/2 in. PVC pipe compression coupling.

NewImage

I needed a way to detach the intake manifold from the Coleman since the intake starts with a pump which must be attached to a hose.  This youtube video shows how to use a compression coupling

Here is an image of the top of the intake manifold:

NewImage

It is a tight fit.   I ended up putting the 3-way elbow towards the front instead of along the left back.  This way, the PVC pipe is closer to the front of the unit.  I’ll need to undo the compression coupling in order to remove the Coleman for a complete cleaning.  It will be easier if the plumbing is closer to the front of the unit.  “Next time” I would put the intake and outtake manifolds on before mounting on the top shelf.  This time I was more designing and fitting as I went along.  Tomorrow I’ll connect the intake and outtake manifolds to the Coleman.

While we were at it, we drilled holes and screwed in the LED driver and fan / CO2 tube holder:

NewImage

I hope to finish up the plumbing tomorrow.  

Build Log for January 9th

My husband had a good idea to lift up the Coleman such that I can glue the PVC pipe to the holes on the Coleman.  Then when I want to clean out the Coleman, I can remove the lift.  The lid stays where it is and the bottom part of the Coleman can be removed.

The first inclination I always have is we must have something around here that will work.  The challenge I have with this is it becomes unstable so you know what?  I’m going to 3D print something.

The build plate on my 3D printer is 7.9 x 9.5 x 7.9 in.  I need lifts that are 12.5” long so I’ll make each finished piece out of two separate components.

NewImage

Well isn’t that special?  Epic fail.  While the string is obvious, it is the shift in about the middle that boggles my mind.  This has happened before and I am not sure why.  Time for me to ask support.  This is frustrating.  Luckily, my husband recommended we use the lid of a 5 gallon tub.  

NewImage

That will work for now.

I’m still intrigued on an electronics project to explore the CCS811 chip.  I may end up designing my own board and buying the chips.  I note Digikey has a 12 week lead time for the chips.  There is also a way to expensive eval board.  However, the Digikey entry shows there is a zip file for APIs (see Reference/Examples)…hmmm…

And so it goes.

The Leaf Spa: Build Log for January 8th

The plumbing pieces I glued to the Gutters yesterday have a small lip on the inside.  I’m concerned this lip will cause a buildup (algae, salts) at this area in the Gutter.  I’ll start the day by using my nifty Dremel to smooth out the lips.

NewImage

 

The next thing is to mount the Gutters and put the outtake manifold together.

NewImage 

I’m excited to try out an update to the CCS811 break out board I got from Matthew Kerley on Tindie.  Matthew seems to be an impressive person.

NewImage

He told me he is 17 years old.  There were some quality and documentation challenges.  However, Matthew is rising to the challenge of addressing these issues.  One issue was documentation on the pin out of the Breakout Board.  Matthew sent me the image above.

I found I could download the data sheet for the CCS811 here.

I used AKstudio’s Arduino script and library from this GitHub location.

….and DRAT…the CO2 reading was 8194.  Well…this isn’t right.  Maybe this is an error code.  For now, I’ll go back to the Grove CO2 sensor (which is actually a Winsen MH-Z16).

I sent Matthew a message on Tindie.  I’ll take this as a parallel track to building the Leaf Spa.

 

That’s it for today.

The Leaf Spa; Build Log for January 7th

The CO2 hole on the 3d Printed part is too small.  I took the outer diameter of the tube with a caliper.  I should have added 4mm “wiggle room.”  I have updated the Fusion 360 design.  I found a round file that I’m using to make the hole bigger.

NewImage

 

I was thinking of using heat-set threading so the bolts had a nice threaded hole made of metal.  However, it looks like I can get by with just the plastic.  One challenge are the holes to hold the fan.  These are a little big.  I decided not to hold the fan in place with screws.  Rather I will glue the fan to the plastic.

I want to make sure I get the direction of the fan right and make sure it works.  To get the wiring right, I used this post on 3 pin fan connector as a reference.

Pin Name Color
1 GND black
2 +12VDC or +5VDC red
3 Tachometric Signal yellow

It’s what I assumed (red = power, black = GND, yellow = PWM)…but I’ve been “wrong” countless times before.  The fan work.  I mounted the fan and was able to fit in the CO2 tube.  I glued the fan to the holder.

NewImage

The screw at the top is a placeholder for mounting to the LED shelf.  I have a piece of brown paper the size of the mount area to make it easy to mark where holes need to be drilled on the LED shelf.

The Outtake Manifold

I’m starting to put together the outtake manifold – which is part of the Base.

Pasted Image 1 7 17 12 11 PM

There are two valves.  One allows the nutrients to be drained into the Coleman.  When this valve is off and the other valve is on, the nutrient bath drains into another container for disposal.

The first thing I did was to use PVC cement to glue the plumbing pieces to the Gutters.  

NewImage

 …and that’s it for today.