Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Multiplexer


LouisD Jul 18, 2018 05:15 PM

Hi, I would like to monitored 8 sapflow probes on a multiplexer. Each probe needs 6 single-ended measurements an excitation, ground, and then the two heater wires need to be connected to the heater control board.

I used the following CR-1000 program that work well for one probe on a CR-1000 dataloger without multiplexer, but I would like to read 8 probes with a 16/32 multiplexer.

Any advice on wiring would also be appreciated.

Thank youn in advance, Louis

'CR1000 Series Datalogger
'program to measure East30 3 needle sap flow sensor with CR1000 datalogger
'wiring:  SE 1 - purple - thermistor 1 (top needle outer)
'     SE 2 - yellow - thermistor 2 (top middle)
'     SE 3 - green - thermistor 3 (top inner)
'     SE 4 - blue - thermistor 4 (bottom needle outer)
'     SE 5 - white - thermistor 5 (bottom middle)
'     SE 6 - orange - thermistor 6 (bottom inner)
'     gnd - pink - gnd
'     Vx1 - red - thermistor excitation
'     C1 - interface board or relay driver ctrl
'     gnd - interface board or relay driver gnd
'     interface board + - black1 on sensor (heater)
'     interface board gnd - black 2 on sensor (heater)
'     interface board source + - 12V battery or power supply +
'     interface board source gnd - gnd (-) on battery or power supply

Public Tinitial(6),T60(6),deltaT(6)'arrays for six thermistors
Public ratio(3),V(3),A(3),J(3)'arrays for three flux zones
Public t,Tpanel,i, Rx'variable declarations
Public x(6),raw(6)


Const k = 0.5 'thermal conductivity of sapwood (W/mK)
Const C = 6.7 'circumfrence of tree (cm)
Const bark = 0.3 'tree bark thickness (cm)
Const Rh = 3.5 'radius of heart wood
Const Cw = 4.18 'volumetric heat capacity of water (MJ/m3 K)
Const xd = 0.6 'distance between heated needle and downstream needle (cm)
Const xu = 0.6 'distance between heated needle and upstream needle (cm)
Const pi = 3.1416

DataTable (Table1,1,-1)
  Sample (3,V(),FP2)
  Sample (3,J(),FP2)
EndTable

Sub SapFlow
  PanelTemp (Tpanel,_60Hz)
 
  BrHalf (raw(),6,mV25,1,Vx1,6,30,True ,0,_60Hz,1.0,0)
  x(1)=LN(1/raw(1)-1)
  x(2)=LN(1/raw(2)-1)
  x(3)=LN(1/raw(3)-1)
  x(4)=LN(1/raw(4)-1)
  x(5)=LN(1/raw(5)-1)
  x(6)=LN(1/raw(6)-1)
  Tinitial(1)=-.0837*x(1)^3+1.532+x(1)^2-22.843*x(1)+25.019
  Tinitial(2)=-.0837*x(2)^3+1.532+x(2)^2-22.843*x(2)+25.019
  Tinitial(3)=-.0837*x(3)^3+1.532+x(3)^2-22.843*x(3)+25.019
  Tinitial(4)=-.0837*x(4)^3+1.532+x(4)^2-22.843*x(4)+25.019
  Tinitial(5)=-.0837*x(5)^3+1.532+x(5)^2-22.843*x(5)+25.019
  Tinitial(6)=-.0837*x(6)^3+1.532+x(6)^2-22.843*x(6)+25.019

  t=0'reset time counter
  Do While t<60'loop for 60 seconds
    If t<8'8 second heat pulse
      PortSet (1,1)'turn on heater
    Else
      PortSet (1,0)'turn off heater
    EndIf
    Delay (1,999,mSec)
    t=t+1
  Loop

  BrHalf (raw(),6,mV25,1,Vx1,6,30,True ,0,_60Hz,1.0,0)
  x(1)=LN(1/raw(1)-1)
  x(2)=LN(1/raw(2)-1)
  x(3)=LN(1/raw(3)-1)
  x(4)=LN(1/raw(4)-1)
  x(5)=LN(1/raw(5)-1)
  x(6)=LN(1/raw(6)-1)
  T60(1)=-.0837*x(1)^3+1.532+x(1)^2-22.843*x(1)+25.019
  T60(2)=-.0837*x(2)^3+1.532+x(2)^2-22.843*x(2)+25.019
  T60(3)=-.0837*x(3)^3+1.532+x(3)^2-22.843*x(3)+25.019
  T60(4)=-.0837*x(4)^3+1.532+x(4)^2-22.843*x(4)+25.019
  T60(5)=-.0837*x(5)^3+1.532+x(5)^2-22.843*x(5)+25.019
  T60(6)=-.0837*x(6)^3+1.532+x(6)^2-22.843*x(6)+25.019
 
  i=1
  Do While i<7
    deltaT(i)=T60(i)-Tinitial(i)'calculate temperature change resulting from heat pulse
    i=i+1
  Loop

  Rx=(C/(2*pi))-bark'radius of xylem
  A(1)=pi*(Rx^2-(Rx-1.5)^2) 'area of outermost 1.5 cm radius of xylem (cm2)
  A(2)=Pi*((Rx-1.5)^2-(Rx-2.5)^2) 'area of xylem with radius 1.5 cm from bark to 2.5 cm from bark
  A(3)=pi*((Rx-2.5)^2-(Rx-Rh)^2) 'area of xylem with radius 2.5 cm from bark to heartwood

  i=1
  Do While i<4
    ratio(i)=LN(deltaT(i)/deltaT(i+3))'calculate ln(Tu/Td)
    V(i)=(ratio(i)*2*k)/((xd+xu)*Cw)'calculate sap flow velocity in the three measurement zones (cm/s)(See manual for details on theory)
    J(i)=A(i)*V(i)*3600'calculate sap flux in three measurement zones (cm3/hr)
    i=i+1
  Loop

EndSub

BeginProg
  Scan (1,Sec,0,0)
    If IfTime (0,5,Min) Then 'measure sap flow every 30 minutes
      Call SapFlow
      CallTable Table1
    EndIf
  NextScan
EndProg

Log in or register to post/reply in the forum.