Build Log for February 23rd

Tags

Customer Check-In

NewImage

 plant key:

genovese basil parsley sweet basil stevia stevia lettuce
genovese basil thyme sweet basil stevia stevia kale

The plants like the new lighting.  As more mature leaves (past the cotyledon) started to appear, I started feeding them the leafy plant nutrients I discussed in this blog post at a strength of ~ 1/10 the EC value of basil (using info on my First Grow spreadsheet).  I haven’t added back the lettuce and kale plants I managed to destroy.

Growth Sensor Puck

ChallengesBringOpportunitesYIPPEE!  THANK YOU SPARKX FOR PUBLISHING YOUR CCS811 BOB

Updated Schematic and BoM

I took SparkX’s CCS8 Eagle Schematic/Layout (GitHub location) to a Kicad evolution of the Growth Sensor Puck schematic (GitHub location).  The “big” difference is the inclusion of the Si7006.  I ran makedigikeyBOM (ooh – it worked AND I found a “bug” in the jellybean parts file!):

Reference Value Quantity Manf Part # Digikey Part # 1 10 100 1000 Qty Avail Link
R4,R5 100K 2 ERJ-6GEYJ104V P100KACT-ND 0.1 0.025 0.01 0.00451 523146 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=P100KACT-ND
U1 Si7006 1 SI7006-A20-IM 336-3124-ND 2.08 2.08 1.7372 1.56551 2158 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=336-3124-ND
R7 10K 1 C0805JR-0710KL 311-10KARCT-ND 0.1 0.016 0.0066 0.00297 2775278 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=311-10KARCT-ND
C2 1u 1 TMK212BJ105KG-T 587-1291-1-ND 0.16 0.115 0.0541 0.03139 231010 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=587-1291-1-ND
C1 .1u 1 CL21F104ZBCNNNC 1276-1007-1-ND 0.1 0.029 0.0128 0.00718 1016710 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=1276-1007-1-ND
U2 CCS811 1 CCS811CT-ND CCS811CT-ND 12.76 10.073 7.1632 7.1632   http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CCS811CT-ND
R1,R2,R3 4K7 3 RC0805FR-074K7L 311-4.70KCRCT-ND 0.1 0.019 0.0077 0.00345 2362052 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=311-4.70KCRCT-ND

Looking through my box-o-parts (I standardize on 0805 when possible):

NewImage

Besides the CCS811 and Si7006, I do not have 4K7 resistors.  I added these to my current Digikey backorder for the CCS811 and the Si7006.

PCB Layout

A challenge I have with Kicad is finding footprints when I am in cvpcb.  One example is the footprint for the optional 10k thermistor that has a through hole footprint.  I was challenged to find a tht resistor footprint that had a 2.54mm spacing.

NewImage

the image is from this data sheet.  So I made my own.  Simple to do but I can’t help thinking I’m wasting my time since these footprints probably exist.

NewImage

and…yah…i think i wasted my time making the layout (even if it was simple…I certainly am not getting younger 🙂 )…further bumbling within cvpcb lead me to the Socket_Strips library.  Where I associated the optional thermistor with the 1 x 02 straight socket strip with a 2.54 mm pitch.

NewImage

 

Design Rules

It would be a D’OH moment if the board was turned back from OSHPark because I did not adhere to their design rules.  It’s been awhile since I sent a PCB to OSHPark so I went back to check OSHPark’s design rules:

  • 6 mil minimum trace width
  • 6 mil minimum spacing
  • at least 15 mil clearances from traces to the edge of the board
  • 13 mil minimum drill size
  • 7 mil minimum annular ring

I discussed what the design rules refer to (e.g.: the term “annular ring” was not a term I was familiar with) in this post.

Based on what I used in the post, here are the design rules I am using for tracks and vias:

NewImage

That’s as far as I got today…excited to see what I can do tomorrow. 

Build Log for February 21st

Customer Check-In 

NewImage

 plant key:

genovese basil parsley sweet basil stevia stevia lettuce
genovese basil thyme sweet basil stevia stevia kale

Frustrated Sadly, the lettuce and kale got way to stringy with the previous light I used.  Lesson learned: don’t buy cheap LED desk lamps at Home Depot and use on seedlings.  A PAR ~ 70 is not enough.

I had a Mars Hydro I got awhile back that I’m not using.  

NewImage

The PAR ranged from ~230 on the edges of the heat mat to ~290 at the center.  Now the seedlings should have enough (PAR) light.

MicroPython

I can’t believe I almost forgot about the PyCom WiPy 2.0 and the expansion board I got from Adafruit last week.  Time to give them a twirl.  The PyCom website is here.  I start with the Pycom documentation.  The first thing I need to do is put headers onto the PyCom so I can fit it in the expansion board.

My goal with paying top $$ for the PyCom through Adafruit included:

  • Supporting Adafruit.  I have received a lot of learning and support love.  From all I can tell, Adafruit treats their employees well – caring more about people than how much can be acquired before we die.
  • Evolving my understanding of micro python based ESP8266 environments on the best made and supported environment (both hardware, IDE, and support).

PyCom 

The PyCom hardware has made a great start at providing an excellent micro python experience.  Yet, there appears to be many areas that I would hope evolve.  I’ve been on projects at this state before and wonder if it is for the same reason: 1) a little bit of “throw something out there before it is polished” to better guide direction based on customer feedback 2) engineers dominate the user experience 3) list of features/testing is more demanding than scheduling truly allows for (taking in the number of folks working on it as well as the Mythical Man Month).  The one I had the hardest time with regards to customer experience was addressing #2.  My take on the reason is an engineer sees delight in figuring out details.  Others might not be as delighted by this but more delighted by saving time and getting to blinking a light or whatever.  Both are valid. This is another thing I love about Adafruit, their leadership executes within the latter camp.  There is empathy for non-engineers – folks like me – the liberal arts crowd…

Challenge with Firmware Upgrade

I went through the firmware upgrade steps and got this dialog:

NewImage

Homer aargh Failure! is the message?  Yah – no sh*&*&*&*&t. :-).  I…but wait a minute, a little later the documentation states:

NewImage

Pymakr IDE

Next I installed the Pymakr IDE as recommended by the Getting Started documentation.  Oh my.  Their own IDE?  And here I had a problem with their install experience while they have time to create their own IDE?  What about all the extensible IDEs – like Exclipse, Atom…  Do they really have time to accommodate all the different OSs (e.g.: Mac, Ubuntu, Windows) and the various releases?  All the hardware and software configurations??? WHOA…I was relieved to read in the PyCom forum they are moving away from providing an IDE and moving towards plug-ins.  I’m not knowledgable enough about what this means to my use of PyDev within Eclipse.  I’ll figure this out at some point.

Pymakr

After several reboots and deciding to use the USB over serial, I’m using Pymakr.  I’m able to get commands to execute at the >>> real prompt.

Strange though, for awhile I couldn’t find the board even though I was able to get a connection to Pymakr yesterday.  Of all the gobbly gook things I tried, rebooting (over and over) eventually seemed to work.  I’m currently using Pymakr over USB.

Sensor Puck Layout

On to the sensor puck layout….hold up…Hold up…I just found an offering from SparkX of a CCS811 BoB.  But…sadly, I will not be able to get any…I called Sparkfun support and was told they know of no plans for restocking…. however, the schematic and layout are open source (GitHub location).

I was going to stop working on the Sensor Puck and just use SparkX’s offering.  However, difficulty getting them made me reconsider.  I will evolve the schematic and layout to SparkX’s since Nate has a lot more experience than I do in building PCBs.

That’s it for today.

Update to MakeDigikeyBoM

What MakeDigikeyBoM is

MakeDigikeyBom (GitHub location)  takes the components that are part of a PCB schematic made in Kicad’s eeSchema and creates a CSV file that has the digikey part number information for quantities where the minimum order is 1.  This CSV file can then be loaded into an app like Google spreadsheets.  Here is a the Google spreadsheet that originated from the GrowChamberSensorPuck project (GitHub location):

Reference Value Quantity Manf Part # Digikey Part # 1 10 100 1000 Qty Avail Link
C2 4.7u 1 LMK212BJ475KD-T 587-1297-1-ND 0.18 0.128 0.0602 0.03497 216464 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=587-1297-1-ND
R7 100K 1 ERJ-6GEYJ104V P100KACT-ND 0.1 0.025 0.01 0.00451 547481 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=P100KACT-ND
U1 Si7006 1 SI7006-A20-IM 336-3124-ND 2.08 2.08 1.7372 1.56551 2199 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=336-3124-ND
R5,R6 4K7 2 RC0805FR-07100KL 311-100KCRCT-ND 0.1 0.019 0.0077 0.00345 6051592 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=311-100KCRCT-ND
R4,R1,R2,R3 10K 4 C0805JR-0710KL 311-10KARCT-ND 0.1 0.016 0.0066 0.00297 2786699 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=311-10KARCT-ND
C1 .1u 1 CL21F104ZBCNNNC 1276-1007-1-ND 0.1 0.029 0.0128 0.00718 1026228 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=1276-1007-1-ND
U2 CCS811 1 CCS811CT-ND CCS811CT-ND 15.5 12.65 9.8038 9.8038   http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CCS811CT-ND
R8 NTC100K 1 NTCS0805E3104FXT BC2562CT-ND 1.1 0.86 0.5823 0.43669 17108 http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=BC2562CT-ND

I use the Eclipse/PyDev IDE exclusively to run makedigikeyBOM.py.  Yah…This is ugly compared with running python from the command line.  I do this because my skills in python are at an advanced beginer’s level (at best 🙂 ).  I take advantage of the extensive features such as debugging, setting up input, adding tasks… this IDE offers. 

When it comes to Python, I’m just not ready to take my floaties off.

Steps to Get to the BoM CSV

  • Get the Jellybean parts csv file ready.  The Jellybean parts contains categories of parts (like R for resistors, C for capacitors….) that are referenced within a component’s PN in eeSchema (see the example under the next step where the R5 component’s PN=R).  I start with this jellybean parts file.  I download  this jellybean parts file as a CSV file as a start.  I then renamed it JBParts.csv (just a simple name)…More jellybean parts can be added (or removed).
  • Run bom2csv (discussed here) to create the XML file.  The XML file will have the filename of the Kicad project.  For example, the Kicad project I used was GrowChamberSensorPuck (GitHub location).  This means the bom2csv’s output XML filename will be GrowChamberSensorPuck.xml.  The created file contains an XML tree for each component.  The important fields are the ref, value, and PN fields.  These must be filled for each component in eeSchema.  The images below point out part numbers can be either Jellybean parts, manufacturer part numbers, or X (for exclude this component from the BoM).
Example Component Property Dialog Box
NewImage
Example Output: Jellybean Part
NewImage
In the case of this component, it is a jellybean part.  (“PN”<R>). 
 
Example Output: Specific Component
NewImage
This example has a specific manufacturer’s part number.
 
Example Output: Exclude Component
 
NewImage
By saying the name of the part number is X, this component is excluded from the BoM.
  • Set the variables up within the Eclipse/PyDev environment.  As I noted in this post, there are three important user inputs:
    • The full name of the bom2csv file.  In my current example, the full name I will use:

      /Users/margaret/Documents/LettuceBuddyHW/LadyBugHydro/TheHerbSpa/GitHub/Kicad/GrowChamberSensorPuck.xml

    • The full name to the jellybean parts file.  I will use:  /Users/margaret/Documents/LettuceBuddyHW/LadyBugHydro/TheHerbSpa/GitHub/Kicad/JBParts.csv
    • The file folder where the MadeDigikeyBOM.csv will be written. I will use: /Users/margaret/Documents/LettuceBuddyHW/LadyBugHydro/TheHerbSpa/GitHub/Kicad/

To set the variables up, I’ll go into the debug/run configurations within the Eclipse/PyDev IDE:

Pasted Image 2 20 17 5 38 AM

 

NewImage

Then I run MakeDigikeyBOM from within Eclipse.  This creates the MadeDigikeyBOM.csv which I then import into a Google spreadsheet.

 

Well…MakeDigikeyBOM works for now… As I continue to use this BoM creation tool, I am sure I’ll come back to evolving the code and documentation.  For now, if you are interested, look at the code at this GitHub location.  I tried to document the code with ample information to know the intent of each section.

Build Log for February 16th

Back to the Arduino sketch

Customer Happiness Check-In

NewImage

 plant key:

genovese basil parsley sweet basil stevia stevia lettuce
genovese basil thyme sweet basil stevia stevia kale

I’m starting to see multiple plants in most of the rockwools. I’ll trim these. A concern I have is the long stems of the lettuce and kale. I attribute this to not getting enough PAR light.

Open Source

The Arduino code I am talking about in this post is TheLeafSpa.ino – located at this GitHub location.

Completing Logging

I got logging sensor data working and documented in this post.  There are other things I want to log:

enum logRow_t {
  SensorData,
  PumpOn,
  PumpOff,
  LEDOn,
  LEDOff,
  CO2On,
  CO2Off,
  CardInserted,
  CardRemoved,
} logRowType;

This includes all state changes (as seen in the enum above).  The code I worked on for logging sensor data made it easy to capture the function of logging an event happened:

/*
    writeEventHappened(...) log each of the events like turning the pump, LED, CO2 on or off.
*/
void writeEventHappened(logRow_t event) {
  File logFile = openFile();
  if (!logFile) {
    DEBUG_PRINTLNF("Could not write sensor data. Log File could NOT be opened!");
  } else {
    String sensorString = String(30);
    sensorString = String(event) + ",";
    sensorString += getDateTimeString() + ",";
    logFile.println(sensorString);
    logFile.flush();
    logFile.close();
  }
}

Testing on additional logging functionality works. Now on to adjusting the CO2…

Adjusting the CO2

Time to jump on this and just do it.  This is the last on my list of firmware needed to be written for the Grow Chamber.  Back in the February 1st build log, I discussed exploring parameters to use when adjusting the CO2.  I ended up deciding: I’ll start with something simple like (assumes LED light is on – or no point in adding CO2!)  if CO2 < 800ppm, turn CO2 valve on for 5 seconds.  If > 800ppm but < 1,200ppm, turn CO2 valve on for 2 seconds.

The first thing is to include a boolean flag in the sketch that lets the code know if the LED light is on or off:

void turnLightOn() {
  writeEventHappened(LEDOn);
  fLEDon = true;
  digitalWrite(LEDPin, ON);
}
void turnLightOff() {
  writeEventHappened(LEDOff);
  fLEDoff = false;
  digitalWrite(LEDPin, OFF);
}

Second, the wiki page for the Grove CO2 Sensor notes there is a 3 minute warm up time before taking readings.  I added a warm up flag and a one time alarm:

  fInWarmUp = true;
  Alarm.timerOnce((const unsigned long)secsWarmUp, warmUpOver);

Connecting With the Grow Chamber

Time to connect the Arduino/sensors and Relay goo with the Grow Chamber, water pump, LEDs, and CO2.  The shelves needed some holes for power cords.  I got some step drill bits and had a terrific time drilling holes.

NewImage

I wish I had known how much fun drilling holes were when I was much younger.  At least now I can have these special moments :-).  

I hooked up the cords to the Relay Switch:

NewImage

 

and hooked up the DC side of the relay wires to the corresponding pins on the Arduino.

#define pumpPin 4 //put the pin for the relay that will control the pump into pin 4 of the Arduino.  Make sure the pump is plugged into the right socket.
#define LEDPin  5 //same thing as for the pumpPin...
#define CO2Pin  6 //same things as for the other pins...

The color of the wires from the relay map to the dots on the Relay socket. 

Testing

I boldly start testing.  Surprise, surprise – some stuff worked and some stuff didn’t.

What worked:

  • turning pump on/off at the periodicity I wanted and for the length I wanted.
  • sensor measurements.
  • logging
What didn’t work:
  • LED, CO2 not turning on/off.
  • serial output stops after a few times the pump has been activated.
More stuff to work on another day.

Build Log for February 17th

Tags

,

Today I worked on the makeDigikeyBOM.py tool.  I like evolving “quicky” tools I wrote.  In this case, it is a tool that gets component information from the (Kicad) eeSchema file, scrapes the Digikey site to get pricing information, and then creates a CSV with BoM information.  I posted about this tool in several posts including this one.  The challenge I have is I’m not fluent in Eclipse (the IDE I use), Python, or the innards of XML.  This means my progress is M-U-C-H slower than if I had a clue.  On the positive note, each time I come back to Eclipse/Python/innards of XML it takes me less time to get up to speed than it did the previous time.

I worked on cleaning up the python code – adding robustness and a new feature.  The new feature supports a component that is in eeSchema to be ignored when creating the Bom.  If the PN field equals X or x, the python script will remove that component (in Beautiful Soup speak – extract) from the outputted BoM (GitHub location).

I have a bit more to do with clean up.  When I ran the script on the Sensor Puck eeSchema (see Kicad and MakeDigikeyBoM files for the Sensor Puck at this GitHub location), most of the price fields weren’t filled in:

Reference Value Quantity Manf Part # Digikey Part # 1 10 100 1000 Qty Avail Link  
C2 4.7u 1 LMK212BJ475KD-T 587-1297-2-ND 0 0 0 0   http://www.digikey.com/product-detail/en/taiyo-yuden/LMK212BJ475KD-T/587-1297-2-ND/930649  
R7 100K 1 ERJ-6GEYJ104V P100KATR-ND 0 0 0 0   http://www.digikey.com/product-detail/en/panasonic-electronic-components/ERJ-6GEYJ104V/P100KATR-ND/83110  
U1 Si7006 1 SI7006-A20-IM 336-3124-ND 2.08 2.08 1.7372 1.56551   http://www.digikey.com/product-detail/en/silicon-labs/SI7006-A20-IM/336-3124-ND/5050329  
R5,R6 4K7 2 RC0805FR-07100KL 311-100KCRTR-ND 0 0 0 0   http://www.digikey.com/product-detail/en/yageo/RC0805FR-07100KL/311-100KCRTR-ND/727544  
R4,R1,R2,R3 10K 4 C0805JR-0710KL 311-10KARTR-ND 0 0 0 0   http://www.digikey.com/product-detail/en/yageo/RC0805JR-0710KL/311-10KARTR-ND/728241  
C1 .1u 1 CL21F104ZBCNNNC 1276-1007-2-ND 0 0 0 0   http://www.digikey.com/product-detail/en/samsung-electro-mechanics-america-inc/CL21F104ZBCNNNC/1276-1007-2-ND/3886665  
U2 CCS811 1 CCS811CT-ND CCS811CT-ND 15.5 12.65 9.8038 9.8038   http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CCS811CT-ND  
R8 NTC100K 1 NTCS0805E3104FXT BC2562TR-ND 0 0 0 0   http://www.digikey.com/product-detail/en/vishay-bc-components/NTCS0805E3104FXT/BC2562TR-ND/2237371  

Open Source

I updated the makeDigikeyBOM (GitHub location)  project to reflect the changes made for this post.

Upgrade Eclipse

I like Eclipse for this project.  Eclipse has a great debugger, manages files well, and has great Python support through PyDev.  At this point, I run makeDigikeyBOM.py ONLY within Eclipse.

I’m not surprised that upgrading Eclipse was more complex than hitting some “START” button.  I installed Eclipse when I was coding for the nRF51 SDK.  The first thing I’ll do is update to the neon version.  The steps I took to upgrade include:

    • Install the latest version of Eclipse from here.  While installing, I got the dialog box:

NewImage

I’ve been ignoring updating the Java VM on my Mac. I go to Oracle’s page for downloading the JVM and install the JRE for OSX.  Ignoring the warnings:

NewImageChecking the Java icon within System Preferences:

NewImage

I’m told I have the most current version of Java installed.  Yet I still got the same message when installing Eclipse.  What gives?  Turns out Eclipse requires the JDK (would be nice if the Eclipse install let us know!)…So I went back to Oracle’s Java downloads and installed the OS X version of the Java Development Kit.

The Eclipse Installer opens open with a cacophony of choices:

NewImage

There isn’t one for Python so I installed the C/C++ option.

  • Put the folder’s path of the workspace where my code for the MakeDigikeyBoM is kept.

This brings up the warning dialog box about upgrading the files to work with neon:

NewImage

Which true to my character, I ignore.

Ooh…awesome..the spiffy Neon update of Eclipse opens…but…

NewImage

I go into Help->Install Software menu and install PyDev.  I choose not to install Mylyn for now.

NewImage

And FINALLY!  Oh…about an hour and a half later…I’m in the latest, greatest Eclipse IDE customized with PyDev…VROOM, VROOM!

Updating The Code

I haven’t looked at the makeDigikeyBOM.py tool since I wrote posts about it (including this one).  On top of that, I’m not that fluent with Python – or the other skill I need – the innards of XML.  There is a sense of thrill though to be able to evolve and just believe I’ll make progress.  And I did.  The code is a bit more robust.  Also, I added the ability to ignore a component by setting the PN value to ‘X’ or ‘x’.  The MakeDigikeyBOM GitHub project location is here.  As I noted at the start of this post, there is still work to do.  That will wait for another day. 

Build Log for February 15th

Today I’m going to focus on the layout of the Grow Chamber’s sensor puck.  I discussed the sensor puck schematic in an earlier post.  Before I get to the layout, I need to pick a connector to use for the pin outs.  Urgh…connectors…it is hard for me to get my head around connectors…so many choices…picking the “right one” is a task I don’t always succeed at.

 

Open Source

The footprints I added to the sensor puck cvpcb are locked at this GitHub location.

Adding The Connector

The PCB needs a 1 x 7 connector:

NewImage

onto cvpcb…check this out… a slew of errors saying the component libraries can’t be found:

NewImage

bummer….but – as is pretty much true in every case – I am not the only one.  I did what Brandon did and issue solved: For record, in cvpcb I went to Preferences –> Footprint Libraries. Removed all Global libraries then used Append with Wizard to add all GitHub libraries and saved them locally on my machine.  

I like to use 0805 size for jellybean parts.  Here’s what cvpcb looks like before I have created footprints for the other parts:

NewImage

I decided to keep the connector simple and use the same type of connector used on Arduino shields.  Spark fun has a nice tutorial on connectors.  I’m using the connector discussed under the topic “Pin Head Connectors.”

 

 As noted in the Sparkfun post: The most commonly seen pin headers are .1″ single or double row connectors. These come in male and female versions, and are the connectors used to connect Arduino boards and shields together. 

.1” is the pitch I will use.

Perhaps there is a 7 pos footprint for an Arduino header like connector within the wad of footprints that come with Kicad.  I’m thinking it will take less time for me to make my own.  I’ll use this Arduino header data sheet for reference. 

I put the footprints I added into TheLeafSpa.pretty library at this GitHub location.

The Thermistor

On second thought, the 0402N sized Thermistor noted in the app note’s BoM I discussed here is uncomfortably small for my soldering skills.  I like working with 0805s (I also like reading with larger fonts…).  I went back to a post I wrote where I evolved my knowledge of how thermistors work (and now seem to have forgotten)…and decided I was making too big a deal about matching (B parameter) specs.  Also – didn’t I say I wasn’t even going to be using this feature?  So I’m changing the thermistor to an 0805 100KΩ (Digikey link).

Additional Footprints

I made footprints for the CCS811 and the Si7006.  These have been added to TheLeafSpa.pretty library located at this GitHub location.

I’m ready to do the layout…but before I do that…

Generating the BoM

I want to generate the BoM to make sure I get all the parts I need.  I’ll be using MakeDigikeyBOM.py which I discussed in several posts – including this one.  Steps:

  • run bom2csv (discussed in this post) to create.  This creates the GrowChamberSensorPuck.csv file (GitHub location).
  • download a csv file of jellybean parts.  The jellybean parts Google Spreadsheet is located here.  The downloaded csv file is located at this GitHub location.
  • Make sure the MakeDigikeyBOM .py files are available to run.  The GitHub location for MakeDigikeyBOM is here
…I ran out of time for today…. tomorrow I make progress on sensing and monitoring the Grow Chamber.  Then I will get back to BOM generation and layout.

 

Build Log for February 11th

Customer Happiness Check-In

NewImage

 plant key:

genovese basil parsley sweet basil stevia stevia lettuce
genovese basil thyme sweet basil stevia stevia kale

 YIPPEE! I’m seeing growth in all but one of the stevia.  Maybe it is a late bloomer.  Curiously, I have the same feeling for the stevia being a late bloomer as I had when one of my kids took a long time to figure out how to walk.  Too good at rolling to bother :-).

Schematic for the Grow Chamber Sensor Puck 

I haven’t spent time working on the Grow Chamber sensor puck so I’ll put some time into it now.  But first…

Thanks To Those That Went Before

The Kicad Team – The KiCad EDA has come a long way.  KiCad has enabled so many of us to get into designing and building our own PCBs.  The team that does this work is amazing.  THANK YOU.

Contextual Electronics – Thanks to Chris Gammell’s Contextual Electronics, I have the confidence and ability to design and build PCBs.  Since I knew nothing about electronics before Contextual Electronics – after all, it is not something a woman in my age group would be encouraged to do – it is hard to describe the feeling of happiness I have in being able to design my own circuits.  THANK YOU.

ams and Silicon Labs – Both ams (manufacturer of the CCS811) and Silicon Labs (manufacturer of the Si7006) provided schematics which made it far easier for me to layout a schematic.  THANK YOU.

Open Source

The Kicad schematic I discuss below is located at this GitHub location.

The Schematic

The sensor puck will monitor CO2, temperature, and humidity.  To do this, I will use two chips:

Both use a VDD of between 1.8V and 3.6V.

The first thing I am doing is upgrading Kicad.  It has been awhile since I have used Kicad.  The current Mac version I am running is 4.0.3.  The version on the OS X downloads page is currently 4.0.5.  There is both a main package and an extras.  I just downloaded the main package for now.

I’m going to start a schematic that is only one page.  I do not see the need to have a hierarchical structure.  To lay out the CCS811, I’ll use the schematic in the CCS811 ams Eval Kit Manual (I copied the PDF to this GitHub location).

NewImage

Hmmm…one thing I didn’t see on this schematic were 10K pull-up resistors on the SDA and SCL lines.  I’ll add these.

I’ll use the schematic in the Si7006 data sheet for the layout of the Si7006 chip.

NewImage

Creating a schematic is a great way to get a deeper knowledge of the chip.  I am grateful for the schematics provided in the data sheets.  They are a great jumping off point!

Stuff I’m doing on the schematic:

  • I copied the ADDR circuit which pulls this pin to GND using a 4K7 resistor.  From the pin assignment documented in the data sheet (I copied the data sheet to this GitHub location), when the ADDR is low, the I2C address is 0X5A.   When I write the firmware, I’ll use 0X5A as the I2C address.
  • I’ll wire the AUX, PWM, and SENSE in the same way these pins are wired in the above schematic.  I don’t think I will be using the optional chip ambient temperature sensing.  However, it is of little cost to add the two resistors so why not?
    • One of the resistors is an NTC thermistor.  Which one to use?  I am happy to see the eval kit’s BoM:
NewImage
Drat the NTC Thermistor is in a 0402-N package…tiny for my soldering abilities…sigh…well…the footprint of the CCS811 doesn’t seem any better so for at least now, I’ll use the NTC Thermistor listed in the BoM and assume reflow will be able to handle the 0402 size since I’m not convinced my hand soldering is up to the task.

The CCS811 notes several application notes.  Sadly, I couldn’t find a way to access them so I sent a not to ams support (emailing cs-americas@ams.com):

Hello ,

I have purchased CCS811 chips from digikey.  The data sheet notes the following application notes:NewImage
 
The links provided lead to 404 (page not found).  I tried to find them on the ams site but could not.
 
Could you please provide me links to these app notes (and any others available for the CCS811?
 
Thank you and kind regards,
Margaret.

I’m seeing an increased risk of using the CCS811.  The chips themselves have a lead time (Digikey has about a 3 month lead time), and I can’t get access to documentation ams says is available.  I need to keep an eye on that!

  • Layout the components in eeSchema
  • Get the components in line with requirements to use the BoM generator I created awhile back.  From this blog post, two properties are used by the python program that will generate the BoM from eeSchema info:
    • Component Value
    • Part Number (labeled as PN).  The PN can be one of three things:
      • manufacturer’s part number.
      • Digikey part number
      • a “jellybean” part number.  Looking at the block diagram in the blog post, Jellybean parts exist in the JellyBeanPartNumbers.csv file.  I generate this CSV file from a google spreadsheet.  I have shared the one I’ve been using here.

I added the digikey PN to the CCS811 component:

NewImage

I populated the Value and PN fields for each component in eeSchema.

The current Schematic the only thing missing is a connector:

NewImage

And…well, I truly enjoyed my time spent in eeSchema.  That’s it for today!

Build Log for February 9th

 

Customer Happiness Check-In

Here are the stars of all this:

 

Pasted Image 2 10 17 12 56 PM

looking at my plant key:

genovese basil parsley sweet basil stevia stevia lettuce
genovese basil thyme sweet basil stevia stevia kale

The lettuce, kale, basil, and thyme are starting to pop out of their shell!

Once I start seeing growth, I like to add lights.  My thought process is the seedlings will sense the light and want to grow towards it.  I put the light on a timer:

NewImage

A Shiny Thing

OOH – Adafruit started shipping the PyCom WiPy 2.0.  I just ordered one.  How great is that?  Adafruit – a company I support – has stocked something I want.  And the fun part is it will take maybe a week to get here…anticipation!  Oooh – then I saw the Expansion Board.  Looks useful.

Adding LED DLI Code – Day 2

Yesterday I familiarized myself with Paul’s (Arduino) time and RTC libraries:

I tested how I would code turning the LEDs on/off with TurnLightsOnOffTest.ino (found at this GitHub location).  I wanted to test the light going on/off at a time of day.  Alarms are set then the code sets the Arduino clock to a little bit before midnight (light is coded to turn off at midnight) and then set to a little bit before 4AM (the time the light is to come on).  The test code is where I have spent most of my time.  I hope the comments are adequate to act as the documentation.  I find it easier to have documentation directly with the code instead of with this text.

I got a tad confused by the time_t type.  As typical, confusion is cleared when I RTFM (as I was told countless times by engineers in BIG SOFTWARE COMPANY). From this link on the Paul’s siteTime uses a special time_t variable type, which is the number of seconds elapsed since 1970. Using time_t lets you store or compare times as a single number, rather that dealing with 6 numbers and details like the number of days in each month and leap years.

Build Log for February 8th

Customer Happiness Check-In

I want to do a daily check in with the plants that I am growing.  After all, while I am giddy with all this tech stuff the goal is to grow really happy plants.

Here’s today’s peek at what they look like:

NewImage

NewImage

So far not much to see.  The rock wool looks wet enough.  The heat mat is keeping the humidity and temperature up.   

Thanks To Those That Went Before

  • Adafruit / Bill Earl – Adafruit’s data logging shield with the exceptional documentation/libraries provided by Bill Earl make prototype with an SD card and RTC as part of the experience super easy.  Thank you!
  • Paul Stroffregen for the excellent time library (GitHub location).  Thank you!

I got notice from Digikey the CS811 will be back in stock February 28th.  I thought it would be a fun time to build a PCB that attaches to a µCU via I2C that measures CO2 (and can tell when the light is on), temperature, and humidity.  So OH YEAH I get to play with (um I mean work with) Kicad to design the PCB.  The design will cumulate into the Grow Chamber sensor puck.  This puck like looking thing that will have a PCB with the CS811, and other sensors with cables for I2C and power.  And – just because – I will make it so this puck works with MicroPython…YIPPEE..AM I RIGHT?  I’m going to start the design now as a background process to finishing up the Grow Chamber V1.

Grow Chamber Sensor Puck Design

The Grow Chamber Sensor Puck will include:

  • the CS811 chip for measuring CO2 levels.
  • a temperature/humidity SMT chip that has an I2C interface for measuring temperature and humidity.
  • a photoresistor to determine whether the LED is on or off.

Temperature/Humidity SMT chip

Out of the many chips out there, what criteria do I want to use to choose?  My priorities in order:

  • widely used.
  • well written data sheet.
  • highly available 
    • in general I prefer Digikey. Price is ok, shipping is quick.  The support has been great.  I am assuming all employees are paid a wage that allows them to support their families and to enjoy life.  Hmmm, I’m assuming this. 
  • low cost.
  • I can solder it.

I’m choosing the Si7006.  Because:

  • Digikey has 2,233 in stock.  The availability is there.
  • The data sheet looks to be well written.
  • The cost for one is relatively inexpensive at $2.06.
  • There is a GitHub (ControlEverythingCommunity) with code to access this chip from an Arduino or through a python script.  I do not know if the code is robust.  But I am grateful for this starting point.

I’m not sure how my soldering will go with a 3 x 3 mm DFN package.  We’ll see.  The video, How to Solder QFN MLF chips Using Hot Air without Solder Paste and Stencils, seems to give worthwhile advice on the soldering techniques to use on a DFN/QFN…Also, there is a video Dave made – EEVblog #346 – MLF/QFN SMD Reflow Soldering – that I think I watched awhile back.  I’ll come back to these links when it is time to solder.

Photoresistor

I’ll use a photoresists to figure out if the LED is on.  Seems like the GL5528 (data sheet) is very popular and perhaps the best place to get it is on eBay….although the delivery time frame is interesting :-).

Now that I have parts picked out for the sensor puck, time to get back to the Grow Chamber’s code.

Code for The Grow Chamber

I’m starting with the code to turn the LEDs on for 20 hours.  I might change this based on what happens with the DLI given the height of the COB LEDs from the plant leaves.  If the DLI should be higher, I’ll raise the number of hours the LED is on.  I’ll probably not lower from 20 hours because the photoperiod is not a concern for the plants I will be growing.

I could just use Dr. Monk’s timer functions but this doesn’t accommodate the time of day.  What if the Arduino keeps booting up?  The light turning on and off would not work.  I will get the time of day from the RTC that is part of the hardware on the SD card shield.

Step:

  • Test the RTC clock with simple test code.  From the test, understand how the RTC code works and make sure the RTC circuit on the SD card shield functions correctly.
  • Code turning the LED off for four hours in the middle of the night (based on the current local time).
  • Test the code.

RTC Test 

I am using an Adafruit data logger shield.  Under the post “Using the Real Time Clock”, Bill notes: “If you have an Adafruit Datalogger Shield rev B, you will be using the PCF8523 – this RTC is newer and better than the DS1307. Look on your shield to see if you see PCF8523 written above the chip.”  PCF8523 is not written on my shield.  This tells me the RTC I am using is the DS1307.  Bill states the PCF8523 “is newer and better…” A brief look at the PCF8523 data sheet shows this chip is set to handle alarm interrupts.  That would be very useful.  So here’s what I learned about RTC chips…I think the GitHub for Adafruit CircuitPython PCF8523 states it well:  The PCF8523 is simple and inexpensive but not a high precision device. It may lose or gain up to two seconds a day. For a high-precision, temperature compensated alternative, please check out the DS3231 precision RTC. If you need a DS1307 for compatibility reasons, check out our DS1307 RTC breakout.

For now, I’ll make due with the DS1307.  Running the DS1307 example code:

NewImage

the RTC tests OK.

Adding LED DLI Code

The next step is to add the code that turns the light on and off.  I’ll program the code so the LED is off from 12AM until 4AM.  Given what I want to do, I am going to use Paul Stroffregen’s Time and DS1307 RTC libraries.  He does such great work!  I ran TimeTest.ino (GitHub location) to test out how his library works. Ooh – then I found Paul’s TimeAlarms library (GitHub location).

…I started this but didn’t get as far as I like…looking forward to a beautiful tomorrow.

Build Log for February 7th

Tags

, , ,

 ChallengesBringOpportunitesYIPPEE!

I did not know this.  The county I live will test the soil in my garden for free (link to King County Soil Testing Program)!  I learned about this through the Encyclopedia Botanical Podcast’s slack channel.  This one chunk of information saved me more money than I paid on the podcast’s patreon page for access to their slack channel.

Thanks to Those That Went Before

I’ve been listening to the Encyclopedia Botanical Podcast.  The podcast originates from Seattle, which is the area I live.  It is wonderful to listen to advice on how/what to grow in our outdoor gardens.  I garden outdoors in the summer.  THANK YOU Hilary Dahl and Kellie Phelan!

The Seeds

A YIPPEE moment!! My seeds arrived yesterday.

NewImage

I’m not appreciative of Territorial Seed’s marketing.  The day after I placed my order I got an eMail message that let me know if I ordered seeds before February 9th, I’d get free Sweet Peas.  Of course, I’d feel better if they had included free seeds as appreciation.  The package arrives containing marketing material for tillers and other stuff that the other companies must have paid for.  Hmmm…I will reconsider buying seeds from Territorial Seed.  It’s not that I want free seeds.  I want companies that I build a positive relationship with.  Companies like Adafruit that put out an incredible amount of helpful content (like this recent video Reverse engineering ARM binaries for QTouch LIVE ).  In other words, companies that provide valuable service and support.  Companies that love their employees enough to provide EVERYONE with a livable wage.  Companies that have employees that I admire.  Like Tonie Kacludis at Excalibur. But I diverge.

Planting Seeds

Steps:

  • Figure out what plants to grow in The Grow Chamber.
  • Take out rock wool cubes for each plant that will be growing in the Grow Chamber.
  • Soak the cubes in pH 6 water for a few minutes.
  • Let the rock wool drain in the sink for about 15 minutes.
Note: I found the video by TheGrowGeek on planting seeds in rock wool Planting Seeds in Rockwool for Hydroponic Growing to be helpful.

Plants

The Grow Chamber has space for 12 plants.

NewImage

I plan to grow kale, lettuce, basil (2 kinds), stevia, parsley, and thyme. Seven types of plants.  After the 7, there are 5 empty spots in the Grow Chamber. Pasted Image 2 7 17 9 47 AM I will populate the 5 spots with 2 additional basil (I LOVE BASIL!!!),and  3 additional stevia (I use a lot of stevia).

I’m starting a spreadsheet that lists the ideal growing conditions for each. It’s a bit of a slog as I try to figure out what sources I want to use to fill out the environment information.

Soaking the Rockwool

The first step in planting seeds is soaking the rock wool in water that has a pH of ~6.5.  I used my awesome pH meter described in this build log.  So far I am very happy with this instrument and recommend it.  Before using, I calibrated the meter with pH4 and pH7 calibration solution.  I’m concerned I’m not taking great care of the pH probe.  I ordered some storage solution.  

After learning the importance of water quality, we added a RO (Reverse Osmosis) filter to our filtered water supply.  I got a RO filter from Amazon.com.  I relied on it being a “#1 Best Seller.”  Yah…right…but I fell for this marketing ploy….

 

NewImage

I ended up not needing to adjust the water since the meter settled at a pH of 6.3, close enough to 6.5. It 

I adjusted the pH of the water that will wet the rock wool to 6.5 using the pH meter I described in this build log.  So far I am very happy with this instrument and recommend it.  I used As I put a small drop of pH UP into the water, I decided I needed more pipettes.  I just ordered these on Amazon.com.  The long pipettes come in useful when adjusting small quantities of liquids.

On to what I am sure will be a beautiful tomorrow.