(
7. TROUBLESHOOTING
:: TROUBLESHOOTING
:: TROUBLESHOOTING
) Page -
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
|
|
|
|
SUB-FUNCTIONS ( ← LEFT || RIGHT → ) |
Location |
|||
|
Device |
|
|
|
|
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) |
|
|
|
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) |
|
|
|
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 |
(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 ) |
(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 |
(2) Zigbee Shield RF Wireless Module Expansion Board for Arduino Xbee
Aliexpress.com ( $2.20/EA ) (1) for each HandRemote (1) for each PumpController |
(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 )
|
(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 |
(~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 ) |
BangGood.com ( $1.68 / 5pcs ) |
|
|
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 ) |
|
|
|
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 ) |
|
|
//=====================================================================================================================
//------------------------------
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
]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#define
XBEECONFIG 0 // Configure the XBEE
using XCTU Digi Software by setting this to 1
#define
XBEECONFIG 1 // Configure the XBEE
using XCTU Digi Software by setting this to 1
#define
XBEECONFIG 0 // Configure the XBEE
using XCTU Digi Software by setting this to 1
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
}
Menu[MenuItemsIdx].Pin=7;
Menu[MenuItemsIdx].Pin=A3;
Menu[MenuItemsIdx].Text=”Power”;
Menu[MenuItemsIdx].Option[0].Text
= “On”;
Menu[MenuItemsIdx].Option[0].Value
= HIGH;
Menu[5].Sub[SET].State
= SETTABLE;
Menu[5].Sub[LOALARM].ID
= 'c';
Menu[5].Sub[HIALARM].ID
= 'C';
Menu[MenuItemIdx].Text
settingMenuItemsIdx++;
up to but no including the next MenuItemsIdx++;
//=====================================================================================================================
//------------------------------
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
}
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 ) |
(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 ) |
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 ) |
|