CGRB Soil Sensor ================ Overview -------- -A small sensor board, in a similar form factor to the cricket sensor -Measures -Temperature -Ambient and at each soil moisture node -Humidity -Ambient (upward-facing) light level -Soil moisture at multiple levels (using capacitance, like cricket) -Each measurement region should be 2.5cm -Make different models with different measurement lengths (5cm, 7.5cm, 10cm, 12.5, 30cm) -Put a cm scale on the silkscreen to measure soil depth -Communicates over RS-485 on 4-wire RJ-11 pigtail -Terminated at master and a single point at the end -The network should be arranged as a line or a trunk with short stubs. -Sensors are daisy-chained on a common bus and are addressed by a single master -Sensors only answer when addressed -Each sensor has its own unique, immutable ID from the uC -Small LED on top for identification (send a command and the LED blinks). Mechanics --------- -Should be water-resistant -The soil temperature sensor will need to be encapsulated -Use a small leadless package. -This looks like a suitable sealant: http://www.digikey.com/product-detail/en/DP270-BLACK-50ML/3M6435-ND/1306146 -Proper dispensing system: -Mixing nozzles: http://www.digikey.com/product-detail/en/62-9171-9153-8/3M6460-ND/1765725 -Gun: http://www.digikey.com/product-detail/en/9740/3M6431-ND/1306142 -Mechanical part numbers -Solder Paste: SMD291SNL-ND -Epoxy: 3M6435-ND Black, 3M6432-ND Clear -Wrong Heatshrink: jfdlkjfdsaEPS2112-R5-ND -Copper tape (for shielding): 3M11331-ND -Kapton tape (goes below copper tape): 3M10232-ND Electronics ----------- -Moisture sensors -Capacitive pads used on this device will be smaller than those on the cricket. -Using pads on both sides of the board might increase sensitivity. -Traces should be run down from both sides, as vias would be vulnerable to corrosion. -The uC will manually discharge the peak detectors by driving the ADC pins low. -Light Measurement -Charge capacitor, measure time it takes for the photodiode to discharge it. -Protection -RS-485 -bi-directional 12V standoff TVS from each line to ground. -Power -Put a zener/shunt regulator across the supply, to prevent overvoltage damage -Also provides reverse polarity protection -Transmission -Power -24 AWG or larger wire should be used for long runs. -Around 85mA required during transmission of data on the bus Tools ----- -AVR programming bridge -USB<->Sense/Net Bridge -Use DTR line to control transmission -Pogo pin jigs New Bus Protocol ---------------- -Delineate packets with special characters, not time. -Two special characters: packet end (0x04), escape (0x1B) -Placing escape before a non-special character is still valid; escape just disables recognition of special characters for the next character -Escape is placed before literal end and escape characters, removed transparently upon reception -Same packet structure: -header (1 byte) -node id (9 bytes) -data size (1 byte) -data (0-128 bytes) -crc (2 bytes) -During enumeration, check the receive buffer while sending data. If sent and received don't match, backoff and resend. -Sense/Net interface state machine -Getting bytes -If no space in buffer clear buffer -If escape flag not set -If escape set escape flag -If end process packet -else deposit in buffer and clear escape flag -Process Packet -Check CRC If not good, reset buffer and goto getting bytes -Compose response goto sending -Else clear buffer goto getting bytes -Sending for each character in buffer: If special send escape character Send character If last character send end goto getting bytes -Enumeration Waiting -compose packet -randomly select time slot -when time slot occurs, goto Enumeration Sending -Enumeration Sending -send packet -while sending packet, check received bytes -if mismatch, select random delay and goto backoff -Backoff -Wait until delay expires -goto enumeration sending Rev. 1 Issues ------------- ✓Silkscreen too close to pads, causing it to be clipped ✓2 and 4 capacitors ✓RS-485 transceiver ✓1206 (on usb bridge) ✓quad diode ✓xtal ✓quad resistors ✓outer edges of led ✓sot323 ✓xfn-4 ✓Humidity sensor footprint a bit large ✓Values not printed with OSHPark brd processing ✓LED footprint is wrong ✓No pin 1 ref. on WLCSP6 ✓Too much solder paste on center pad of humidity sensor. ✓Too much solder paste on center pad of RS-485 transceiver. ✓Zener diode and capacitor are very close to the edge, which may result in a large force from the heat-shrink tubing. ✓Consider removing solder mask around soil temp sensor, to improve epoxy adhesion. ✓1-wire EEPROM unnecessary, as atmega88 has an internal unique ID -Full-swing crystal oscillator doesn't work, but low-power mode does. ✓5V TVS too small ✓WLCSP paste apertures too small; update footprint. -RJ12 jack programming is not necessary; use smd pogo pads instead. ✓LED far away from board edge ✓Epoxy may be necessary over the whole sensing area; gravel easily cuts through the solder mask. ✓On the other hand, each device costs only $20. -USB Bridge - Need connection to DTR, not RTS Rev. 2 Issues ------------- ✓Humidity position above soil legend incorrect. ✓Need more heatshrink margin ✓Try to find a metal can to replace copper tape. ✓Add a photodiode for light sensing ✓Need soil sensors at each moisture measurement node Rev. 4 Issues ------------- ✓Web underneath cable bend too large ✓1nF light capacitor too small (change to 10nF) ✓Choose specific capacitor model for light capacitor ✓Move to surface-mount pads for cable? ✓Use two-pin control of transceiver; this will allow real collision detection during enumeration Checklist --------- TODO ---- Testing Regime -------------- -Accelerated Aging (3 units) ->=1 week in 60C chamber -ideally, humidity could be varied -Tests for corrosive residues left after soldering -Thermal cycling (3 units) ->=100 cycles from -10C to 60C, with at least 10 minutes at each extreme -Tests for solder joint and mechanical robustness -Soil insertion ->=50 insertions into soft and hard soil -Tests for strength and robustness of soil temp sensor encapsulant -Hot Swap Tests (1 unit) -100 insertions/removals (simulated by relays) -Device must experience no damage and not drive garbage onto the bus -Signal integrity -TODO: Define many devices, long distance, and transient tests -Soil Moisture -Need to calibrate and test for variations between units and with temperature