- Sensor Installation
- Checklist for D32 Pro (WiFi)
- Checklist for D32 Pro (Raspberry Pi)
- Checklist for D1 Mini
- Sensor
- Tape or parafilm
- 2 Twist-ties
- Bubble wrap or styrofoam (~ 5 x 12 cm)
- Aluminum foil (~ 5 x 12 cm)
-
Connect sensor to microcontroller (D32 Pro or D1 Mini).
-
Position sensor on stem (width < 1 cm). On each plant, choose locations of similar height and stem width. Install each sensor facing the same direction and in the same vertical orientation, noting Temp 1 on the bottom and Temp 2 on the top (an "E" shape).
-
Use tape or parafilm to secure the sensor’s straight edge on the stem. The nodes should press firmly against the stem’s surface.
-
Use 2 twist-ties to tighten and secure the sensor’s hold.
-
When secure in place, wrap piece of bubble wrap or styrofoam around the stem and tape in place. This helps buffer air temperature.
-
Wrap aluminum foil around the bubble wrap and tape in place. This helps buffer light; ensure there are no holes or openings where light can enter.
Board: Arduino-ESP32
- Connect microcontroller via USB.
- In Arduino, open Preferences and copy release link to Additional Boards Manager URLs. Separate multiple URLs with commas. (Files > Preferences)
- Open Boards Manager, search "esp32" and install. (Tools > Board > Boards Manager)
- Switch board to LOLIN D32 PRO. (Tools > Board)
- In Library Manager, search and install the following libraries (Tools > Manage Libraries):
- Adafruit GFX
- ArduinoJSON by Benoit Blanchon
- ESP_DoubleResetDetector by Khoi Hoang
- ESP_WiFiManager by Khoi Hoang
- HDC2080 Arduino Library by Lime Labs
- PubSubClient by Nick O'Leary
- RTC by Makuna by Michael C. Miller
- Time by Michael Margolis
- These optional libraries can be downloaded online and copied to Arduino Libraries folder in Finder. Comment out applicable lines in script if unused. (In Finder, Arduino > libraries)
- Open D32 Pro script (WiFi) in Arduino.
- Verify/Compile and Upload to microcontroller via USB
- Connect to WiFi:
- On phone or computer, select WiFi network “SAPFLOW_<unique_chip_id>”.
- On next screen, select “Configuration”.
- Select WiFi network, enter password, and select "Save".
- Wait to connect. “SAPFLOW_<unique_chip_id>” will disappear from network list when complete.
- NOTES:
- Once connected, the "SAPFLOW_<unique_chip_id>" network will not reappear when reconnecting to the same network.
- If "SAPFLOW_<unique_chip_id>" network does not appear for initial connection, press and hold Reset button on microcontroller for 5 seconds.
- The microcontroller might reset itself while attempting to connect to the network.
- Operating modes:
- Normal: If microcontroller is successfully connected to the network, the blue LED will be solid only during the heat pulse. Data will be both recorded to the MicroSD card and uploaded online through the dashboard.
- Offline: If microcontroller is in offline mode, the blue LED will blink continuously (~1 blink/second). Data will only be recorded to the MicroSD card.
- Sign into the Sapflow Dashboard to check that data is uploading.
Board: Arduino-ESP32
- Connect microcontroller via USB.
- In Arduino, open Preferences and copy release link to Additional Boards Manager URLs. Separate multiple URLs with commas. (Files > Preferences)
- Open Boards Manager, search "esp32" and install. (Tools > Board > Boards Manager)
- Switch board to LOLIN D32 PRO. (Tools > Board)
- In Library Manager, search and install the following libraries (Tools > Manage Libraries):
- Adafruit GFX
- ArduinoJSON by Benoit Blanchon
- HDC2080 Arduino Library by Lime Labs
- PubSubClient by Nick O'Leary
- RTC by Makuna by Michael C. Miller
- These optional libraries can be downloaded online and copied to Arduino Libraries folder in Finder. Comment out applicable lines in script if unused. (In Finder, Arduino > libraries)
- NOTE: For PubSubClient, edit PubSubClient.h increase max packet size from 128b to 512b. (In Finder, Arduino > libraries > PubSubClient > src > PubSubClient.h > Edit “#define MQTT_MAX_PACKET_SIZE 512”)
- Open D32 Pro script (Pi) in Arduino. (If microcontroller doesn't have an RTC chip, open D32 Pro script (no RTC).)
- ClientID: change
“clientID”
- Server/broker IP address: change
“mqtt_server”
- Connect to WiFi: enter
“wifi name”
and“wifi password”
- Verify/Compile and Upload to microcontroller via USB
- Open Serial Monitor and check that data is uploading. (Tools > Serial Monitor)
- Check that Temperatures are not reading negative. If yes, try pressing Reset button on microcontroller several times.
- Check that data is also transmitting on Raspberry Pi.
Board: Arduino-ESP8266
- Connect microcontroller via USB.
- In Arduino, open Preferences and copy release link (https://arduino.esp8266.com/stable/package_esp8266com_index.json) to Additional Boards Manager URLs. Separate multiple URLs with commas. (Files > Preferences)
- Open Boards Manager, search "esp8266" and install. (Tools > Board > Boards Manager)
- Switch board to LOLIN (WEMOS) D1 mini Lite. (Tools > Board)
- In Library Manager, search and install the following libraries (Tools > Manage Libraries):
- ArduinoJSON by Benoit Blanchon
- HDC2080 Arduino Library by Lime Labs
- PubSubClient by Nick O'Leary
- WiFi Manager by Tzapu
- This optional library can be downloaded online and copied to Arduino Libraries folder in Finder. Comment out applicable lines in script if unused. (In Finder, Arduino > libraries)
- NOTE: For PubSubClient, edit PubSubClient.h increase max packet size from 128b to 512b. (In Finder, Arduino > libraries > PubSubClient > src > PubSubClient.h > Edit “#define MQTT_MAX_PACKET_SIZE 512”)
- Open D1 Mini script in Arduino.
- ClientID: change
“clientID”
- Server/broker IP address: change
“mqtt_server”
- Verify/Compile and Upload to microcontroller via USB
- Connect to WiFi:
- On phone, select WiFi network “AutoConnectAP”.
- On next screen, select “Configure WiFi”.
- Select WiFi network, enter password, and select "Save".
- Wait to connect. “AutoConnectAP” will disappear from network list when complete.
- NOTE: If "AutoConnectAP" network does not appear:
- Once connected, it will not reappear when reconnecting to the same network.
- Press and hold Reset button on microcontroller for 5 seconds.
- In script, activate
//wifiManager.resetSettings();
towifiManager.resetSettings();
. Upload to microcontroller. - "AutoConnectAP" network should now appear. Connect through phone.
- In script, re-comment out
wifiManager.resetSettings();
to//wifiManager.resetSettings();
. Re-upload to microcontroller.
- Open Serial Monitor and check that data is uploading. (Tools > Serial Monitor)
- Check that Temperatures are not reading negative. If yes, try pressing Reset button on microcontroller several times.
- Check that data is also transmitting on Raspberry Pi.