( 7. TROUBLESHOOTING :: TROUBLESHOOTING :: TROUBLESHOOTING ) Page -39-


Ag Irrigation Remote Control

Using Arduino-UNO and Digi-Xbee RF



Written By: Thomas G (01/2017)

Feel free to use: no strings attached (text content only / images respectfully referenced)

Last Updated: 2017.06.30






1.INTRODUCTION


The “Ag Irrigation Remote Control project's goal is to provide Radio Frequency (RF) remote control and monitoring abilities to an Agriculture-Industrial 3-Phase 480VAC Irrigation Pump that is typically used in wheel-line and hand-line irrigation setups within the United States.




A.Signal Strength ( 2-Miles )







B.Features




2.INSTALLATION INSTRUCTIONS


This section is a guide to installing the Pump-Controller using the Installation Kit. If these products were not purchased they can be built by following the #4.BUILDING INSTRUCTIONS|outline listed in this document.


  • Installation will require the following SUPPLIES

    • Pump-Controller
      • The white box shown on the right in the picture above
      • Including the attached Antenna, Cable and 4-pin plug ending

    • Installation Kit ( Including the following items )
      • A 3-Phase Power Supply attached to a DIN rail
        • 480VAC Input to 24Vdc Output
      • A Solid State Relay (SSR) attached to a DIN rail
        • 480VAC ( or higher ) Load Voltage and 5Vdc Input
      • 12-feet of RED 600V 16-Gauge or heavier THHN or MTW wire
      • 4-feet of GREEN 600V 16-Gauge or heavier THHN or MTW wire
      • A Pump-Panel Exit Cable
        • A 4-pin plug ending attached to (3) 4ft 600V rated wires
          • Yellow plug wire → Orange Hookup wire (+Vdc)
          • Black plug wire → Brown Hookup wire (-Vdc)
          • White plug wire → Blue Hookup wire (SSR-Control)
          • Green plug wire → Unused ( None )
      • (2) #8-32 x 1/2” Machine Screws
      • (1) Wood screw for mounting the Pump-Controller to a pole
  • Installation will require the following TOOLS
    • Personal protective gear ( e.g. insulated/flash protection clothing )
    • Voltmeter - that reads up to or beyond 500VAC
    • Cordless drill
    • Wire strippers and cutters
    • #1 Phillips and #1 Flat head screw drivers
    • Center Punch
    • #29 ( 9/64” ) Drill Bit
    • #8-32 Threading tap

A.Electrical Panel Introduction


Read through the following section to gain general knowledge on the items within the pumps electrical panel.

Most 3-phase irrigation pumps that do not have variable frequency drives(VFD) or inverters are setup similarly. Below is the details of a pumps electrical panels as an example or reference to the pumps power circuit. This information was gathered to determine the wiring and power needed to control the pumps power.






When HAND is selected the “control circuit” ( L1 → L2 loop ) is still open until the Start Button is pressed. When the Start button is pressed it activates the (M) Activation Coil which in-turn activates the “Hold Contact” ( the --| |-- in parallel to the Start Button). This right-side contactor holds the “control circuit” closed until there is a power failure bump or the Hand-Off-Auto Switch breaks open the circuit loading the (M) activation coil.

This Projects SSR-Relay will be connected where the “Pressure Switch” is shown in this wiring diagram and will use the AUTO switch selection. This setup will require that the Arduino NOT re-activate power after a power failure has occurred until a specified time delay or turned back on. The click in HAND circuit is setup so the power company can re-activate power after a power failure without the over-load of all motors kicking on at the same time.




B.DIN-Rail Mounting


BE SURE THE MAIN BREAKER IS TURNED OFF AND CAREFULLY CHECK THAT THERE IS NO VOLTAGE ON THE OUTPUT OF THE MAIN BREAKER WITH A PROPER METER!!! 480VAC is deadly; and can cause severe flash burn and/or death. (e.g. A meter on the wrong setting can “flash” explode causing “flash” burns on you even at a distance away). I DISCLAIM ANY AND ALL RESPONSIBLITY FOR ANY RISKS, HARMS, INJURIES OR PROPERTY DAMAGE THAT WAS A RESULT OF FOLLOWING ANY INSTRUCTION IN THIS MANUAL.
See https://www.youtube.com/watch?v=6hpE5LYj-CY

  1. Check your volt meter
    1. Before leaving to install; check that your volt meter is working by plugging it into a household outlet ( Use the same setting >500 VAC )
    2. Make sure the probes are plugged into their correct spots on the meter
    3. Do not make any more changes to the volt meter after testing its correct operation.

  1. Follow safe practices
    1. Never turn ON the main breaker with the panel open
    2. Never stand in front of the panel while turning on the main breaker ( flash explodes will often blow the front panel clear off ) - stand at the side
    3. Never work in the same side of the box where the live wires ( feed wires ) exist – generally at the top of the box
    4. Always stand as far away as you can

  1. Prepare for Installation
    1. Switch the Main Breaker to OFF from the outside of the pumps electrical panel
    2. Open the pumps electrical panel
    3. Double check your voltmeter setting – Never measure for 480VAC with a lower setting; it will cause many meters to flash explode
    4. With leather gloves on, very carefully making sure not to wiggle the probes out of place, measure the following voltages
      • From the bottom of the Main Breaker; Measure voltage between each of the 3-connectors ( They should all be 0V)
      • From the bottom of the Main Breaker; Measure voltage between each of the 3-connectors and the ground metal of the electrical panel ( 0V )

  1. Plan a location inside the Electrical Panel for the Power Supply and SSR mounted on the DIN rail
    1. Requires approximately a 6” Wide x 6” Tall x 6 1/2” Deep envelope
    2. Find a location as far away from other hot wires as possible ( eliminate the risk of a loosened wires falling and touching a low-voltage wire )
    3. Preferably a location at the bottom of the box where the exit plug can quickly drop out of the box.

  1. Mount the DIN Rail
    1. Hold the DIN Rail in the desired location and punch the metal through easily accessible mounting slots in the DIN Rail on both ends
    2. Drill two holes in the punch markings ( Bit Size #29 – 9/64” - 0.1360” )
    3. Tap-thread the two holes just drilled ( #8-32 threading tap )
    4. Hold the DIN rail in place and fasten it with (2) #8-32 machine screws

  1. Attach ( If taken off ) the Power Supply and Solid State Relay to the DIN Rail



C.Pump Panel wiring


NOTICE: All wiring in this section should be done with 600V rated wire


  1. Wire the 480VAC 3-Phase Power Supply attached to the DIN Rail

    1. Using RED wire; connect Power Supply Terminals L1, L2, L3 to the top terminals of the Contactor ( i.e. Starter / Hammer ) L1, L2, L3 terminals
      • Often this is easiest to do by wiring to a “Motor Saver” unit that is already wired to L1, L2, L3 if your panel has one

    1. Using GREEN wire; connect Power Supply Ground () to a bolt or terminal connected to the panels back-plane

  1. Wire the Solid State Relay attached to the DIN Rail
    1. Using RED wire; connect Solid State Relay (15) → AUTO Terminal of the HAND-OFF-AUTO switch ( Typically the only unused terminal )
    2. Using RED wire; connect Solid State Relay (16) → OPPOSITE side of the start button as the wire from the HAND-OFF-AUTO to the Start Button

  1. Wire in the Pump-Panel Exit Plug
    1. With the Plug end of the Exit Plug outside the box; insert the wires through a bottom hole in the Pumps Electrical Panel
    2. Connect the
      • Orange wire → 24Vdc(+) of the Power Supply
      • Brown wire → 24Vdc(-) of the Power Supply
      • Blue wire → (A1)+ of the Solid State Relay
    3. Verify that a BROWN wire already exists from 24Vdc(-) of the Power Supply → (A2)- of the Solid State Relay

  1. Close the Electrical Panel – Panel Control installation is now complete
    1. Wait until after installing the Pump-Controller before turning the breaker back on.

D.Pump-Controller


  1. Plug the Pump-Controller into the Exit Plug installed in the steps above.
  2. Attach the Pump-Controller box to the power pole using a wood screw at the desired height up the pole.

E.Testing


  1. Turn the Electrical Panel Breaker ON.

  1. Switch the Hand-Off-Auto switch to AUTO.

  1. Using the Hand-Remote Device
    1. Find the Menu-Item “Power” for the Pump-Controller Device just installed
    2. Press (→ ) to 'SET->' and then UP/DOWN to set to ON
    3. Press the square 'Enter' button – The pump should start running
    4. While still on the “Power” Menu-Item; Press (→ ) till 'SET->' and then UP/DOWN to set to OFF
    5. Press the square 'Enter' button – The pump should shut off

3.OPERATING INSTRUCTIONS


A.Introduction


The Hand-Remote display has a Top Row and a Bottom Row








B.Display Table






SUB-FUNCTIONS ( ← LEFT || RIGHT → )

Location


Device

MENU ITEMS

(=)

Up/Down Items

ENTER to refresh

SET

(→)

Up/Down Changes

ENTER to Apply

LOW ALARM

(=!) (<!)

Up/Down Changes

ENTER Toggles On-Off

HI ALARM

(ǂ!) (>!)

Up/Down Changes

ENTER Toggles On-Off

Wire to PIN

( NOT for Display )


Menu-Items ( ← UP || DOWN → )

Hand-Remote

Battery(B)

DISABLED

(<!) When less than

(>!) When greater than

A1

Ditch Pump

Power(P)

(SET→) On

(SET→) Off

(=!) Equals “On”

(=!) Equals “Off”

(ǂ!) Not Equal “On”

(ǂ!) Not Equal “Off”

D7

Ditch Pump

Water (L)

DISABLED

(<!) When less than

(>!) When greater than

V64(Trig=D4,Echo=D5)

Ditch Pump

Pressure(R)

DISABLED

(<!) When less than

(>!) When greater than

A3

Canal Pump

Power(P)

(SET→) On

(SET→) Off

(=!) Equals “On”

(=!) Equals “Off”

(ǂ!) Not Equal “On”

(ǂ!) Not Equal “Off”

D7

Canal Pump

Pressure(R)

DISABLED

(<!) When less than

(>!) When greater than

A3

Canal Pump

Pressure(S)

DISABLED

(<!) When less than

(>!) When greater than

A4


* Note: V64 is Virtual Pin #64; Virtual Pins are memory spaces inside the Pump-Controller and therefore the Pump-Controller firmware actually identifies the connecting pins. This is used when Pump-Controller processing is done before a legitimate value can be determined.

C.Alarms








4.BUILDING INSTRUCTIONS


This section shows how the Hand-Remote, Pump-Controller and Installation Kit are built. It can be used to build your own setup by purchasing the individual pieces and assembling them yourself. It can also be used for troubleshooting problems or issues that may arise.

4.1Bill Of Materials (BOM) = $233


For a per device itemized listing see #4.2.Hand-Remote ( $69.58 )|outline, #4.3.Pump-Controller ( $82.05 )|outline or #4.4.Installation-Kit ( $98.07 )|outline
Note: The itemized prices include the PLA plastic filament costs for 3D-Printing and thus adds up to $249.70 instead of $233.

A.Pump-Panel Components ( $91.50 )


(1) RHINO switching Power supply

320-600 VAC input, 3-phase

24 VDC output, 60W, 2.5A

35mm DIN Rail mountable


AutomationDirect.com ( $59.00/ea )

6” of DIN rail

Slotted, 35mm, 10 mm height

For mounting Power Supply and SSR of each Pump



AutomationDirect.com ( $8.00/2x 1-Meter Pieces )

(1) Solid state relay

3-32 VDC input

480VAC or higher SPST, N.O., SCR, 10A

35mm DIN-rail, Random type


AutomationDirect.com ( $24.50/EA )


B.Electronic Control ( $29.17 )


(2) UNO R3 Atmega328P Development Board with Male Pin Header and USB Cable


AliExpress.com ( $3.80/EA )

(1) for each HandRemote

(1) for each PumpController


(1) Keypad Shield Blue Back-light for

Arduino Robot LCD 1602 Board


AliExpress.com ( $2.19/EA )

(1) Display for each HandRemote

Wiki

Schematic

Layout

(2) Zigbee Shield RF Wireless Module

Expansion Board for Arduino Xbee


Aliexpress.com ( $2.20/EA )

(1) for each HandRemote

(1) for each PumpController

Schematic

Tutorial

(15) 2x Pin Plug-in Screw Terminal Block Connector

5.08mm Pitch External I/O connections


Banggood.com ( $2.15 / 20pcs )

(15) for each PumpController


(1) 2-PIN Male – Zigbee → Perfboard POWER

(1) 4-PIN Female – Perfboard → Zigbee POWER

(2) 6-PIN Male – Zigbee I/O → Perfboard

(1) 4-PIN Female - Zigbee->Perfboard RX/TX


Aliexpress.com ( $0.79 / 10pcs )

(2) Female, (2) Male for each PumpController

* Male Headers are part of Arduino Purchase *

(1) Black Snap-in On/Off Rocker Switch

Aliexpress.com ( $0.86 / 5pcs )

(1) for each HandRemote

(1) Active Speaker Buzzer Alarm


Aliexpress.com ( $0.60 / ea )

(1) for each HandRemote

(1) FR-4 Double Side 50cm x 70cm Prototype PCB Printed Circuit Board


Aliexpress.com ( $1.56/ 4pcs )

(1) for each PumpController

(2) Resistors

1 valued at 1/3 the other ( 10K-Ohms or higher )


Banggood.com ( $2.28 / 300pcs )

(2) for each HandRemote

(1) LM2596 Power Supply Output 1.5V-35V

DIY Part Modules

AliExpress.com ( $3.27/ 5PCS )

(2) #8-32 x 1/2” Machine Screws

(5) #2 1/4” Screws


BoltDepot.com (#2x1/4” $0.05/ea)

BoltDepot.com (#8-32x1/2” $0.05/ea)

( Total: $0.35 )

( ~10 ) Heat-Shrinking Tubes


AliExpress.com ( $3.12 / 328pcs )



C.RF Electronics ( $91.32 )


(2) Xbee-Pro 900Hp S3B Digimesh, 900Mhz, 250Mw, Rpsma Connector, 200Kbps


https://www.arrow.com/en/products/xbp9b-dmst-002/digi-international ( $39.00/EA )

(1) for each HandRemote and (1) for each PumpController

(2) Antenna Helical 3dB Gain 900MHz


https://www.arrow.com/en/products/w1063/pulse-electronics-corporation ( $6.66/ea )

(1) for each HandRemote and (1) for each PumpController


D.Wire & Connectors ( $30.72 )


(~10-feet) 24-AWG Data Cable

Outdoor direct burial wire

Suggest Cat5e


Amazon.com ( $11.50 / 50ft )

Enough to connect all accessory/power devices to the Pump-Controller



( 25-feet) 600V 14AWG THHN or MTW Black or Red wire

(~ 1-foot ) 22AWG Solid Core wire


HomeDepot.com( $6.47 / 25ft )

Enough to connect RHINO P.S., SSR and Exit Panel Plug

( ~ 1-foot ) UL 22AWG

Solid Core Hookup Wire


RadioShack.com ( $6.99 / 90-feet )



(1) Right-Angle 5.5x2.1mm Power Plug for Arduino Power

Aliexpress.com ( $1.76 / 2pcs )

Amazon.com ( $4.51 / 10pcs )



(1) 4-Way Trailer Lights Connector

Amazon.com ( $2.32 / ea )


5Pcs 150mm PP3 9V Battery Clip

BangGood.com ( $1.68 / 5pcs )


E.Tools Required ( $NA )





4.2Hand-Remote ( $69.58 )


The HandRemote is the portable remote control device used to control and monitor irrigation pumps remotely.

  • The following Supplies are needed to build a Hand-Remote

  • Total Price ( Per Hand-Remote ) = $69.58
    • (1) Xbee-900Hp S3B RF Module = $39.00
    • (1) 1” Black 22-Gauge Solid Core Hookup wire = $ 6.99
    • (1) 1” Red 22-Gauge Solid Core Hookup wire = Inc. Above
    • (1) RP-SMA High Gain Antenna = $ 6.66
    • (1) Arduino UNO R3 = $ 3.80
    • (83.8g) 3D PLA Plastic Filament ($0.03/cm3) = $ 2.82
    • (1) Zigbee Shield = $ 2.20
    • (2) Keypad / LCD Shield = $ 2.19
    • (2) Resistors ( 1 being 1/3 value of other ) = $ 2.28
    • (1) 9Vdc Battery Connector = $ 1.68
    • (1) On/Off Rocker Switch = $ 0.86
    • (1) Active Buzzer = $ 0.60
    • (4) #2x1/4” Screws = $ 0.30
    • (4) #4 x 1/4” or smaller screws = $ 0.20
  • The following Tools are needed to build a Hand-Remote

    • 3D-Printer with PLA Filament
    • Soldering Iron & Resin Core Solder
    • Wire Cutters / Dikes / Strippers
    • Needle nose pliers

4.2.1Electronics Assembly




A.LCD Keypad Shield


  1. Wire the Battery-Voltage-Divider Resistors
    1. Select (2) Resistors ( 10K-ohm up to 2M-ohm values are recommended; Arduino A1 will draw 1.6nA )
      • R1 = Larger Value Value for R1 Used = ________________
      • R2 = 1/3 the Value of R1 Value for R2 Used = ________________
    2. Solder the Resistors on the top side of the LCD Keypad Shield
      • R1 = VIN → A1
      • R2 = A1 → GND ( GND is at the Solder hole just left of VIN )
    3. Snip off the excess back-side leads

The two resistors setup a voltage divider from the 9Vdc battery (which we will attach to VIN). Analog inputs on the Arduino should never exceed 5Vdc. The voltage divider will split the battery voltage to 1/3 its actual voltage. This will allow the hand-remote to monitor the battery level. The larger the resistor values the less drain on the battery; but too-large a value resistors may affect accuracy.

  1. Remove the ICSP header pins on the LCD Keypad Shield
    1. Using Needle Nose pliers clamp onto an ICSP header pin on the front side of the Zigbee Shield
    2. Using Soldering Iron – Heat the solder side of the pin and pull the pin from the board
    3. Repeat steps for all remaining ICSP pins

  1. Plug the LCD Keypad Shield onto the Arduino UNO

B.Zigbee/Xbee Shield


  1. Remove Header Pins D7, D6, and D5 from the Zigbee Shield
    1. Using Needle Nose pliers clamp onto Pin D7 ( shown in picture on D7 ) of the back of the Zigbee Shield
    2. Using Soldering Iron – Heat the top of the pins solder pad and pull the pin from the board
    3. Repeat steps two more times for D6 and D5 ( moving left as D7, D6, D5 )

  1. Solder Zigbee Shield to the LCD Keypad ( Flipped upside down & with Arduino UNO attached to the LCD Keypad Shield )
    1. Insert Zigbee Shield pins D0 → D4 ( Remaining pins ) into LCD Keypad Solder Pin-holes D2→D6
      • Shifted towards center leaving 2-Pin-holes on the LCD Keypad open; as shown
    2. Position the Zigbee Shield flat with LCD Shield and Up against the LCD Shield – Requires bending the header pins a little
    3. Solder the Zigbee Shield pins to the LCD Keypad Shield

  1. Wire Power to the Zigbee Shield

    1. Flip over the assembly so the LCD Keypad Shield is backside and the Zigbee Shield is front side

    1. Using two 22-Gauge Solid Core wire ( Black & Red ) Connect the LCD Keypad Shields ICSP pin header power pads to the Zigbee Shield
      • Red wire = LCD-ICSP 5V+ pin ( closest to the Top; closest to the Blue Pot ) → Zigbee Shield ( 5V ) solder pad labeled as 5V
      • Black wire = LCD-ICSP GND pin ( closest to the Top; farthest from the Blue Pot ) → Zigbee Shield ( GND ) solder pad labeled as GND
      • Note: Be sure to solder these wire into the back-side of the LCD ( as shown ) else the wires will block the rocker switch

    1. The green jumpers on the Zigbee Shield should be in the USB position ( usually factory installed there ) the picture shows these in the wrong place.



C.Active Buzzer


  1. Solder Active Buzzer to LCD Keypad Shield

    1. Place active buzzer on edges of the Zigbee Shield as shown
    2. Solder the active buzzer pins ( S, +, - ) to the pins as shown
    3. The LCD Keypad pins ( D12, D13, and GND ) are determined according to the markings on the connected Arduino UNO.
      • 'S' pinD12
      • '+' pinD13
      • '-' pinGND

  1. Test the Assembly

    1. Plug the Xbee Module into the Zigbee Shield

    1. Plug in the USB cord to the Arduino UNO and verify
      • The LCD screen lights
      • The LED on the Zigbee Shield next to the word “ASSOCIATE” is blinking

    1. Upload the Test.ino Firmware
      • Check that the buzzer sounds after upload ( a key-press will silence the buzzer )
      • Check that the LCD Keys work by scrolling the menu
      • Check the “Battery” meter – It should not read either 0 or 1023

4.2.2Hardware Assembly

A.3D-Prints ( $2.82 )


HandRemote-Case.stl ( 62g )

HandRemote-BackCover.stl ( 23g )

HandRemote-BatteryCover.stl ( 4g )

HandRemote-BatteryInsulatorPlate.stl ( 2g )

HandRemote-SideCover.stl ( 2.5g )

HandRemote-Buttons.stl ( 1g )


B.Install Electronics


  1. Insert the Power ON/OFF Rocker Switch into the front of the case

  1. Place the buttons in their proper place inside the case; using masking tape on the front-side to hold the buttons in their place


  1. Install the LCD, Buzzer, Zigbee Electronics Assembly into the Case ( Arduino UNO Removed )
    1. Insert (4) 10mm or shorter screws – adjust tightness making sure the buttons still click ( too tight will pinch buttons down permanently )

  1. Plug the Arduino UNO back onto the LCD Keypad Shield

  1. Attach the Antenna to the Xbee RPSMA Connector

C.Wire in Battery Power


  1. Install Plugs
    1. Insert the HandRemote-BatteryInsulatorPlate.stl 3D-Print inside the battery hole
    2. Route the 9Vdc Battery Power Plug from the front, around Zigbee shield, to the back

  1. Wire in the Switch and Power to the Arduino UNO
    1. Solder the Black wire to the closest to UNO power-jack backside pin ( as pictured )
    2. Leaving an inch-or-so slack on the 9VDC plug; measure and cut the Red wire on the closest rocker-switch connector
    3. Strip the end and solder the wire to the rocker switch connector
    4. Strip the end of the cut left-over red wire and solder it into the “other” connector on the rocker-switch
    5. Solder the other end of the cut left-over red wire wire to the farther to UNO power-jack backside pin ( as pictured )

  1. Check for Power
    1. Plug in a 9V-Battery into the 9V plug
    2. Flip the rocker-switch to power-on ( marked with a “-” ) and verify that the LCD display lights

  1. Attach Covers to Case
    1. Insert the HandRemote-BatteryCover.stl 3D-Print into the cases battery-hole and snap down
    2. Slide the HandRemote-BackCover.stl 3D-Print in from the bottom then insert a screw in the bottom-center
    3. Slide the HandRemote-SideCover.stl 3D-Print in the USB side until it snaps into place



4.3Pump-Controller ( $82.05 )


The Pump-Controller is the irrigation pumps control device mounted next to the pumps electrical panel.


  • The following Supplies are needed to build a Pump-Controller

  • Total Price ( Per Pump-Controller ) = $82.05
    • (1) Xbee 900Hp Pro S3B RF Module = $39.00
    • (1) RP-SMA High Gain Antenna = $ 6.66
    • (1) Arduino UNO R3 w/Male Headers = $ 3.80
    • (1) LM2596 - 24Vdc to 9Vdc Step-Down Buck Converter = $ 3.27
    • (1) Zigbee Shield = $ 2.20

    • (10') Outdoor Burial data cable = $11.50
    • (95.2g) 3D PLA Plastic Filament ($0.03/cm3) = $ 3.87
    • (~12) Heat Shrinking tubes = $ 3.12
    • (1) 4-Way Trailer Lights Plug = $ 2.32
    • (1) Right-Angle 9VDC Power Plug = $ 1.76
    • (1) #2x1/4” Screw = $ 0.05

    • (1) 50x70cm Perfboard = $ 1.56
      • (9) Screw Terminal Blocks = $ 2.15
      • (2) 2-PIN or 4-PIN Female DuPont Pin Headers = $ 0.79
      • (2) 3-PIN or 4-PIN Female DuPont Pin Headers = Inc. Above
      • (2) 6-PIN Male DuPont Headers ( Included with Arduino Uno )
      • (1) 2-PIN Male DuPont Header ( Included with Arduino Uno )
      • (18”) 22 Gauge Solid Core Hook-up wire ( listed with Hand-Remote )



  • The following Tools are needed to build a Pump-Controller

    • 3D-Printer with PLA Filament
    • 24Vdc Desktop Power Supply
    • Soldering Iron & Solder
    • Wire Cutters / Dikes / Strippers
    • Small flat screw driver

4.3.1Electronics Assembly



A.3D-Prints ( $0.20 )


PumpController-PerfboardCover.stl ( 6.3 cm3 )


B.Perfboard Assembly


  1. Prepare Female DuPont Headers

    1. If using a 4-PIN instead of 2-PIN Female DuPont Connector; Remove the outer pins on one 4-PIN female header ( POWER )
    2. Using a 4-PIN Female DuPont Header; Remove every other pin -OR- Using a 3-PIN Female DuPont Header; Remove center pint ( RX/TX )

  1. Install Headers

    1. Remove the (2) Green Jumpers on the Zigbee Shield
    2. Plug the Zigbee Shield onto the Arduino UNO
    3. Plug a 6-PIN Male Header into the Analog Header of the Zigbee Shield ( A5 → A0 )
    4. Plug a 6-PIN Male Header into the Digital Header of the Zigbee Shield ( D2 → D7 )
    5. Insert the POWER female header from step #1.a into the Zigbee Shield holes labeled 5V & GND ( next to the reset button )
      • Plug a 2-PIN Male Header into the top of the POWER female header
    6. Insert the RX/TX female header from step #1.b ACROSS the two center male headers (XBEE/USB) pins of the Zigbee Shield

  1. Solder the header pins to a 5cmx7cm 2.54mm pitch Perfboard

    1. Align and place the Perfboard onto the header pins so that the Perfboard edges match the Arduino Uno edges
    2. Solder the header pins to the Perfboard

  1. Solder the Zigbee female POWER header pins

    1. Unplug the Arduino UNO from the Zigbee Shield leaving the Perfboard attached
    2. Solder the female POWER header pins to the holes of the Zigbee shield

  1. Add wires to the header pins
    1. Cut (10) wires approximately 1” long and strip one end.
    2. Cut (2) wires approximately 3” long and strip one end.
    3. Gather (2) Pulled male pin headers ( from ICSP Hand-Remote ) or two more 1” wires

    1. Attach (2) Pin Headers or Small wires from the Top-side of the Perfboard across RX/TX female pin headers and solder to D2, D3 Digital pins
    2. Unplug the Perfboard from the Zigbee Shield
    3. Insert (6) 1” wires from the Zigbee-side of the Perfboard into the holes just below the analog male pin headers, bend and solder
    4. Insert (4) 1” wires from the Zigbee-side of the Perfboard into the 4-right (D4-D7) holes just above the digital male pin headers, bend and solder
    5. Insert (2) 3” wires from the Zigbee-side of the Perfboard into the right of the POWER male pin headers ( Center-2 ), bend and solder

  1. Install the Screw Terminals
    1. Place the HandRemote-PerfboardCover.stl 3D-Print on the top of the Perfboard
    2. Insert (3) 2x Screw Terminals sliding the blocks together at their edges
    3. Insert (2) 2x Screw Terminals along the Digital section with the same method above
    4. Insert (2) 2x Screw Terminals along the 5VDC section ( same as above )
    5. Insert (2) 2x Screw Terminals along the GND section ( same as above )
Note: If drilling out the holes is required; drill from the soldering side as to not dismount the solder-to pads

  1. Solder the Screw Terminals to their corresponding header wires
    1. Turn the Perfboard over holding the screw terminals into place
    2. Sold each screw terminal pin to the Perfboard
    3. Pull the Insulation off the wires, bend them flat with the Perfboard and solder them to their corresponding pin ( See picture or Wiring Diagram )

4.3.2Hardware Assembly


A.3D-Prints ( $3.87 )


PumpController-Case.stl ( 98g )

PumpController-Cover.stl ( 25g )

PumpController-AntennaCover.stl ( 1g )

PumpController-XbeeInsulatorPlate.stl ( 1g )

PumpController-CableClampCover.stl ( 3g )

PumpController-CableClampCover-2HoleInsert.stl ( 1g )

B.Install Electronics


  1. Install UNO and Zigbee into the Case
    1. Remove the Screw Terminal Perfboard if attached and connect the Arduino UNO & Zigbee Shield
    2. Insert the Uno/Zigbee assembly into the case letting the USB and power Jack sit on each side of the case stub.

  1. Install the XBEE module
    1. First slide the XBEE RPSMA Connector into the case slot
    2. Then lift the XBEE module into to place and plug it into the Zigbee Shields Xbee plug-in

  1. Install the Xbee Antenna Cover
    1. Slide the AntennaCover.stl 3D-Print onto the RPSMA connector from the outside of the case

    1. Attach the washer and nut and tighten

C.Install Cable


  1. Wire the LM2596-DC-Converter Module to one end of the cable

    1. Cut a 10' length of Outdoor data cable with 3 or more leads
    2. Strip off the outer insulation of one end

    1. Cut a 10' length of Outdoor data cable
    2. Strip off the outer insulation of one end approximately 4” back
    3. Strip off the ends of the Orange and Brown twisted pairs just enough to fit in the LM2596 solder holes


  1. Wire the Right-Angle 5.5x2.1mm DC Power Plug to the LM2596-DC-Converter Module

    1. Cut the Right-Angle DC Power plug cords length to approximately 3”
    2. Strip off the outer insulation approximately 1” back
    3. Strip off the ends of the Red and Black wire just enough to fit in the LM2596 solder holes


  1. Adjust the LM2596 Module to produce 9Vdc from 24Vdc

    1. Clip on a 24Vdc+ desktop power supply to IN+ and IN-
    2. Attach a Voltmeter to OUT+ and OUT-
    3. Adjust the Blue Pot till the measured voltage is 9Vdc on OUT+ and OUT-

  1. Attach the Male end of the 4-way Trailer Lights Connector to the other end of the cable ( Female end used in #4.4.1.2.Pump-Panel Exit Cable|outline )

    1. Cut the male end of the 4-way connector wires leaving about 1” of Wire from the plug
    2. Strip all the wires back about 1/4”
    3. Slide on heat shrinking tube for each wire and the bundle of wires

    1. Solder the following Cable pairs to the connector
      • Blue twisted pair to the White connector wire
      • Brown twisted pair to the Brown connector wire
      • Orange twisted pair to the Yellow connector wire
      • Green twisted pair to the Green connector wire

  1. Install the Cable into the Pump-Controller Box

    1. Insert the cable into the CableClampCover.stl 3D-Print and insert it with the LM2596 Module into the Case as shown
    2. Insert the CableClampCover-2HoleInsert.stl into the open holes of the CableClampCover.stl
    3. Plug the Power Plug plug into the Arduino UNO
    4. Slide the CableClampCover.stl into the slot provided by the case as shown

  1. Attach Perfboard and Wire to Cable
    1. Place the XbeeInsulatorPlate.stl 3D-Print over the Xbee Module ( Protects it from shorting against the Perfboard )
    2. Carefully plug the Perfboard back onto the Zigbee Shield
    3. Strip the ends of the BLUE/GREEN twisted pairs of the Cable and connect them to the Screw Terminals
      • BLUE twisted pair to D7
      • GREEN twisted pair to D6







4.4Installation-Kit ( $98.07 )


The Installation-Kit is the items that will be used to control the irrigation pump inside the pumps electrical panel.

  • The following Supplies are needed for an Installation-Kit

  • Total Price ( Per Installation-Kit ) = $98.07
    • (1) RHINO 480V 3-Phase to 24VDC Power Supply = $59.00
    • (1) 600VAC Solid State Relay N.O. Random = $24.50
    • (25-feet) 600V Wire 14AWG THHN or MTW wire = $ 6.47
    • (6”) DIN Rail ( Sold in 1-Meter / (3) ) = $ 8.00
    • (2) #8-32 x 1/2” Machine Screws = $ 0.10
    • (1) Wood screw
    • (1) 4-Way Trailer Lights Connector ( listed with Pump-Controller )
    • (~4) Heat Shrinking Tubes ( listed with Pump-Controller )

  • The following Tools are needed to create an Installation-Kit

    • Soldering Iron & Resin Core Solder
    • Wire Cutters / Dikes / Strippers

A.DIN Rail & Components


  1. Prepare Din Rail

    1. Cut a section of DIN Rail 6” long
    2. Attach the Power Supply Unit
    3. Attach the Solid State Relay (SSR)

  1. Add Hook-Up Wires to the Solid State Relay (SSR)

    1. Run a 600VAC 14-Gauge BROWN wire from 24VDC(-) on top of the Power Supply to A1 of the Solid State Relay
    2. Attach a 4-foot long stretch of 600VAC 14-Gauge RED wire from SSR (15); Installs later to the AUTO selector switch
    3. Attach a 4-foot long stretch of 600VAC 14-Gauge RED wire from SSR (16); Installs later to the Contactor Activation Coil

B.Pump-Panel Exit Cable


  1. Create the Pump-Panel Exit Cable that will exit the Pumps Electrical Panel and plug into the Pump-Controllers cable.

    1. With the Female end of the 4-way Trailer Lights Connector ( Male side used in #4.3.2.3.Install Cable|outline )
      • Cut the wires approximately 1” from the plug
      • Install Heat Shrinking tube to the wires
      • Strip and Solder the plug wires
        • White plug wire to 4-feet of Blue 600V 14AWG wire
        • Brown plug wire to 4-feet of Brown 600V 14AWG wire
        • Yellow plug wire to 4-feet of Orange 600V 14AWG wire
        • Leave the Green wire snipped at the end ( It is not used but may connect to an auxiliary contactor later )

C.Miscellaneous Items



5.SYSTEM SETUP



5.1Adding Expansions


  1. Follow the steps in #5.2.Uploading Firmware|outline to Step #4 for the Hand-Remote firmware; Hold off on Step #5; “Compile & Upload”

  1. Once the file is open in Arduino Sketch IDE; locate the following code-block which should be right at the top

//=====================================================================================================================
//------------------------------ SIMPLE USER CONFIGURATION SETTINGS ---------------------------------------------------
//=====================================================================================================================
#define BUILD_VERSION 20170622 // Release Version used to Build the Unit ( without the dots )
#define TRANSCEIVER_ID 1 // Unique numeric (ID)entity for this Unit(1-15)
#define XBEECONFIG 0 // Configure the XBEE using XCTU Digi Software by setting this to 1
#define ULTRASONIC_WATER_LEVEL_INSTALLED 0 // 0 = NO, 1 = YES ( Wire TRIG -> D4, ECHO -> D5 )
#define WATER_PRESSURE_INSTALLED 0 // 0 = NO, 1 = YES ( Wire SENSE -> A3 )

//^^^[ END - SIMPLE USER CONFIGURATION SETTINGS ]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  1. As described within the comments ( text following '//' )
    1. Change ULTRASONIC_WATER_LEVEL_INSTALLED to a '1' if a water-level sensor has been attached to the Pump-Controller.
    2. Change WATER_PRESSURE_INSTALLED to '1' if a digital pressure sensor has been attached to the Pump-Controller.

  1. Now proceed to Step #5 in #5.2.Uploading Firmware|outline and Compile & Upload the changes just made

5.2Uploading Firmware


  1. Install Arduino Sketch IDE ( If NOT installed already ) https://www.arduino.cc/en/Main/Software

  1. Install the PeerIOSerialControl Library ( If NOT installed already )
    1. In a web-browser; go to https://github.com/tgit23/PeerIOSerialControl
    2. On Green Clone or download Choose Download Zip
    3. Save to a place you'll remember – like Documents or Desktop
    4. Run the Arduino Sketch IDE
    5. Choose Menu Item SketchInclude LibraryAdd .zip Library
    6. Select the PeerIOSerialControl Library file saved in step 'c' above

  1. Install the SSoftwareSerial Library - Required by the Hand-Remote Firmware ( If NOT installed already )
    1. In a web-browser; go to https://github.com/tgit23/SSoftwareSerial
    2. Click on file SSoftwareSerial.zip ; Then click on 'Download' above 'View Raw'
    3. Save to a place you'll remember – like Documents or Desktop
    4. Run the Arduino Sketch IDE if not already open from step #1
    5. Choose Menu Item SketchInclude LibraryAdd .zip Library
    6. Select the SSoftwareSerial.zip Library file saved in step 'c' above

  2. Download the Firmware
    1. In a web-browser; go to https://github.com/tgit23/AgIrrigationRemoteControl
    2. On Green Clone or download Choose Download Zip
    3. Save to a place you'll remember – like Documents or Desktop
    4. Unzip the Folder
    5. In Arduino Sketch IDE choose FileOpen and Select
      • File HandRemote.ino for the HandRemote Firmware
        • Location Example: \Downloads\AgIrrigationRemoteControl-master\AgIrrigationRemoteControl-master\HandRemote
      • File PumpController.ino for the PumpController Firmware
        • Location Example: \Downloads\AgIrrigationRemoteControl-master\AgIrrigationRemoteControl-master\PumpController\PumpRemote

  1. Compile and Upload the Firmware
    1. Plug in a USB cable from the Computer to the unit
    2. Select the Port the units USB is connected to; in Sketch menu ToolsPort
      • To determine Port; Open Windows Device Manager → Ports ( COM & LPT ) a new COM?? port appears right after plugging in the cable
    3. Select the Board; Sketch menu ToolsBoardArduino/Genuino UNO
    4. In Arduino Sketch IDE; Press the Right-Arrow next to the Check mark in the Top-Left Corner to upload the firmware onto the unit

5.3Xbee RF Configuration


The XBEE RF Module is setup from the factory to work without any additional changes. However, often it is very wise to assign non-factory setting in order to keep your RF communications from being interfered with by other XBEE devices in the neighborhood. Changes to the ID Network ID ( described below ) will need to be preformed on all Hand-Remotes and all Pump-Controllers

  1. Upload Firmware with XBEE Configuration Set
    1. To change the XBEE settings – Follow Steps #1 to #3 in #4.2.A SYSTEM OPERATIONS|Firmware|Uploading

With the Firmware file open find the following line of code; which should be very close to the top
#define XBEECONFIG 0 // Configure the XBEE using XCTU Digi Software by setting this to 1
Change it to
#define XBEECONFIG 1 // Configure the XBEE using XCTU Digi Software by setting this to 1

    1. Then proceed to upload the firmware to the Unit as outline in Step #4 in #4.2.A SYSTEM OPERATIONS|Firmware|Uploading

  1. Install Digi-XCTU
    1. The Digi XCTU software can be gotten from https://www.digi.com/products/xbee-rf-solutions/xctu-software/xctu

  1. Run Digi-XCTU

    1. Using the + ( Add Radio Modules ) mark in the top left corner enter the unit's COM port ( The Arduino COM Port )
    2. The main values that may be of interest are:
      • ID Network ID - This sets a Unique “Channel” to keep your units communications separate from any others out there (Must be same on all units)
      • PL TX Power Level - If devices are close; a lower power setting can preserve battery life

  1. Save Settings to the Xbee and Reload Firmware

    1. Be sure to click the “Write” button in XCTU to save any settings that were made
    2. Close XCTU
    3. In Arduino Sketch IDE restore the following line to its original
#define XBEECONFIG 0 // Configure the XBEE using XCTU Digi Software by setting this to 1
    1. Upload the Firmware to the Unit again as outline in Step #4 in #4.2.A SYSTEM OPERATIONS|Firmware|Uploading

5.4Customizing Firmware


5.4.1Pump-Controller



NOTE: Wiring, Timing, and Almost all system functions are implemented on the Hand-Remote Firmware

A.Virtual Pins


Virtual pins are non-hardware related value identifiers that are created and assigned by the Pump-Controller firmware and then accessed by the Hand-Remote as a “Pin” value. An example case is the ultrasonic water level; The pump-controller firmware pings and times an echo of the ultrasonic distance meter using its D4 ( Trigger ) and D5 ( Echo ) pins and stores the measured value on “virtual pin 64”. When the Hand-Remote queries for a value on pin-64 it actually gets the measured value which is a combination of D4 & D5 already calculated by the Pump-Controller.

void loop(){

XBee.Available();


#if US_PRESENT>0
// Read UltraSonic water level
int ulCurrentTime = millis();
if ( ulCurrentTime > ulLastPing + 1000 ) {
XBee.VirtualPin(64, sonar.ping_in() );
ulLastPing = ulCurrentTime;
}
#endif
}

5.4.2Hand-Remote









A.Adding & Deleting Devices





B.Creating a Menu-Item


  1. Find the SetupMenu() function in the Hand-Remote firmware file; This is where all the Menu-Items are defined

  1. Indexing - Determine where in the list of Menu-Items you'd like the new item to appear
    1. All Items MUST BEGIN with line MenuItemsIdx++; except the very first item ( Usually the Hand-Remote battery status )
    2. The line above increments the Indexing ( line count ) to allow the new menu-item to exist
    3. Items that do not have [MenuItemsIdx] indexing are used in other places of the firmware and should NEVER BE CHANGED!

  1. Device - Assign the device this Menu-Item is attached to
    1. This is the Device's Unique Name given in Step #A|Adding & Deleting Devices
    2. The unit is generally a named Pump-Controller device with an assigned Transceiver_ID.

  1. Pin – Assign the Hardware Pin of the device that the Menu-Item will control or monitor
    1. The hardware pin is the terminal inside the controlling device box ( pump-controller ) that the control/monitor equipment is wired to
    2. NOTE: Digital Pins ( D4 → D7 ) are identified by only their number ( e.g. 4 = D4 ) whereas Analog pins require both letter and number ( e.g. A2 ).
      • Digital Example; Menu[MenuItemsIdx].Pin=7;
      • Analog Example; Menu[MenuItemsIdx].Pin=A3;

  1. Text - Assign the Menu-Item a defining Text
    1. The text is what will be displayed on the Hand-Remote display
      • Example; Menu[MenuItemsIdx].Text=”Power”;

  1. Options - Determine IF the Menu-Item will have textual “Options” or is just a numerical value
    1. If the Menu-Item will report numerical values such as Voltage, Water Level, Pressure etc... Skip to step #5
    2. Determine the Menu-Items Options and assign each a;
      • Text Example; Menu[MenuItemsIdx].Option[0].Text = “On”;
      • Value Example; Menu[MenuItemsIdx].Option[0].Value = HIGH;

  1. Sub[SET] – Determine IF the user should be allowed to set a value on the Location ( Output Pins like turning Power ON/OFF )

    1. If the Menu-Item is for monitoring status and the user will not be setting its value (INPUT)... Skip to step #7
    2. If the Menu-Item needs to allow the user the ability to set the value ( OUTPUT )
      • Set the “State” to SETTABLE to allow the user to SET the value
      • Example; Menu[5].Sub[SET].State = SETTABLE;

  1. Sub[??ALARM] – Determine if the value should be monitored with an alarm
    1. LOALARM
      • If the Menu-items value is numeric and the value should be checked for getting too small
      • OR If the Menu-item value is an “option” and the value should be checked to see if it is EQUAL
        • Assign an LOALARM identifier Example; Menu[5].Sub[LOALARM].ID = 'c';
    2. HIALARM
      • If the Menu-items value is numeric and the value should be checked for getting too large
      • OR If the Menu-Item value is an “option” and the value should be checked to see if it is NOT-EQUAL
        • Assign a HIALARM identifier Example; Menu[5].Sub[HIALARM].ID = 'C';

  1. Proceed to #4.3.2.3.Updating Changes|outline

C.Deleting a Menu-Item


  1. Find the menu item you'd like to delete by identifying it by its' Menu[MenuItemIdx].Text setting
  2. Select ALL the items from MenuItemsIdx++; up to but no including the next MenuItemsIdx++;
  3. Press delete

D.Menu-Item Setup ( Example )

The menu items are defined in the SetupMenu() Function identified by line 'void SetupMenu() {'. Each item in the Menu has a numeric index (i.e. Menu[index-#] below the constant 'MONITOR' is assigned index-0 and 'PUMPIDX' is assigned index-1).

//=====================================================================================================================
//------------------------------ MENU STRUCTURE ( ADVANCED CONFIGURATION ) --------------------------------------------
//=====================================================================================================================
/******************************************************************************************************************//**
* @brief Setup the LCD menu
* @remarks
* - Allows a single spot customization to the user interface
* - Display will show the items in the same order as they are defined here
* @code
* exmaple code
* @endcode
**********************************************************************************************************************/
uDevices HandRemote, CanalPump, DitchPump; // Name and Define all controllable devices in the System
void SetupMenu() {

HandRemote.Text = "Hand Remote"; HandRemote.TransceiverID = TRANSCEIVER_ID;
DitchPump.Text = "Ditch Pump"; DitchPump.TransceiverID = 10;
CanalPump.Text = "Canal Pump"; CanalPump.TransceiverID = 11;
//BATT (idx-0) ----------------------------
Menu[BATT].Device = HandRemote;
Menu[BATT].Pin = A1; // Battery level is gotten from the Hand-Remote pin A1
Menu[BATT].Text = "Battery(B)"; // Create a menu item for monitoring the Battery
Menu[BATT].ValueModifier = BATTVOLTS; // Modify raw value to show voltage
Menu[BATT].Sub[LOALARM].ID = 'b'; // A Low Alarm is identified by a lower-case 'b'
//-----------------------------------------
MenuItemsIdx++;
idx = MenuItemsIdx; // !!!-- Set where the Menu will start --!!!
Menu[MenuItemsIdx].Device = DitchPump;
Menu[MenuItemsIdx].Pin = 7; // Power is set/got on all Pump-Controller's on pin [D7]
Menu[MenuItemsIdx].Text = "Power(P)"; // Create a menu item for Power Control
Menu[MenuItemsIdx].Sub[SET].State = SETTABLE; // Allow this Value to be 'SET' by the user
Menu[MenuItemsIdx].Sub[LOALARM].ID = 'p'; // A Low Alarm is identified by a lower-case 'p'
Menu[MenuItemsIdx].Sub[HIALARM].ID = 'P'; // A High Alarm is identified by an upper-case 'P'
Menu[MenuItemsIdx].Option[0].Text = "Off"; // Power can be "Off" - Option #0 = Off
Menu[MenuItemsIdx].Option[0].Value = LOW; // "Off" will be the value 'LOW" - Off = LOW
Menu[MenuItemsIdx].Option[1].Text = "On"; // Power can be "On" - Option #1 = On
Menu[MenuItemsIdx].Option[1].Value = HIGH; // "On" will be the value 'HIGH' - On = HIGH
Menu[MenuItemsIdx].LastOptionIdx = 1; // Last Option Index defined - Number of Options - 1
//-----------------------------------------
#if ULTRASONIC_WATER_LEVEL_INSTALLED>0
MenuItemsIdx++;
Menu[MenuItemsIdx].Device = DitchPump;
Menu[MenuItemsIdx].Pin = 64; // Water Level is read from VIRTUAL (Pump-Controllers firmware) pin 64
Menu[MenuItemsIdx].Text = "Water (L)"; // Create a menu item for Water Level Transducer
Menu[MenuItemsIdx].Sub[LOALARM].ID = 'l'; // A Low Alarm is identified by a lower-case 'l'
Menu[MenuItemsIdx].Sub[HIALARM].ID = 'L'; // A High Alarm is identified by an upper-cse 'L'
#endif
//-----------------------------------------
#if WATER_PRESSURE_INSTALLED>0
MenuItemsIdx++;
Menu[MenuItemsIdx].Device = DitchPump;
Menu[MenuItemsIdx].Pin = A3; // The 'signal' is gotten on all Pump-Controllers on pin [A3]
Menu[MenuItemsIdx].Text = "Pressure(R)"; // Create a menu item for the Primary Pressure Transducer
Menu[MenuItemsIdx].ValueModifier = PRESSURE; // Modify value to display PSI instead of MPa
Menu[MenuItemsIdx].Sub[LOALARM].ID='r'; // A Low Pressure alarm is identified by a lower-case 'r'
Menu[MenuItemsIdx].Sub[HIALARM].ID='R'; // A High Pressure alarm is identified by an upper-case 'R'
#endif
/*// UN-COMMENT BELOW FOR A SECOND PUMP-CONTROLLER ( NAMED "Canal Pump" ) WITH TRANSCEIVER_ID = 11
//-----------------------------------------
MenuItemsIdx++;
Menu[MenuItemsIdx].Text = "Power(C)"; // Create a menu item for Power Control
Menu[MenuItemsIdx].Device = CanalPump;
Menu[MenuItemsIdx].Pin = 7; // Power is set/got on all Pump-Controller's on pin [D7]
Menu[MenuItemsIdx].Sub[SET].State = SETTABLE; // Allow this Value to be 'SET' by the user
Menu[MenuItemsIdx].Sub[LOALARM].ID = 'c'; // A Low Alarm is identified by a lower-case 'p'
Menu[MenuItemsIdx].Sub[HIALARM].ID = 'C'; // A High Alarm is identified by an upper-case 'P'
Menu[MenuItemsIdx].Option[0].Text = "Off"; // Power can be "Off" - Option #0 = Off
Menu[MenuItemsIdx].Option[0].Value = LOW; // "Off" will be the value 'LOW" - Off = LOW
Menu[MenuItemsIdx].Option[1].Text = "On"; // Power can be "On" - Option #1 = On
Menu[MenuItemsIdx].Option[1].Value = HIGH; // "On" will be the value 'HIGH' - On = HIGH
Menu[MenuItemsIdx].LastOptionIdx = 1; // Last Option Index defined - Number of Options - 1

//-----------------------------------------
MenuItemsIdx++;
Menu[MenuItemsIdx].Text = "Pressure(F)"; // Create a menu item for the Primary Pressure Transducer
Menu[MenuItemsIdx].Device = CanalPump;
Menu[MenuItemsIdx].Pin = A3; // The 'signal' is gotten on all Pump-Controllers on pin [A3]
Menu[MenuItemsIdx].ValueModifier = PRESSURE; // Modify value to display PSI instead of MPa
Menu[MenuItemsIdx].Sub[LOALARM].ID='f'; // A Low Pressure alarm is identified by a lower-case 'r'
Menu[MenuItemsIdx].Sub[HIALARM].ID='F'; // A High Pressure alarm is identified by an upper-case 'R'

//-----------------------------------------
MenuItemsIdx++;
Menu[MenuItemsIdx].Text = "Pressure(S)"; // Create a menu item for the Secondary Pressure Transducer
Menu[MenuItemsIdx].Device = CanalPump;
Menu[MenuItemsIdx].Pin = A4; // Menu-item is for Pump-Option #0 (Canal) on Pin (A4)
Menu[MenuItemsIdx].ValueModifier = PRESSURE; // Modify value to display PSI instead of MPa
Menu[MenuItemsIdx].Sub[LOALARM].ID='s'; // A Low Pressure alarm is identified by a lower-case 's'
Menu[MenuItemsIdx].Sub[HIALARM].ID='S'; // A High Pressure alarm is identified by an upper-case 'S'
*/
//------------[ Start-Up the Display ( DO NOT CHANGE! )]-------------
for ( int i = 0; i <= MenuItemsIdx; i++ ) {
if ( Menu[i].Sub[LOALARM].ID != NULL || Menu[i].Sub[HIALARM].ID != NULL ) {
EEPROMGet(i); // Load Alarm values from EEPROM
}
}
GetItem(); // Get starting Menu item
LCD_display(); // Update the display
}

6.OPTIONAL ACCESSORIES


Optional Accessories can be added to the Ag-irrigation Remote Control system to enhance monitoring and control abilities.

6.1Hand-Remote


6.1.19V Rechargeable Batteries ( $18.90 )

It is highly recommended to purchase high output 300mAH or more rechargeable 9V Batteries; as the Hand-Remote will eat threw batteries pretty quickly.

At time of writing EBL 4x 600mAHh 9V Li-ion Rechargeable Batteries with Charger could be purchased for $18.90
http://www.ebay.com/itm/300974624904

NOTE: Even if a USB power is plugged in – If the power switch is turned ON it will still draw power from the battery. If you plug in USB for power be sure the power switch on the Hand-Remote unit is turned OFF.

6.2Pump-Controller


6.2.1Pressure



A.Materials ($9.59)



5V 0-1.2 MPa Pressure Transducer Sensor Oil Fuel Diesel Gas Water Air Sensor

Banggood.com ( $9.59/EA )

(~30-feet) 4-lead outdoor wire

required to reach from the pipe to the Pump-Controller

( See Outdoor Data Wire in BOM )


B.Installation


  1. Remove the current Pressure Gauge from its location

  1. Screw in the Pressure Transducer ( Typically does fit the same hole size and threads as the pressure gauge )

  1. Wire up the Transducer as follows
    1. Transducer RED wire ( +5V ) → Cat5e ORANGE
    2. Transducer BLACK wire ( GND ) → Cat5e BROWN
    3. Transducer YELLOW wire ( SIGNAL ) → Cat5e BLUE

  1. Wire the other end of the Cat5e Wire into the Pump-Controller
    1. Cat5e ORANGE → 5VDC
    2. Cat5e BROWN → GND
    3. Cat5e BLUE → A3

C.Firmware Adjustments


See #5.1.Adding Expansions|outline
To activate the Pressure Sensor on the Hand-Remote Unit

6.2.2Water Level



A.Materials ( $10.77/ea )


(1) DC 5V Waterproof Ultrasonic Module

Distance Measuring Transducer Sensor

banggood.com ( $ 10.77/EA )

(1) 4-PIN Female Dupont Header

to connect to Circuit Board Pins

( See Dupont Headers in BOM )

(~30-feet) 4-lead outdoor wire

required to reach from the ditch to the Pump-Controller ( See Outdoor Data Wire in BOM )


B.3D-Prints ( $1.30 )


SonicCircuitBoardCase.stl ( 14.3 cm3 )

SonicCableCover.stl ( 2.5 cm3 )

SonicCircuitBoardCover.stl ( 6.7 cm3 )

SonicHeadCase.stl ( 17.6 cm3 )

SonicHeadCover.stl ( 2.6 cm3 )



C.Firmware Adjustments


See #5.1.Adding Expansions|outline
To activate the Ultrasonic Distance Water Level Meter on the Hand-Remote Unit

6.2.3Auxiliary Contact ( $43.75 )



6.2.4Flow Meter


Did not implement due to high costs and limited benefits

http://www.banggood.com/TUF-2000M-TS-2-Digital-Ultrasonic-Flowmeter-Flow-Meter-Ultrasinic-Flow-ModuleRTU-p-1087832.html ( $186.77 )

7.TROUBLESHOOTING















8.OTHER RESOURCES / LINKS