12/6/2016

Goals:

We would like to finalize the FSM we are developing now to determine how we are moving through the watering sequence. The largest contingency on this is how we are determining the optimal watering time based on temperature. We will come to a conclusion on this and Adam will continue to frame the FSM for our final design. Christer will finalize the comparator and be able to record the number of pulses output from the flow sensor that will directly translate to the amount of water being passed through the system. We will both be working on the I2C communication for the temperature sensor as we both will be executing this for the first time.

Work Completed:

Adam

  • Continued improvements to watering sequence.
  • Implemented a proportional control algorithm to alter the target water amount, based on the difference measured by the moisture sensor.
  • Cleaned up code, moved all configuration information to the top, to make it easier to switch from a test mode to real-time.
  • Implemented a manual water mode, allowing it to still interface with the automated system. Will only water the targeted amount (for defined moisture level). Allows for manual stoppage.
  • Temperature algorithm now uses a series of five data points, determining the temperature gain/loss between each, then makes a decision as to whether or not a cooling trend is located.
  • Recalibrated the LCD touchscreen, as well as debounced our button presses so they are accurate and (properly) responsive.
  • Further implemented two configurations, so that the system can switch between short timeframe testing and longer real-time use.

Christer

  • Changed flow sensor from working with the comparator to being a digital input pin. To accommodate this, an op-amp was added to create a more precise square wave. This input was used to control an interrupt that measures the amount of water dispersed by the tank.
  • The assembled flow system was attached to the water tank by screwing it into the valve on the bottom on the tank. To ensure the weight of the solenoid would not pull it from the valve, zip ties were used through holes put through the table to hold most of the weight.
  • The screen would display more water was dispersed than was actually let out of the tank due to the momentum of the water in the flow sensor. The logic for updating the flow value was changed to update only when in the state of watering and once we reached our target amount and the solenoid was closed, we would no longer update the water dispensed value.
  • Created the User Interface based on design proposal and elements we found useful during testing. The valve state is displayed at the bottom with an indicator if the tank needs water added to it.

Combined

  • Tested water flow sensor in test setup for accuracy. Reading was roughly 30ml over expected value.
  • Reviewed Design Proposal to ensure constraints were met. Added display information, as well as water moisture threshold.
  • Tested in soil. Soil used in testing proved to be difficult to use, due to extremely dry state it started in. Mixed with water, in hopes to produce moisture levels more conducive to further testing.
  • Fixed proportional control for water target amounts. We now normalize our error, and change our targeted amount by this percentage, rather than a fixed value.
  • Added failsafe to our solenoid valve. Will now only be allowed to stay open for a user-defined amount of time.
  • Tested system repeatedly to see how it traverses through the irrigation cycle. System seems fully implemented, however, more confirmation testing is still needed.

Current Challenges:

We are currently testing the system and attempting to identify any bugs. The largest challenge we are facing now is getting consistent dirt conditions for testing. The dirt was very dry when we added it to the containers and did not absorb water. We are letting the containers sit overnight with varying amounts of water to see how they settle. The other challenge we have is determining how we will display our findings in a way that conveys that our system meets the requirements.

Upcoming Goals:

If we find the soil has reached the testing condition that we expect (how saturated the dirt is) then we will test the system in each sample every day this week. Through these trials we hope to confirm the effectiveness of our target water dispensed algorithm, and its reactions to various soil moisture levels above and below desired thresholds. We also intend on running trending temperature trials to observe how the system reacts and ensure algorithm consistency.

11/29/2016 Status Update

Goals:

This week will be more difficult to work on the project due to the holiday weekend and both members will be leaving the state. We hope to have the flow sensor calibrated and able to record the amount of water dispersed before the lab section on November 29. We would also like to have the clock triggering an alarm and begin making connections to the temperature sensor to setup the I2C connections required.

Work Completed:

Adam:

  • Soldered temperature sensor breakout board in order to interface with PIC.
  • Setup PIC connections, and began working on getting the I2C communication up between the PIC and sensor. Updated schematic.
  • Designed preliminary FSM for watering sequence. Wrote the C code, as well as default values used throughout watering process.

Christer:

  • Setup voltage regulator to work with the flow sensor. Provides 9 V power to the sensor and scales the output down to 3.3 V.
  • Attempted to use Input Capture to read the pulse signal from the flow sensor. Realized that this would not work with the application we are trying to use it for. Are using comparator now to count the number of pulses we receive.
  • Updated schematic to include voltage regulator and flow sensor.

Current Challenges:

I2C communication is still not fully understood. Working through example code supplied by Sparkfun to get the sequence of packets used retrieve data from the temperature sensor. Another challenge we are currently working through is the flow sensor, and getting an accurate count of the pulses it outputs. This has been difficult due to the transitions, and the idle state of the flow meter, which is seems to toggle between an output high and low.

Upcoming Goals:

We would like to finalize the FSM we are developing now to determine how we are moving through the watering sequence. The largest contingency on this is how we are determining the optimal watering time based on temperature. We will come to a conclusion on this and Adam will continue to frame the FSM for our final design. Christer will finalize the comparator and be able to record the number of pulses output from the flow sensor that will directly translate to the amount of water being passed through the system. We will both be working on the I2C communication for the temperature sensor as we both will be executing this for the first time.

11/22/16 Status Update

Goals:

We will begin interfacing the PIC with the moisture sensor over I2C to attempt to create a connection as we have never used I2C before. Adam will be looking at this part while Christer will be working with the flow sensor and looking over the specifications for communicating with the PIC. If the connection can be made and data transmission occurs, we will then put water through the flow sensor and attempt to record some data.

Work Completed:

Adam:

  • Configured LCD screen to input/output touchscreen positions serially (we did this with parallel configuration in previous labs). Recalibrated touch positions.
  • Created FSM and button on LCD so solenoid valve may be actuated. This should ease the troubleshooting of the flow meter setup.
  • Added additional circuitry to power transistor. The optoisolator from Lab 4 is now used to further protect the PIC.
  • Tested the toggling of the solenoid valve; found to work properly. Problem with overheating of power transistor seems to be gone.
  • Soldered pins to Soil Moisture Sensor, got ribbon cable prepped so we can begin interfacing with PIC.
  • Interfaced the Soil Moisture Sensor with the PIC, was able to read and store values read in with the ADC. Tried to calibrate values to extremes, as well as a watered plant found on the 4th floor. If I consider open air as “0%” the sensor reads “11”, and submerged in water “100%” moisture, the sensor read “75”. When stuck in the plant (which I could tell had been watered recently) the sensor read 30. This was approximately the 40% moisture reading we were seeking. Also set the PIC up to only power the sensor when taking a reading with the toggle of a button. This will slow down the corrosion of the sensor (recommended by SparkFun).
  • Created schematic of design thus far, including PIC pins used (physical/mapped) as well as external circuits. This will help in the future when we need to interface additional sensors.
  • Added the oscillator crystal to our design, and updated the schematic. Verified accuracy by enabling the output pulse on physical pin 7 of the PIC. Initially had an error of roughly 5%. This was corrected by being more careful with the placement of the crystal on the board, and the ground I used. By bridging the clock pins directly, and grounding to the PIC itself, was able to reduce error to roughly 0.00007% (when measured on the oscilloscope). Also created an initClock() function, which enables and starts the clock, based on #define values at the top of our program. These are user configurable so an accurate set time/date is made. The current time and date are displayed on the LCD. Attempted to set the Chime feature up, but was not successful.

Christer:

  • Extended the leads to the flow sensor so when mounted to the tank, the board with PIC could be stored elsewhere.
  • Drilled mounting points for the system underneath the tank. Our current thought was to secure the system with zip ties. If these are not strong enough, we will likely find brackets that we can use for mounting.
  • Assembled the 9 to 3.3 V voltage regulator. Looked at the documentation online and located resistors and capacitors and was able to correctly step down to the desired 3.3 V that will be read from the flow sensor. The system did begin to overheat and will debug the circuit in lab time.
  • Assisted Adam in connecting the solenoid onto the board and toggling it with a voltage source. We determined the issue was the power transistor as we believe we created a short circuit previously that fried the chip. This was replaced and the system functioned as expected.

Current Challenges:

Our main challenges at the moment include: communicating through I2C with the temperature and humidity sensor, determining if hysteresis is necessary for the flow sensor, and creating an alarm using the real time clock peripheral. Christer will be working on interfacing with the flow sensor while Adam will begin communicating with the temperature monitor.

Upcoming Goals:

This week will be more difficult to work on the project due to the holiday weekend and both members will be leaving the state. We hope to have the flow sensor calibrated and able to record the amount of water dispersed before the lab section on November 29. We would also like to have the clock triggering an alarm and begin making connections to the temperature sensor to set up the I2C connections required.

11/15/16 Status Update

Goals:

Our goals for this week were:

  • Order, receive parts
  • Acquire and build test set-up
  • Begin build of circuit components for interfacing with peripherals

Work Completed:

This week we submitted our Design Proposal, as well as ordered and received our parts. We were also able to locate a bucket that we believe will serve as our test reservoir, that already had some of the fittings needed to mount of valve and flow meter on. Over the weekend, we continued to assemble the test reservoir, and acquired the necessary PVC components to finalize the mounting of the valves.

Adam got the solenoid valve working and powered using the wall adapter and power transistor. We will now be able to interface with the PIC. Additionally, the DC provided to the solenoid valve will be used to provide the necessary voltage to the flowmeter.

Current Challenges:

As of now, neither of us have used I2C before, so interfacing and communicating with our temperature and humidity sensor we believe will be a challenge for us both. We hope to get this protocol completed soon, as acquiring this data will allow us to begin implementing our temperature algorithm.

Upcoming Goals:

We will begin interfacing the PIC with the moisture sensor over I2C to attempt to create a connection as we have never used I2C before. Adam will be looking at this part while Christer will be working with the flow sensor and looking over the specifications for communicating with the PIC. If the connection can be made and data transmission occurs, we will then put water through the flow sensor and attempt to record some data.