Updated Sap Flowmeter Build Guide

By: Jonathan Fookes

Abstract

This post will provide step by step instructions on how to build your own thermal dissipation sap flow sensor using everything provided on this blog and the following steps: ordering / creating parts, soldering the probes, applying the thermal epoxy, wiring to an Ethernet cable, implementing the circuit, programming the microcontroller, and installing into the tree.

Index

  1. Order and Create Parts
  2. Solder Probes
  3. Apply Thermal Epoxy
  4. Wiring the Probe
  5. Creating the Circuit
  6. Programming the Microcontroller
  7. Designing Enclosure
  8. Install in a Tree

Step 0: Required Tools

Before jumping into the project, it’s important to mention that this project requires a few specialty devices to make.

  • Soldering iron station
  • Tweezers
  • Power drill with 6mm drill bit
  • 3D-Printer Access
  • Electrical tape
  • A computer with Arduino IDE installed

Step 1: Order Parts

Below are two different bills of materials (BOM) that contain all that is required to build one of these sensors. The files for the pcb board can be found in this zip file. Base_v1 is the version we used in the design listed here. Base_v2 includes an updated switch to easily switch between TDM and HRM implementations (coming soon?). To edit, you will need to download Eagle by Autodesk as well as a few part libraries including Brett’s personal library of Eagle PCB parts. The total cost of a sensor is estimated to be just under $170! The comprehensive list of all parts used to make either an HRM or TDM probe run in working order are included in the Bill of Materials below.

Additionally, an Adafruit Feather M0 LoRa is needed with a 3.7 volt battery (suggested 4AH) for the sake of this build guide ($34.95 + $19.99 resp.). It also requires our custom build PCBS, the probes (we recommend ordering 2 more probes than needed) and our 8-pin routing board that connects directly to the Feather M0.

The Feather M0 can be substituted for any micro controller with analog-in pins with some changes to the code to accommodate these new pins (mentioned briefly in Step 4) and if a different voltage batter is used, you should take a look at this blog post and change the heater resistor value. We used the Adafruit because their boards work well with each other. In addition, the Feather M0 with LoRa can transmit data for remote data gathering and troubleshooting. See more on that here.

When ordering the electronic parts I would highly suggest you buy spare parts, especially any 0603 resistors (baked into the single sensor BOM).

Step 2: Solder Probes

Once you’ve received all the parts, it’s time to break out the soldering iron, tweezers, and reading glasses (optional) to tackle the most difficult step of this build: soldering on US0603 sized resistors. Soldering these on is a major test of patience even for veteran electrical engineers, but not impossible for first-time solders. Here are a few tips and tricks that should help: article from build-electronic-circuits.comvideo from Engenuics Technologies.

For this design, two thermistors need to be soldered into their nodes on two of the probes, and a heater resistor on one of the probes. The location for these on the probe are illustrated in the picture below. (NOTE: Keep the thermistors and heaters separate so as not to confuse them)


probe_pin_guide_SOLDER.jpgAfter the tiny resistors are in place on the end of the probe, its time to move down and solder on connectors on all the probes. For a TDM heater probe, solder pins into all five jumper holes as well as a thermistor and a heater. For a HRM heater probe, solder pins into jumper holes 4 & 5 and solder in a heater. For a thermistor probe (TDM or HRM), solder in the 100k through-hole resistor into its spot, solder three pins in to the probe’s bottom three holes, and solder in a thermistor. Use a multimeter to make sure all solder points are good and that the components are not shorted. The temperature probe should have a resistance of ~100k (this will vary based on temperature). The heater probe should have a resistance of 50 ohms (or whatever heater ohm is chosen). 

Step 3: Apply Thermal Epoxy

The next step involves the thermal epoxy. This is used in order to evenly spread out the effect of the heat pulse and to get better contact when inserted into a tree bore-hole. In the past, this was done using a 3D-printed mold, but we discovered applying the mold by hand is just as effective.

The epoxy in the BOM is a two part epoxy with a curing time of 45 minutes. To use, squeeze out equal parts from the A and B syringes and mix this well with a mixing stick. Use the mixing stick to apply a thin layer of epoxy, gently wiping away any excess epoxy with a paper towel. Wait at LEAST 45 minutes to dry, suggested overnight. Make sure that disposable gloves are used during this step. t’s also suggested that mold release spray be used on the inside of the mold to help the epoxy from sticking. Once the epoxy has dried, lightly sand the probes to remove rough edges and create a smooth surface.  Here is a picture of our HRM Ethernet probe for a visual of what the finished product should look like.


The two outside probes (thermistor probes) have been sanded. As you can see, there is a smoother texture than the middle probe (HRM coil heater probe), which has not yet been sanded.The two outside probes (thermistor probes) have been sanded. As you can see, there is a smoother texture than the middle probe (HRM coil heater probe), which has not yet been sanded.

As we make more probes, we will include more pictures to show the application process in greater detail.

Step 4: Wiring the Probe

The probes should be wired to the board as shown to work with the current code.


probe_pin_guide.jpgThe heater probes could be attached to the 3.3V output pin (identified by “3V”) in order to further stabilize the power delivered as battery voltage decreases as it dies but the 3.3V should always be the same. However, this would reduce the energy efficiency of the system as the 3.3V output pin goes through the M0’s internal voltage regulator which burns off the excess voltage as heat. Also, the 3.3V supply has a max supply of 500mA which is near the current draw of a single heater probe. The following is a pinout of the Feather M0 board for a connection reference. 


We used an ethernet cable to connect the proper M0 pins to the probes as shown in the schematic. This was done by carefully routing our specially built PCB 8-Pin connector board (Base_v1 as listed above), specially designed to properly connect the probes with the color-coded guides listed below and the 8-pin connectors listed in the BOM. Cut off one end of the Ethernet cable to expose the 8 wires inside the protective inductor outside. Use the following schematics and Ethernet color chart to properly connect the probes so that they work as desired.

Insert probe guide from the PCB for which pin (on each probe) goes to which color of wire (with Ethernet color-coded cable pinout)


ethernet wiring guide.png
8 Pin Guide.jpgThe RJ45 Pin # corresponds to the number and title on the 8-pin Guide picture when the RJ45 is soldered correctly into our PCB design. Here is a number guide for wiring a TDM and a HRM probe:

TDM

1   VCC – White & Orange – Pin 1 on the Heater Probe

2   A0 – Orange – Pin 2 on the Heater Probe

3   GND – White & Green – Pin 3 on the Heater Probe

4   V_BAT – Blue – Pin 4 on the Heater Probe

5   GND – White & Blue – Pin 5 on the Heater Probe

6   VCC – Green – Pin 1 on the Thermistor Probe

7   A1 – White & Brown – Pin 2 on the Thermistor Probe

8   GND – Brown – Pin 3 on the Thermistor Probe

HRM

1   VCC – White & Orange – Pin 1 on Thermistor Probe 1

2   A0 – Orange – Pin 2 on Thermistor Probe 1

3   GND – White & Green – Pin 3 on Thermistor Probe 1

4   V_BAT – Blue – Pin 4 on the Heater Probe

5   GND – Blue & White – Pin 5 on the Heater Probe

6   VCC – Green – Pin 1 on Thermistor Probe 2

7   A1 – White & Brown – Pin 2 on Thermistor Probe 2

8   GND – Brown – Pin 3 on Thermistor Probe 2

Here is a picture of our finished TDM probe. A picture of the finished HRM probe is included in thermal epoxy application section.


TMD_probe.JPGTo use the probe guide, use this file (Upload coming soon) to 3D print a probe guide. Place the probes correctly (TDM: Heater on top, thermistor on bottom) (HRM: Heater in the middle, thermistors on top & bottom). We used tape to secure the lid on the probe guide, and we also recommend gluing each probe in place to properly secure them.

Step 5: Creating the Adafruit Board Circuit

The circuit for the sapflow probe is made with a variety of Feather boards from Adafruit, including Feather M0 with LoRa Radio, Power Relay FeatherWing, and Adalogger FeatherWing with SD add-on. Our custom PCB is also used, which has the voltage regulator used for the TDM method, the 8-pin connector, and tracing that allows to switch between the TDM and HRM methods (depending on which probe is ended up chosen). Currently, both models require a 3.3V battery that can power the Feather M0 board and a 12V battery that can power the heater. Below is a picture guide for how to set up the stack of boards, using a FeatherWing Tripler PCB board from Adafruit as a mount.


This is our custom PCB, which is linked above, without any parts on it yet. This is the best place to start! This is our custom PCB, which is linked above, without any parts on it yet. This is the best place to start! 


Our fully assembled PCB. Note the type of headers used in these and subsequent pictures. This is crucial for proper assembly!Our fully assembled PCB. Note the type of headers used in these and subsequent pictures. This is crucial for proper assembly!


Picture of the Feather M0 with LoRa Radio with the pins correctly soldered on.Picture of the Feather M0 with LoRa Radio with the pins correctly soldered on.


Stack the custom PCB construction on top of the Feather M0 with LoRa as shown, and solder female pins on the FeatherWing Tripler as shown. Stack the custom PCB construction on top of the Feather M0 with LoRa as shown, and solder female pins on the FeatherWing Tripler as shown. 


Place the Construction onto the TriplerPlace the Construction onto the Tripler


Next, solder the pins onto the Adalogger FeatherWing RTC + SD Add-on as shown. Insert Micro SD cardNext, solder the pins onto the Adalogger FeatherWing RTC + SD Add-on as shown. Insert Micro SD card


Solder the pins onto the Power Relay FeatherWing as shown.Solder the pins onto the Power Relay FeatherWing as shown.


Stack the Power Relay on top of the Adalogger and place the new block onto the FeatherWing Tripler. Stack the Power Relay on top of the Adalogger and place the new block onto the FeatherWing Tripler. 


This shows the power connections for the HRM Power Model. Red is (+) on the 12V battery and Black is the (-) on the 12V battery.This shows the power connections for the HRM Power Model. Red is (+) on the 12V battery and Black is the (-) on the 12V battery.

This TDM circuit for our probe uses a voltage regulator instead of the power relay. This is soldered directly onto our custom PCB. Below is on picture of the boards used for the TDM circuit. NOTE: not used with the 8-pin connector, this particular model was made before we had received these. Note the labels and picture caption for construction. For differences between the TDM and HRM implementations, visit our Second Tests: Cherry Tree page for an extensive list of differences.


Ignore the small red and blue wires shown on the custom PCB. We blew one of the traces and that just corrects the error. The 12V battery is put directly to the voltage regulator through the pins on our custom PCB.Ignore the small red and blue wires shown on the custom PCB. We blew one of the traces and that just corrects the error. The 12V battery is put directly to the voltage regulator through the pins on our custom PCB.

Step 6: Program the Microcontroller

This device can be fully integrated with the OPEnS designed LOOM interface. The code for the program described in this build guide is posted here (LINK). This post (LINK TO LOOM) explains these different functions in LOOM and how to use them. The following is a setup guide for how to setup the user interface to run the Sap Flowmeter data collection.

If you’ve never used an Feather M0 before, check out these two pages on Adafruit’s tutorial:

If you’ve never programmed in Arduino before (or ever), I would highly recommend reading though a few of the fundamental tutorial pages on the Arduino website until you grasp basic the basic concepts and idea of what Arduino isLinked here.

Step 7: 3D-Printing the Enclosure

Current Design

This is the current model of the enclosure. Its features include: snap-fit lid, compartments for the 3.3V & 12V batteries, mounts for the Adafruit FeatherWing tripler to hold the circuit in place, hole for the waterproof Ethernet cable gland, hole for LoRa antenna (6mm near the mounts), and hole for the soil/moisture sensor aux cable gland (9.5mm across from antenna hole). The compartments in the back right corner are to hold the batteries and prevent them from sliding around. The mounts on the base of the enclosure are design to hold M2 size screw bases. M2 screws fit through the holes in the Adafruit tripler board, thus securing it to the enclosure.

To fully waterproof the enclosure, we recommend treating the enclosure and its lid with acetone to fully seal the plastic. We also recommend lining the lid with a sealant (hot glue, caulk) to make sure no water seeps in and messes up the circuitry inside during testing. The lid of the enclosure, for now, takes some work to get off, so we designed handles to make this easier.

Again, the model for our enclosure is always updating as we improve our design, so this is not a final design by any means.

Step 8: Install in Tree

NOTE: Make sure to read and understand this section entirely before proceeding with an install.

In order to to ensure that the probes are properly spaced, a 3D printed guide should be used. This version has a 30 mm spacing between the center of the two outside probes. Future tests should test with different probe spacing. This doesn’t need to be as precise as the thermal epoxy mold; we used a Lulzbot Taz 5.

Once the probe is all set up, drill holes in the chosen tree such that each probes fits inside perfectly and inside the tree up to the probe guide. For the best results, drill the holes approximately 1 meter from the ground (CITE). To find the perfect placement for these holes, I traced the bottom portion of the probe guide onto a piece of paper to make sure the holes were perfectly spaced. Make sure to use the proper size drill bit!

Install the probe will the heater probe above the temperature probeThis is important for TDM testing. Fill the holes with the thermal paste to keep the holes sealed and the probes in place. As of right now, we have not tested with the thermal paste.

Once the probe is in the tree, make sure to cover it with some layers of protection. For an example of this, checkout the Dynamax installation video. Here is a picture of our method:


Our TDM Probe in the Tree! The probes fit perfectly into the drilled holes with properly applied epoxy. For a guide on how to test and to see our data, go check out our tree test page!Our TDM Probe in the Tree! The probes fit perfectly into the drilled holes with properly applied epoxy. For a guide on how to test and to see our data, go check out our tree test page!