Tags

, , , , ,

Where Project is At

Successfully sending Moisture Info packets from a Moisture Puck situated in Strawberry Swirl to a RFM69 Feather attached to my Mac within my house.

The Arduino Code/version I used is located at this GitHub location.  See Firmware Tests below for more info.

Moisture Puck

Here’s some Fusion 360 images of the Moisture Puck:

NewImage   NewImage

In my excitement, I forgot to take a picture of the insides of the Moisture Puck that is situated in Strawberry Swirl.  Here is an image of the Strawberry Swirl Moisture Puck:

NewImage 

  • Radio and micro controller:   I am using Adafruit’s Feather M0 RFM69HCW – 915 MHz for communication between the controller and the Moisture Pucks (Note the green dot.  This means 900 MHz.  I’ve had others with a red dot on the RM69 chip.  The red dot means it’s 433 MHz).

  • Moisture sensor: I’m using Funduino moisture sensors I had from last year.

 

 

 I bought several of these:

NewImage

Good better bestWhile the Funduino sensors are readily available and inexpensive, they are not robust and the “sensor legs” are short  The moisture sensor should be taking readings at the root level.  I could go the expensive/accurate route and explore using the Vegetronix VH-400 sensor.  But – whoa $40? Given accuracy is not required, for now I will continue to use the Funduino sensors and replace them each season.

Firmware Tests

Something that made testing easier was opening two separate copies of the Arduino IDE.  This way, each copy can use a different serial port.  This way, I can open a serial monitor for both feathers while I built the code.  To do this, I opened up a terminal and entered:

open -n -a /Applications/Arduino.app

Once the Feathers came in from Adafruit, I quickly wrote up some Arduino code to get a better understanding of communications between the Controller and one Moisture Puck.  I changed RFM69 libraries from using Felix’s to RadioHead’s.  I did this based on Adafruit’s recommendation.  My reasoning is I will be going to Adafruit for support.  It helps to use the same 3rd party libraries they use / recommend.

Firmware tests are based on the code located at this GitHub location.

First Readings

I have included the First Readings I am basing these comments on at the end of this post

Prior to watering, the moisture reading from the Strawberry Swirl moisture puck was 293.  After 8 minute watering, it was 382. Reading and watering was taken around 7AM.

The weather forecast for today (weather.com): Some clouds this morning will give way to generally sunny skies for the afternoon. High 78F. Winds W at 5 to 10 mph.

A question of interest: What is the moisture reading later in the day?  Given the difference in reading, how should the amount of watering time be adjusted (if at all)?

One thing that makes it difficult to answer this question is I did not include the Time of Day with the hourly logging of each reading.  I was able to backtrack and figure out the reading was slightly above 300.  This means there wouldn’t be a PM reading, but there would be an AM reading.  This seems a bit right, perhaps a bit on the low end. I will update the plan I have for the amount of time to water to 10 minutes from 8 minutes.

Waterproof Enclosure

A concern I had was if the container was enclosed enough to be waterproof.  While I haven’t opened up the enclosure to check, I was relieved to get a reading after watering.  If water is detected inside the enclosure when I open it up, I’ll see about adding a gasket or some other seal.

Temperature

(Note Doxygen documentation for RH_RF69 is located here).

Another concern of mine was whether it got too hot within the enclosure.  I’m using the temperature of the radio since this was easy for me to use.  The temperature values returned went from a low of 69˚F to a high of 104˚F.  While this range is acceptable – and it “feels” about right – I should heed the documentation made by Mike McCauley in the RH_RF69.h file:

/// Reads the on-chip temperature sensor.
  /// The RF69 must be in Idle mode (= RF69 Standby) to measure temperature.
  /// The measurement is uncalibrated and without calibration, you can expect it to be far from
  /// correct.
  /// \return The measured temperature, in degrees C from -40 to 85 (uncalibrated)
  int8_t temperatureRead();

 

  • I’m not sure the RFM69 is in standby mode when I’m taking the measurement.  I will figure this out and correct if needed.  Perhaps when temperatureRead() is called it puts the radio into standby mode? Dunno right now….
Here is the temperatureRead() code from RH_RF69.cpp:
int8_t RH_RF69::temperatureRead()
  {
  // Caution: must be ins standby.
  // setModeIdle();
  spiWrite(RH_RF69_REG_4E_TEMP1, RH_RF69_TEMP1_TEMPMEASSTART); // Start the measurement
  while (spiRead(RH_RF69_REG_4E_TEMP1) & RH_RF69_TEMP1_TEMPMEASRUNNING)
  ; // Wait for the measurement to complete
  return 166spiRead(RH_RF69_REG_4F_TEMP2); // Very approximate, based on observation
 

}

hmm…I assume setModeIdle(); puts the RF69 into standby mode?  If so why is it commented out?  According to the Doxygen documentationIf current mode is Rx or Tx changes it to Idle. If the transmitter or receiver is running, disables them.

What I am currently doing is documented in MoisturePuck2017.ino.

  • Calibrate?  How do I do that?  Not sure…and perhaps “unprofessional” of me, I’m ignoring the calibration comment since the readings look “about right.”

Battery Life

Ideally, the batteries would never have to be recharged.  Right now I’m not using solar power – although I’ll explore this….the focus here is on power management.

Power Management

The firmware currently running on the Moisture Puck has no power management optimizations.  Without power management, the battery needs to be recharged after about 40 hours.

The first reading I took yesterday afternoon:

…got reply from node 2 | RSSI: -91
—> Moisture Info <—
Moisture Reading: 366| Battery level: 4.22| Radio Temperature: 93

The Latest readings – about 39 hours later :

—> Moisture Info <—
Moisture Reading: 290| Battery level: 3.72| Radio Temperature: 68
…got reply from node 2 | RSSI: -73
—> Moisture Info <—
Moisture Reading: 289| Battery level: 3.71| Radio Temperature: 68
…got reply from node 2 | RSSI: -72
—> Moisture Info <—
Moisture Reading: 287| Battery level: 3.69| Radio Temperature: 68
…got reply from node 2 | RSSI: -72
—> Moisture Info <—
Moisture Reading: 287| Battery level: 3.66| Radio Temperature: 68
…got reply from node 2 | RSSI: -81
—> Moisture Info <—
Moisture Reading: 287| Battery level: 3.56| Radio Temperature: 68

show the battery should be recharged as discussed in Adafruit’s documentation:  Lipoly batteries are ‘maxed out’ at 4.2V and stick around 3.7V for much of the battery life, then slowly sink down to 3.2V or so before the protection circuitry cuts it off. By measuring the voltage you can quickly tell when you’re heading below 3.7V.

The Battery University web page provides awesome material on LiPo batteries.  Here’s their image of a standard LiPo discharge curve:

A Question of Interest: How long before this code sinks below 3.2V?

Code Additions

Things I’ll add to the code in an attempt to maximize the battery life:

  • Call RH_RF69::sleep() .  See the Doxygen documentation.  Also Adafruit’s documentation notesIf you put the radio to sleep after transmitting with radio.sleep(); rather than just sitting in receive mode, you can save more current, after transmit is complete, the average current drops to ~10mA which is just for the microcontroller.  I added code into the Moisture Puck Arduino code.
  • Stuff on My Virtual Life’s blog post for October 11, 2016.  The post discusses power management techniques specific to Feather M0’s.  I haven’t read it enough to do anything with it…but looks promising.

Shopping List

Explore Solar Powered

The shopping list includes:

Moisture Pucks

Appendix: First Readings

***Garden Controller***

RFM69 radio init OK!
RFM69 radio @915 MHz
…got reply from node 2 | RSSI: -91
—> Moisture Info <—
Moisture Reading: 366| Battery level: 4.22| Radio Temperature: 93
…got reply from node 2 | RSSI: -80
—> Moisture Info <—
Moisture Reading: 385| Battery level: 4.20| Radio Temperature: 104
…got reply from node 2 | RSSI: -84
—> Moisture Info <—
Moisture Reading: 394| Battery level: 4.17| Radio Temperature: 107
…got reply from node 2 | RSSI: -81
—> Moisture Info <—
Moisture Reading: 394| Battery level: 4.15| Radio Temperature: 107
…got reply from node 2 | RSSI: -84
—> Moisture Info <—
Moisture Reading: 391| Battery level: 4.13| Radio Temperature: 104
…got reply from node 2 | RSSI: -84
—> Moisture Info <—
Moisture Reading: 385| Battery level: 4.11| Radio Temperature: 98
…got reply from node 2 | RSSI: -85
—> Moisture Info <—
Moisture Reading: 373| Battery level: 4.09| Radio Temperature: 89
…got reply from node 2 | RSSI: -87
—> Moisture Info <—
Moisture Reading: 360| Battery level: 4.07| Radio Temperature: 84
…got reply from node 2 | RSSI: -87
—> Moisture Info <—
Moisture Reading: 348| Battery level: 4.04| Radio Temperature: 80
…got reply from node 2 | RSSI: -84
—> Moisture Info <—
Moisture Reading: 341| Battery level: 4.03| Radio Temperature: 77
…got reply from node 2 | RSSI: -83
—> Moisture Info <—
Moisture Reading: 334| Battery level: 4.02| Radio Temperature: 77
…got reply from node 2 | RSSI: -83
—> Moisture Info <—
Moisture Reading: 328| Battery level: 4.00| Radio Temperature: 75
…got reply from node 2 | RSSI: -85
—> Moisture Info <—
Moisture Reading: 320| Battery level: 3.98| Radio Temperature: 73
…got reply from node 2 | RSSI: -85
—> Moisture Info <—
Moisture Reading: 308| Battery level: 3.96| Radio Temperature: 71
…got reply from node 2 | RSSI: -85
—> Moisture Info <—
Moisture Reading: 304| Battery level: 3.94| Radio Temperature: 69
…got reply from node 2 | RSSI: -76
—> Moisture Info <—
Moisture Reading: 298| Battery level: 3.94| Radio Temperature: 69
…got reply from node 2 | RSSI: -66
—> Moisture Info <—
Moisture Reading: 298| Battery level: 3.93| Radio Temperature: 69
…got reply from node 2 | RSSI: -71
—> Moisture Info <—
Moisture Reading: 293| Battery level: 3.91| Radio Temperature: 69
…got reply from node 2 | RSSI: -76
—> Moisture Info <—
Moisture Reading: 382| Battery level: 3.89| Radio Temperature: 69
…got reply from node 2 | RSSI: -73
—> Moisture Info <—
Moisture Reading: 371| Battery level: 3.88| Radio Temperature: 69
…got reply from node 2 | RSSI: -76
—> Moisture Info <—
Moisture Reading: 361| Battery level: 3.86| Radio Temperature: 71
…got reply from node 2 | RSSI: -74
—> Moisture Info <—
Moisture Reading: 356| Battery level: 3.86| Radio Temperature: 73
…got reply from node 2 | RSSI: -76
—> Moisture Info <—
Moisture Reading: 346| Battery level: 3.85| Radio Temperature: 71
…got reply from node 2 | RSSI: -79
—> Moisture Info <—
Moisture Reading: 371| Battery level: 3.85| Radio Temperature: 100
…got reply from node 2 | RSSI: -78
—> Moisture Info <—
Moisture Reading: 391| Battery level: 3.85| Radio Temperature: 104
…got reply from node 2 | RSSI: -78
—> Moisture Info <—
Moisture Reading: 389| Battery level: 3.84| Radio Temperature: 107
…got reply from node 2 | RSSI: -78
—> Moisture Info <—
Moisture Reading: 382| Battery level: 3.83| Radio Temperature: 107
…got reply from node 2 | RSSI: -75
—> Moisture Info <—
Moisture Reading: 372| Battery level: 3.83| Radio Temperature: 102
…got reply from node 2 | RSSI: -75
—> Moisture Info <—
Moisture Reading: 362| Battery level: 3.82| Radio Temperature: 100
…got reply from node 2 | RSSI: -75
—> Moisture Info <—
Moisture Reading: 352| Battery level: 3.82| Radio Temperature: 95
…got reply from node 2 | RSSI: -75
—> Moisture Info <—
Moisture Reading: 337| Battery level: 3.82| Radio Temperature: 84
…got reply from node 2 | RSSI: -75
—> Moisture Info <—
Moisture Reading: 326| Battery level: 3.80| Radio Temperature: 78
…got reply from node 2 | RSSI: -75
—> Moisture Info <—
Moisture Reading: 317| Battery level: 3.79| Radio Temperature: 77
…got reply from node 2 | RSSI: -76
—> Moisture Info <—
Moisture Reading: 311| Battery level: 3.79| Radio Temperature: 73
…got reply from node 2 | RSSI: -76
—> Moisture Info <—
Moisture Reading: 305| Battery level: 3.78| Radio Temperature: 71
…got reply from node 2 | RSSI: -76
—> Moisture Info <—
Moisture Reading: 301| Battery level: 3.78| Radio Temperature: 69
…got reply from node 2 | RSSI: -76
—> Moisture Info <—
Moisture Reading: 298| Battery level: 3.76| Radio Temperature: 69
…got reply from node 2 | RSSI: -74
—> Moisture Info <—
Moisture Reading: 295| Battery level: 3.75| Radio Temperature: 68
…got reply from node 2 | RSSI: -73
—> Moisture Info <—
Moisture Reading: 293| Battery level: 3.73| Radio Temperature: 68
…got reply from node 2 | RSSI: -73
—> Moisture Info <—
Moisture Reading: 290| Battery level: 3.72| Radio Temperature: 68
…got reply from node 2 | RSSI: -73
—> Moisture Info <—
Moisture Reading: 289| Battery level: 3.71| Radio Temperature: 68
…got reply from node 2 | RSSI: -72
—> Moisture Info <—
Moisture Reading: 287| Battery level: 3.69| Radio Temperature: 68
…got reply from node 2 | RSSI: -72
—> Moisture Info <—
Moisture Reading: 287| Battery level: 3.66| Radio Temperature: 68
…got reply from node 2 | RSSI: -81
—> Moisture Info <—
Moisture Reading: 287| Battery level: 3.56| Radio Temperature: 68

Advertisements