Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

RiderTrack / RiderNet Project
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RiderTrack / RiderNet Project

by miax on Tue May 10, 2011 11:49 am

Good morning!

I wanted to take some time to post a write-up about my current projects, most especially since I purchased the bulk of my project pieces from Adafruit! I really enjoy the site, store, forums and overall atmosphere here - its very nice. :) This is a longish-read, so if you hate longish-reads or are now programmed to fall-asleep after 140 characters - this is not a post for you. ;)

Background:

I live on a horse farm where my wife boards our horses and our family rides/helps out around the farm on a daily basis. Its a pony club center, and thus there are tons of riders, over 50 horses and alot of chaos on big show/lesson days. Its a wonderful place to live (aside from the armies of stink bugs and giant spiders), but has a big problem with modernization - there is none. The lessons don't have any electronic form of organization, and there isn't any hope of doing it with paper either - we desperately needed to modernize the farm for the owners.

The requirements we came up with were short:

1. The ability for riders to bar-code scan before they get on, so the lesson is electronically recorded date/time.
2. The ability to display a schedule of riders and horses for the day over the web.
3. The ability to store data about each horse, including availability for lessons, health, special needs, etc.
4. The ability to upload the resulting scan data to quick-books.
5. The ability to handle scheduling for camps, shows, and special events.
6. It must be located in the main barn where everyone tacks-up and goes into the lessons.
7. It must have several video cameras attached so folks on the farm (us and the owners) can see different areas at any time.
8. It must survive being in a barn at a busy horse farm.

Pretty simple on paper for #1-7; I selected a RedHat server for the OS and a custom-ordered Intel-based PC for the core. Using a Motorola scanner as well as a BlueCherry video monitoring card that both have good Linux support, I setup an Apache web-server, MySQL database and some event management software. That is all going well and should provide an convenient platform for folks to scan their barcodes and see their schedule pop-up on the screen, make selections and within a few seconds they are off to have fun riding.

The exception is #8; Making a server and network that is 100% protected from all environments is not as trivial. It means the server and network routers to reach it must each be Water-proof, dust-proof and vibration-proof as well as handle temperatures that can range from 120 down to -30 with no air circulation of any kind. To add to the difficulty, the main barn has no network of any kind and is too-far from either house to run a static line - so wireless network routers mounted on trees and buildings outside are needed to reach the server. This meant making water-tight enclosures and using mineral oil as a cooling/warming medium. Each of the 4 wireless routers, the server and the Arduino's are all immersed in mineral oil, with an aquarium heater to keep it from freezing in the winter and an aquarium power-head to provide circulation.

The Arduino's will provide control and management over the entire system and network - with one Arduino Mega + Ethernet Shield located in the server and in each wireless router. Each Arduino is wired with 4 sensors to monitor the wireless router its attached to;
-> 1 Temperature sensor to monitor the mineral oil inside the router.
-> 1 Temperature sensor to monitor the external air temp.
-> 1 Photo Cell sensor positioned over the wireless router's power LED to monitor on/off power for the router.
-> 1 Flex/Bend sensor positioned at the top with a float, acting as a mineral oil-level sensor should the router loose oil.

I added 10 total LEDs to each setup (4 stand-alone, 2 tri-color RGB) to show power status, temp status, fluid status, etc (I love blinky LEDs, now is my chance to go wild!). I used some Arduino prototype boards as my PCBs, and a mixture of hook-up wire and connectors to affix the PCB to the front-door of the router.

The program for the routers I call, "RiderNet", and it's purposes are to:

A. Monitor the oil temperature to ensure the router is not too-hot or too-cold. If temperature gets critical, I use one of the power-switch tails to disconnect power to the router and equipment (so only the Arduino remains on).
B. Monitor the power-status of the wireless router by watching the power-led, and issue warnings if the router looses power.
C. Monitor the oil-level in the router, and sound an alarm and shut-down power to the the router if it looses oil pressure.
D. Provides a small web-server that prints the stats of the router every minute.
E. Provide an SNMP agent so that each router can be polled, and the stats tracked using Zymon/MRTG.
F. Provide a diagnostic capability so that the routers can be tested on/off the bench.

The code for RiderNet is ~750 lines long - I am only a modest C programmer, and tend to try and keep things simple versus making perfect code. I know C at an average level, and using the Excellent examples and resources that Ladyada provides, I got everything working well. If I was a better code I could probably have done this using an Uno, but as it stands I used Mega's because of the extra-memory to handle my sloppy coding. :p I'll post it below for thoughts/comments/laughter. ;)

Code: Select all | TOGGLE FULL SIZE
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
RiderNet version 1.0 by Kristopher Kortright
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#include <SPI.h>
#include <Ethernet.h>

// Set IDENTITY; 0=KortrightHaus, 1=Garage, 2=BoardersTack, 3=RiderTrack, 4=FeedRoom, 5=BarnOffice, 6=HutchisonHaus, 7=Backup
//  int IDENTITY = 0;
//  byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x3F, 0x40 };
//  byte ip[] = { 192, 168, 1, 180 };
//  int IDENTITY = 1;
//  byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x3F, 0x41 };
//  byte ip[] = { 192, 168, 1, 181 };
//  int IDENTITY = 2;
//  byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x3F, 0x42 };
//  byte ip[] = { 192, 168, 1, 182 };
//  int IDENTITY = 3;
//  byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x3F, 0x43 };
//  byte ip[] = { 192, 168, 1, 183 };
//  int IDENTITY = 4;
//  byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x3F, 0x44 };
//  byte ip[] = { 192, 168, 1, 184 };
//  int IDENTITY = 5;
//  byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x3F, 0x45 };
//  byte ip[] = { 192, 168, 1, 185 };
//  int IDENTITY = 6;
//  byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x3F, 0x46 };
//  byte ip[] = { 192, 168, 1, 186 };

int IDENTITY = 7;
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x3F, 0x47 };
byte ip[] = { 192, 168, 1, 187 };

//  int IDENTITY = 8;
//  byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x3F, 0x48 };
//  byte ip[] = { 192, 168, 1, 188 };



// Some static information
int VERSION = 1.0;
int POWER_INTERRUPT = 0;
int MAX_TEMP_ALARMS = 10;
int MAX_TILT_ALARMS = 10;

int AdminState = 0;
int FluidState = 0;
int TempState = 0;
int RouterState = 0;
int SystemState = 0;
int InternTempF = 0;
int ExternTempF = 0;
int Tilts = 0;
int pinReadDelay = 10;
unsigned int Loopy = 0;

// Flags
int TempAlarms = 0;
int ReverseTiltMode = 1;

/* Mega Pinouts */
int AnalogPhotoCellRouter = 62;
int AnalogExternalTemp = 63;
int AnalogExternalTemp = 64;
int AnalogTiltSensor = 54;
int AnalogFlexSensor = 58;
int DigitalRouterPower = 22;
int DigitalArduinoPower = 24;
int DigitalRouterStatusLEDred = 26;
int DigitalRouterStatusLEDgreen = 28;
int DigitalRouterStatusLEDyellow = 30;
int DigitalRouterPowerLED = 34;
int DigitalInternalTempLEDred = 36;
int DigitalInternalTempLEDblue = 38;
int DigitalInternalTempLEDgreen = 40;
int DigitalExternalTempLED = 44;       
int DigitalOilLevelLED = 46;


// Start the web server
Server server(80);
 

void setup()
{
  int i = 0;
  int Spinner = 0;
  int SleepTime = 0;
  int FluidStateRaw = 0;
  char buf[128];

  // Set the pin modes
  pinMode(AnalogPhotoCellRouter, INPUT);
  pinMode(AnalogExternalTemp, INPUT);
  pinMode(AnalogExternalTemp, INPUT);
  pinMode(AnalogTiltSensor, INPUT);
  pinMode(DigitalExternalTempLED, OUTPUT);
  pinMode(DigitalOilLevelLED, OUTPUT);
  pinMode(DigitalArduinoPower, OUTPUT);
  pinMode(DigitalRouterPowerLED, OUTPUT);
  pinMode(DigitalInternalTempLEDred, OUTPUT);
  pinMode(DigitalInternalTempLEDgreen, OUTPUT);
  pinMode(DigitalInternalTempLEDblue, OUTPUT);
  pinMode(DigitalRouterPower, OUTPUT);
  pinMode(DigitalRouterStatusLEDyellow, OUTPUT);
  pinMode(DigitalRouterStatusLEDgreen, OUTPUT);
  pinMode(DigitalRouterStatusLEDred, OUTPUT);
  digitalWrite(DigitalArduinoPower, HIGH);


  // Start the serial port for logging
  Serial.begin(9600);

   // start the SPI library:
  SPI.begin();

  // Process the admin state.
  // Valid Admin States are: 0 = Normal (ON), 1 = Reboot, 2 = Shut-off, 3 = Series Reboot
  AdminState =  0; 
  if(AdminState == 0) {
    digitalWrite(DigitalRouterPower, HIGH);
    digitalWrite(DigitalRouterStatusLEDyellow, LOW);
    digitalWrite(DigitalRouterStatusLEDgreen, HIGH);
    digitalWrite(DigitalRouterStatusLEDred, LOW);
    delay(2000);
  } else if(AdminState == 1) {
    SleepTime = 30000;
    digitalWrite(DigitalRouterPower, LOW);
    for(i = 0; i < SleepTime; i = i + 1000) {
      if(Spinner == 0) {
        digitalWrite(DigitalRouterPowerLED, HIGH);
        Spinner = 1;
      } else {
        digitalWrite(DigitalRouterPowerLED, LOW);
        Spinner = 0;
      }
      delay(1000);
    }
    digitalWrite(DigitalRouterPower, HIGH);
    digitalWrite(DigitalRouterStatusLEDyellow, HIGH);
    digitalWrite(DigitalRouterStatusLEDgreen, LOW);
    digitalWrite(DigitalRouterStatusLEDred, LOW);
    AdminState = 0;
  } else if(AdminState == 2) {
    if(POWER_INTERRUPT == 1) {
      digitalWrite(DigitalRouterPower, LOW);
    }
    digitalWrite(DigitalRouterStatusLEDyellow, LOW);
    digitalWrite(DigitalRouterStatusLEDgreen, LOW);
    digitalWrite(DigitalRouterStatusLEDred, HIGH);
  } else if(AdminState == 3) {
    if(POWER_INTERRUPT == 1) {
      digitalWrite(DigitalRouterPower, LOW);
    }
    for(i = 0; i < SeriesDelay; i = i + 1000) {
      if(Spinner == 0) {
        digitalWrite(DigitalRouterPowerLED, HIGH);
        Spinner = 1;
      } else {
        digitalWrite(DigitalRouterPowerLED, LOW);
        Spinner = 0;
      }
      delay(100);
    }
    digitalWrite(DigitalRouterPowerLED, HIGH);
    digitalWrite(DigitalRouterStatusLEDyellow, HIGH);
    digitalWrite(DigitalRouterStatusLEDgreen, LOW);
    digitalWrite(DigitalRouterStatusLEDred, LOW);
    delay(SeriesDelay);
    digitalWrite(DigitalRouterPower, HIGH);
    AdminState = 0;
  } else {
    digitalWrite(DigitalRouterPower, HIGH);
  }


  // Activate the tilt sensor
  analogWrite(AnalogTiltSensor, 255); 


  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();

  // Set the initial status to OFF.
  digitalWrite(DigitalRouterStatusLEDred, HIGH);
  digitalWrite(DigitalRouterStatusLEDgreen, HIGH);
  digitalWrite(DigitalRouterStatusLEDyellow, HIGH);
  digitalWrite(DigitalInternalTempLEDgreen, HIGH);
  digitalWrite(DigitalInternalTempLEDred, HIGH);
  digitalWrite(DigitalInternalTempLEDblue, HIGH);



}
 



// This routine handles the web clients, serving up data about itself when contacted.
void ListenForClients(void)
{
  // listen for incoming clients
  Client client = server.available();
  if (client) {
    Serial.println("Got a client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<meta http-equiv=\"refresh\" content=\"30\">");
         
          // print the current readings, in HTML format:
          client.print("" + String());
          client.println("RiderTrack Network Version: \n" + String(VERSION));
          client.println("<br />");
          client.println("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
          client.println("<br />");
          if(IDENTITY == 0) {
            client.println("Current Status for Node: mbf-wan-core (Kortrights)");
          } else if (IDENTITY == 1) {
            client.println("Current Status for Node: mbf-wan-edge1 (Garage)");
          } else if (IDENTITY == 2) {
            client.println("Current Status for Node: mbf-wan-edge2 (Boarders Tackroom)");
          } else if (IDENTITY == 3) {
            client.println("Current Status for Node: mbf-wan-barn (Main Barn)");
          } else if (IDENTITY == 4) {
            client.println("Current Status for Node: mbf-wan-edge3 (Feed Room)");
          } else if (IDENTITY == 5) {
            client.println("Current Status for Node: mbf-wan-edge4 (Barn Office)");
          } else if (IDENTITY == 6) {
            client.println("Current Status for Node: mbf-wan-edge5 (Hutchesons)");
          } else if (IDENTITY == 7) {
            client.println("Current Status for Node: mbf-wan-backup (Any Location)");
          } else {
            client.println("Current Status for Node: mbf-wan-backup (Any Location)");
          }
          client.println("<br />");
          client.print("Loop Count: " + String(Loopy));
          client.println("<br />");
          client.print("Series Delay: " + String(SeriesDelay));
          client.println("<br />");
          client.println("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
          client.println("<br />");
          if(AdminState == 0) {
            client.println("Admin Status: OK");
          } else if(AdminState == 1) {
            client.println("Admin Status: Rebooting");
          } else if(AdminState == 2) {
            client.println("Admin Status: Shut-Down");
          } else if(AdminState == 3) {
            client.println("Admin Status: Series-Rebooting");
          } else {
            client.println("Admin Status: Unknown");
          }
          client.println("<br />");
          if(SystemState == 0) {
            client.println("System Status: ON");
          } else if(SystemState == 1) {
            client.println("System Status: OFF");
          }
          client.println("<br />");
          if(RouterState == 0) {
            client.println("Router Status: ON");
          } else if(RouterState == 1) {
            client.println("Router Status: OFF");
          }
          client.println("<br />");
          if(FluidState == 0) {
            client.println("Fluid Status: OK");
          } else if(FluidState == 1) {
            client.println("Fluid Status: ALARM");
          }
          client.println("<br />");
          if(TempState == 0) {
            client.println("Temp Status: Normal");
          } else if(TempState == 1) {
            if(InternTempF < 32) {
              client.println("Temp Status: COLD");
            } else if(InternTempF > 100) {
              client.println("Temp Status: HOT");
            } else {
              client.println("Temp Status: Normal");
            }
          } else if(TempState == 2) {
            if(InternTempF < 0) {
              client.println("Temp Status: FROZEN");
            } else {
              client.println("Temp Status: BOILING");
            }
          }
          client.println("<br />");
          client.print("Air Temperature: " + String(ExternTempF));
          client.println("<br />");
          client.print("Oil Temperature: " + String(InternTempF));
          client.println("<br />");
          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        }
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1000);
    // close the connection:
    client.stop();
  }
}




// Main Loop

void loop()
{
  float InternTemp;
  float ExternTemp;
  float hold;
  float holdC, holdF;
  int SleepTime = 0;
  int Spinner = 0;
  int LightLevelFlag = 0;
  int TiltSensor = 0;
  int TiltSensorRaw = 0;
  int TempCount = 0;
  int SetTempRecovery = 0;
  int i = 0;
  int x = 0;
  char buf[128];
 
  SetTempRecovery = 0;
  sprintf(buf, "  ");
  Serial.println(buf);
  Loopy = Loopy + 1;
  sprintf(buf, "Loop: %d", Loopy);
  Serial.println(buf);

  if(AdminState == 2) {
    digitalWrite(DigitalRouterStatusLEDyellow, LOW);
    digitalWrite(DigitalRouterStatusLEDgreen, LOW);
    digitalWrite(DigitalRouterStatusLEDred, HIGH);
    digitalWrite(DigitalInternalTempLEDblue, LOW);
    digitalWrite(DigitalInternalTempLEDgreen, LOW);
    SleepTime = 2500;
    Spinner = 0;
    for(i = 0; i < SleepTime; i = i + 100) {
      if(Spinner == 0) {
        digitalWrite(DigitalRouterStatusLEDred, HIGH);
        if(FluidState == 1) {
          digitalWrite(DigitalOilLevelLED, HIGH);
        }
        Spinner = 1;
      } else {
        digitalWrite(DigitalRouterStatusLEDred, LOW);
        if(FluidState == 1) {
          digitalWrite(DigitalOilLevelLED, LOW);
        }
        Spinner = 0;
      }
      delay(100);
    }
  }

  // =-=-= Light (power) Sensor =-=-=
  int LightLevel = analogRead(AnalogPhotoCellRouter);
  delay(pinReadDelay);
  LightLevel = map(LightLevel, 0, 900, 0, 10);
  LightLevel = constrain(LightLevel, 0, 10);
  if(LightLevel < 5) {
    if(RouterState == 0) {
      digitalWrite(DigitalRouterPowerLED, HIGH);
      sprintf(buf, "Router power is ON (sensor: %d)", LightLevel);
      Serial.println(buf);
    } else {
      digitalWrite(DigitalRouterPowerLED, HIGH);
      sprintf(buf, "Router power is ON, it must have recovered! (sensor: %d)", LightLevel);
      Serial.println(buf);
      // XYZZY: Send an Recovery alarm HERE.
      RouterState = 0;
      digitalWrite(DigitalRouterStatusLEDyellow, LOW);
      digitalWrite(DigitalRouterStatusLEDgreen, LOW);
      digitalWrite(DigitalRouterStatusLEDred, LOW);
    }
  } else {
    if(AdminState == 0) {
      digitalWrite(DigitalRouterPowerLED, LOW);
      sprintf(buf, "Router power is OFF and should be ON!(sensor: %d)", LightLevel);
      Serial.println(buf);
      // XYZZY: Send an alarm HERE.
      RouterState = 1;
      digitalWrite(DigitalRouterStatusLEDyellow, LOW);
      digitalWrite(DigitalRouterStatusLEDgreen, LOW);
      digitalWrite(DigitalRouterStatusLEDred, HIGH);
    } else {
      digitalWrite(DigitalRouterPowerLED, LOW);
      sprintf(buf, "Router power is OFF (sensor: %d)", LightLevel);
      Serial.println(buf);
    }
  }

  // =-=-= Tilt / Oil Level Sensor =-=-=
  TiltSensorRaw = analogRead(AnalogTiltSensor);
  delay(pinReadDelay);

  if(ReverseTiltMode == 1) {
    TiltSensorRaw = 768;
  }
  if(TiltSensorRaw < 512) {
    TiltSensor = 1;
  } else {
    TiltSensor = 0;
  }
  if(TiltSensor == 0) {
    digitalWrite(DigitalOilLevelLED, LOW);
    Tilts = 0;

    if(FluidState == 1) {
      sprintf(buf, "Fluid Level Test: PASS!");
      Serial.println(buf);
      FluidState = 0;
      if(AdminState == 2) {
        AdminState = 0;
        if(SystemState == 1) {
          // XYZZY - Send tilt Recovery trap.
          sprintf(buf, "Fluid levels Restored!, re-activating Power!", TiltSensorRaw);
          Serial.println(buf);
          digitalWrite(DigitalRouterPower, HIGH);
          SystemState = 0;
        } else {
        // XYZZY - Send tilt Recovery trap.
        }
      } else {
        // XYZZY - Send tilt Recovery trap.
      }
      digitalWrite(DigitalRouterStatusLEDyellow, LOW);
      digitalWrite(DigitalRouterStatusLEDgreen, HIGH);
      if(RouterState == 0) {
        digitalWrite(DigitalRouterStatusLEDred, LOW);
      }
    } else {
      // XYZZY - Send tilt Recovery trap.
      sprintf(buf, "Fluid Level Test: PASS");
      Serial.println(buf);
      Tilts = 0;
    }
  } else {
    digitalWrite(DigitalOilLevelLED, HIGH);
    Tilts = Tilts + 1;

    if(Tilts >= MAX_TILT_ALARMS) {
      // XYZZY: need to send an alarm HERE, were out of fluid!! O_O
      sprintf(buf, "Fluid Level Alarm!! Router is out of Oil!");
      Serial.println(buf);
      sprintf(buf, "Disconnecting power to router, pump and heater!");
      Serial.println(buf);
      digitalWrite(DigitalOilLevelLED, HIGH);
      digitalWrite(DigitalRouterStatusLEDyellow, LOW);
      digitalWrite(DigitalRouterStatusLEDgreen, LOW);
      digitalWrite(DigitalRouterStatusLEDred, HIGH);
      Spinner = 0;
      for(i = 0; i < 1000; i = i + 100) {
        if(Spinner == 0) {
          digitalWrite(DigitalOilLevelLED, HIGH);
          Spinner = 1;
        } else {
          digitalWrite(DigitalOilLevelLED, LOW);
          Spinner = 0;
        }
        delay(100);
      }
      digitalWrite(DigitalOilLevelLED, HIGH);
      if(POWER_INTERRUPT == 1) {
        digitalWrite(DigitalRouterPower, LOW);
      }
      SystemState = 1;
      AdminState = 2;
      FluidState = 1;
    } else if((Tilts > 4) && (Tilts < MAX_TILT_ALARMS)) {
      // XYZZY: need to send an alarm HERE, were out of fluid!! O_O
      sprintf(buf, "Fluid Level Alarm! (Tilts: %d)", Tilts);
      Serial.println(buf);
     
      digitalWrite(DigitalOilLevelLED, HIGH);
    } else {
      // XYZZY: need to send an alarm HERE, were out of fluid!! O_O
      sprintf(buf, "Fluid Sensor has moved! (Tilts: %d)", Tilts);
      Serial.println(buf);
     
      Spinner = 0;
      for(i = 0; i < 1000; i = i + 100) {
        if(Spinner == 0) {
          digitalWrite(DigitalOilLevelLED, HIGH);
          Spinner = 1;
        } else {
          digitalWrite(DigitalOilLevelLED, LOW);
          Spinner = 0;
        }
        delay(100);
      }
      digitalWrite(DigitalOilLevelLED, LOW);
    }
  }
 
  // =-=-= Extern Temp Sensor =-=-=
  ExternTemp = getVoltage(AnalogExternalTemp);
  delay(pinReadDelay);
  holdC = (ExternTemp - 0.5) * 100; //Celcius
  holdF = (holdC * 9. / 5.) + 32.;  //returns Fahrenheit

  // Converting from 10 mv per degree wit 500 mV offset
  // to degrees ((volatge - 500mV) times 100)
  // Celcius: ExternTemp = (ExternTemp - .5) * 100;   
  ExternTemp = (((ExternTemp - .5) * 100) * 1.8) + 32;       
  ExternTempF = int(ExternTemp);
  sprintf(buf, "Extern Temp Reading: %d, Hold: %d, HoldC: %d, HoldF: %d", ExternTempF, hold, holdC, holdF);
  Serial.println(buf);

  // Set Exterior temperature LED
  if((ExternTempF < 0) || (ExternTempF > 100)) {
    digitalWrite(DigitalExternalTempLED, HIGH);
    sprintf(buf, "Temperature outside SUCKS!");
    Serial.println(buf);
  } else {
    digitalWrite(DigitalExternalTempLED, LOW);
  }
 

  // =-=-= Internal Temp Sensor =-=-=
  digitalWrite(DigitalInternalTempLEDblue, HIGH);
  digitalWrite(DigitalInternalTempLEDgreen, HIGH);
  digitalWrite(DigitalInternalTempLEDred, HIGH);
  InternTemp = getVoltage(AnalogExternalTemp);
  delay(pinReadDelay);
 // hold = InternTemp;
  InternTemp = (((InternTemp - .5) * 100) * 1.8) + 32;
  InternTempF = int(InternTemp);
  sprintf(buf, "Intern Temp Reading: %d", InternTempF);
  Serial.println(buf);
  if (InternTempF < -10) {
    digitalWrite(DigitalInternalTempLEDblue, LOW);
    digitalWrite(DigitalInternalTempLEDgreen, HIGH);
    digitalWrite(DigitalInternalTempLEDred, HIGH);
    TempAlarms = TempAlarms + 1;

    if((TempAlarms > MAX_TEMP_ALARMS) && (TempState < 2)) {
      // XYZZY: need to send an alarm HERE, Too COLD!! O_O
      sprintf(buf, "Cold Temperature Critical! System freezing up!");
      Serial.println(buf);
      sprintf(buf, "Disconnecting power to router/pump/heater!");
      Serial.println(buf);
      digitalWrite(DigitalRouterStatusLEDyellow, HIGH);
      digitalWrite(DigitalRouterStatusLEDgreen, HIGH);
      digitalWrite(DigitalRouterStatusLEDred, LOW);
      digitalWrite(DigitalInternalTempLEDblue, LOW);
      if(POWER_INTERRUPT == 1) {
        digitalWrite(DigitalRouterPower, LOW);
      }
      SystemState = 1;
      AdminState = 2;
      TempState = 2;
    } else {
      sprintf(buf, "Oil Temperature too Cold!");
      Serial.println(buf);
     
      Spinner = 0;
      for(i = 0; i < 1000; i = i + 100) {
        if(Spinner == 0) {
          digitalWrite(DigitalInternalTempLEDblue, HIGH);
          Spinner = 1;
        } else {
          digitalWrite(DigitalInternalTempLEDblue, LOW);
          Spinner = 0;
        }
        delay(100);
      }
      digitalWrite(DigitalInternalTempLEDblue, HIGH);
    } 
  } else if (InternTempF > 140) {
    digitalWrite(DigitalInternalTempLEDblue, HIGH);
    digitalWrite(DigitalInternalTempLEDgreen, HIGH);
    digitalWrite(DigitalInternalTempLEDred, LOW);
    digitalWrite(DigitalExternalTempLED, HIGH);
    TempAlarms = TempAlarms + 1;
   
    if((TempAlarms > MAX_TEMP_ALARMS) && (TempState < 2)) {
      // XYZZY: need to send an alarm HERE, Too HOT!! O_O
      sprintf(buf, "Hot Temperature Critical! System is burning up!");
      Serial.println(buf);
      digitalWrite(DigitalRouterStatusLEDyellow, HIGH);
      digitalWrite(DigitalRouterStatusLEDgreen, HIGH);
      digitalWrite(DigitalRouterStatusLEDred, LOW);
      digitalWrite(DigitalInternalTempLEDred, LOW);
      if(POWER_INTERRUPT == 1) {
        digitalWrite(DigitalRouterPower, LOW);
      }
      SystemState = 1;
      AdminState = 2;
      TempState = 2;
    } else {
      sprintf(buf, "Oil Temperature too Hot!");
      Serial.println(buf);
     
      Spinner = 0;
      for(i = 0; i < 1000; i = i + 100) {
        if(Spinner == 0) {
          digitalWrite(DigitalRouterStatusLEDred, HIGH);
          Spinner = 1;
        } else {
          digitalWrite(DigitalRouterStatusLEDred, LOW);
          Spinner = 0;
        }
        delay(100);
      }
      digitalWrite(DigitalRouterStatusLEDred, HIGH);
    } 
  } else if(InternTempF < 40) {
    if(TempState == 2) {
      if(AdminState == 2) {
        if(SystemState == 1) {
          SetTempRecovery = 1;
        }
      }
    }
    digitalWrite(DigitalInternalTempLEDblue, LOW);
    digitalWrite(DigitalInternalTempLEDgreen, HIGH);
    digitalWrite(DigitalInternalTempLEDred, HIGH);
    digitalWrite(DigitalRouterStatusLEDyellow, HIGH);
    TempState = 1;
    sprintf(buf, "Its too damn Cold in here! Temp < 40!");
    Serial.println(buf);
  } else if (InternTempF > 100.0) {
    if(TempState == 2) {
      if(AdminState == 2) {
        if(SystemState == 1) {
          SetTempRecovery = 1;
        }
      }
    }
    digitalWrite(DigitalInternalTempLEDblue, HIGH);
    digitalWrite(DigitalInternalTempLEDgreen, HIGH);
    digitalWrite(DigitalInternalTempLEDred, LOW);
    digitalWrite(DigitalRouterStatusLEDyellow, LOW);
    TempState = 1;
    sprintf(buf, "Its too fucking Hot in here man! Temp > 100!");
    Serial.println(buf);
  } else {
    if(TempState == 2) {
      if(AdminState == 2) {
        if(SystemState == 1) {
          SetTempRecovery = 1;
        }
      }
    }
    if(TempState == 1) {
      sprintf(buf, "Exterior tempeature returned to normal range (%d)", ExternTempF);
      digitalWrite(DigitalRouterStatusLEDyellow, LOW);
      digitalWrite(DigitalInternalTempLEDblue, HIGH);
      digitalWrite(DigitalInternalTempLEDgreen, LOW);
      digitalWrite(DigitalInternalTempLEDred, HIGH);
      TempState = 0;
    }
  }
  if(SetTempRecovery == 1) {
    sprintf(buf, "Internal Oil tempeature returned to normal range!");
    Serial.println(buf);
    sprintf(buf, "Starting router/pump/heater power!");
    Serial.println(buf);
     
    TempState = 0;
    TempAlarms = 0;
    AdminState = 0;
    if(SystemState == 1) {
      sprintf(buf, "Tempeature returned to normal range, re-activating power!", TiltSensorRaw);
      Serial.println(buf);
      digitalWrite(DigitalRouterPower, HIGH);
      SystemState = 0;
    }
    SetTempRecovery = 0;
    digitalWrite(DigitalRouterStatusLEDyellow, HIGH);
    digitalWrite(DigitalRouterStatusLEDgreen, LOW);
    if(RouterState == 0) {
      digitalWrite(DigitalRouterStatusLEDred, HIGH);
    }
  }

  if(AdminState == 0) {
    if(RouterState == 0) {
      digitalWrite(DigitalRouterStatusLEDgreen, LOW);
      digitalWrite(DigitalRouterStatusLEDred, HIGH);
      digitalWrite(DigitalRouterStatusLEDyellow, HIGH);
      SleepTime = 1000;
      for(i = 0; i < SleepTime; i = i + 100) {
        if(Spinner == 0) {
          digitalWrite(DigitalRouterStatusLEDgreen, HIGH);
          Spinner = 1;
        } else {
          digitalWrite(DigitalRouterStatusLEDgreen, LOW);
          Spinner = 0;
        }
        delay(100);
      }
      digitalWrite(DigitalRouterStatusLEDgreen, HIGH);
    } else {
      digitalWrite(DigitalRouterStatusLEDgreen, HIGH);
      digitalWrite(DigitalRouterStatusLEDred, LOW);
      digitalWrite(DigitalRouterStatusLEDyellow, HIGH);
      SleepTime = 1000;
      for(i = 0; i < SleepTime; i = i + 100) {
        if(Spinner == 0) {
          digitalWrite(DigitalRouterPowerLED, HIGH);
          digitalWrite(DigitalRouterStatusLEDred, HIGH);
          Spinner = 1;
        } else {
          digitalWrite(DigitalRouterPowerLED, LOW);
          digitalWrite(DigitalRouterStatusLEDred, LOW);
          Spinner = 0;
        }
        delay(100);
      }
      digitalWrite(DigitalRouterStatusLEDred, HIGH);
    }
  }

  sprintf(buf, "SystemState: %d, AdminState: %d, FluidState: %d, TempState: %d", SystemState, AdminState, FluidState, TempState);
  Serial.println(buf);

  for(i = 0; i < 50; i++) {

    ListenForClients();
    delay(100);
  }
}


float getVoltage(int pin) {
  return (analogRead(pin) * .004882814);
}


I finished with the prototype wireless RiderNet setup a few weeks ago and resolved some leaks and other interesting bugs since - its now working 100% and I've start manufactering the other 3 RiderNet routers that I'll need to reach the barn. I attached some photos of the prototype, which ran successfully for a week without problems. I have not yet performed the "Bake-Off/Freeze-Off" tests, those will come in a week or so where I plan to put the prototype in a freezer and then in the oven and test their temperature-compensation ability - that should be fun!

Ridernet_Prototype_Diagrammed.jpg
Ridernet_Prototype_Diagrammed.jpg (544.17 KiB) Viewed 4472 times

Ridernet_Prototype_FrontDoorClosed.jpg
Ridernet_Prototype_FrontDoorClosed.jpg (525.14 KiB) Viewed 4472 times


Attached below are a few screenshots of the prototype wireless router when it was completed and ready for oil testing. I learned alot of valuable lessons about working with mineral oil, acryllic, dd-wrt and most especially Arduino! I'll post more screenshots and information as the project develops - I've been too busy working for work or on RiderTrack/Net to take enough photo's of the process, I'll do better about that. This week is all about mass-producing the last 3 wireless routers and getting ready to finish the server (which is in a clear acryllic case too).

Attached here is a diagram I whipped-up in Fritzing (such a cool name) to show the layout, though I can't get Fritzing to make the PCD or diagram right. Still this will show electronically what I'm trying to do for the wifi routers:

Fritz_RiderNet_WireDiagram.jpg
Fritz_RiderNet_WireDiagram.jpg (445.15 KiB) Viewed 4472 times



All feedback and input are Most welcome! This is my first Arduino project, so I'm still very much a newbie at this. Lastly I would like to thank Ladyada and the folks at Adafruit for all their hard work - I am a regular and happy customer!

Cheers, :D

Kris
Kristopher Kortright
Father, Husband, Horseman, Maker, Writer, Internet Technologist and Inventor of Strange of Useful Things
Supporter of the Open Source Hardware movement

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by adafruit_support_bill on Tue May 10, 2011 12:21 pm

Nice work! Impressive for a first project. :D

adafruit_support_bill
 
Posts: 82451
Joined: Sat Feb 07, 2009 10:11 am

Re: RiderTrack / RiderNet Project

by miax on Tue May 10, 2011 12:25 pm

Thanks! :)

The production units look alot nicer now that I've got the prototype done, I spent the weekend soldering my first PCB's for it (using little wires, I don't know how to make a Real PCB yet). I'll upload those with my next update.

Cheers!

Kris

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by miax on Tue May 31, 2011 7:21 pm

Update:

I finished building all 4 of the outdoor/weather-proof wireless routers over the long weekend - meant to call in and Ask an Engineer about a few things, I'll have to catch em next weekend!

Here is a pix of the final build configuration:

RiderNet_Dev_Complete_53111.JPG
RiderNet_Dev_Complete_53111.JPG (589.63 KiB) Viewed 4401 times


Here's a close-up of my oil-level detector, which uses a Ribbon Sensor from Adafruit attached to a small diving board near the top. The styrofoam and horse-float are light-enough to float on top of mineral oil, but heavy-enough to fall as the oil level drops, thus bending the sensor:

RiderNet_RibbonFloatSensors.JPG
RiderNet_RibbonFloatSensors.JPG (844.38 KiB) Viewed 4401 times


And lastly the combination of network and server front-panels wired to a custom-shield, which sits on an Arduino Mega:

RiderTrack_Server_Connector04.jpg
RiderTrack_Server_Connector04.jpg (432.89 KiB) Viewed 4401 times


Tonight I start the final gluing/caulking to seal each router-up, and tomorrow I'll start filling them with oil for initial leak and function tests.

More to come..

Kris
Kristopher Kortright
Father, Husband, Horseman, Maker, Writer, Internet Technologist and Inventor of Strange of Useful Things
Supporter of the Open Source Hardware movement

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by miax on Tue May 31, 2011 7:31 pm

A few more shots of the PCB boards I've made thus far. Here is a back-view of the network front-panel:

RiderTrack_Server_Net_FrontPanel03.jpg
Back end of the server front-panel PCB
RiderTrack_Server_Net_FrontPanel03.jpg (151.02 KiB) Viewed 4400 times


And here's a back-shot of the server front-panel:

RiderTrack_Server_Net_FrontPanel02.jpg
Back end of the network front panel
RiderTrack_Server_Net_FrontPanel02.jpg (334.44 KiB) Viewed 4400 times


And lastly a picture of the custom shield I made that sits in-between the Arduino Mega and the Ethernet Shield, to which I soldered all of my analog and digital lines into two main cables. For each front-panel I created standard connectors, so that I could attach the front panels and Arduino's easily during final construction.

RiderTrack_Server_Complete03.jpg
Top view of the custom shield and cables
RiderTrack_Server_Complete03.jpg (473.49 KiB) Viewed 4400 times


More to come... All feedback is Most Welcome - I have So much to learn!
Kristopher Kortright
Father, Husband, Horseman, Maker, Writer, Internet Technologist and Inventor of Strange of Useful Things
Supporter of the Open Source Hardware movement

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by miax on Tue Jun 07, 2011 11:05 pm

Update:

Screenshots of the 3 wireless routers on the bench as I hunt-down the last of the micro-leaks (I swear Mineral Oil is the most pervasive liquid in the universe!). I almost have them water-tight.

RiderNet_BenchedNBleeding.JPG
RiderNet_BenchedNBleeding.JPG (455.54 KiB) Viewed 4374 times


A screenshot of 3 sensors made with Adafruit parts and inspiration; Horses will float on the surface of the mineral oil (thanks to the styrofoam block), and will sink if the server starts to loose mineral oil - triggering the alarm. The tilt sensor on the bottom-left will sit at the bottom of the water-cooling tower, next-to the pump inlet. As long as the pump is running, the flow will force the hing upwards and allow the tilt-sensor to close the circuit. If the flow stops, the hinge will fall and trigger the alarm. Lastly are my smiley-float sensors! Using tilt sensors again, this time embedded in a happy styofoam block will normally float at the top of the cooling column with the circuit closed. The wire is suspended from the top and loopped-around in the water so the sensor will float upright - until the water level drops too low and Mr. Happy turns upside down, triggering the alarm.

RiderTrack_Sensors.JPG
RiderTrack Sensors
RiderTrack_Sensors.JPG (335.57 KiB) Viewed 4374 times


Lastly an early-development pic of the RiderTrack server itself (that will reach the internet from the horse barn via the all-weather wireless routers above).

RiderTrack_Server_EarlyConstruction1.jpg
Rider Track early construction stage (note the arduino mega in the middle)
RiderTrack_Server_EarlyConstruction1.jpg (356.1 KiB) Viewed 4374 times


I love the Adafruit store, site and tutorials! Already being a C-coder, its quite exciting to actually "Make Stuff" that works! Without the tutorials and examples, I would have been lost. So many thanks!

Updates to follow..

Kris
Kristopher Kortright
Father, Husband, Horseman, Maker, Writer, Internet Technologist and Inventor of Strange of Useful Things
Supporter of the Open Source Hardware movement

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by miax on Fri Jun 10, 2011 5:13 am

Finally weatherproofed all 4 of the external wireless routers, and plan to deploy them around the farm this weekend. This will open network access between our house (we rent a house on a 50-horse pony club center) and the main barn where the Linux server will be located. One final coat of 100% silicone on the bottom/back-lower sides of these tomorrow to protect the seals and off to the trees they will go!

RT_RoutersWaterproofed_2.jpg
Completed weather-proof wireless routers
RT_RoutersWaterproofed_2.jpg (411.56 KiB) Viewed 4364 times


Each router is packed with goodies from Adafruit:

1x Arduino Mega 2560
1x Arduino Ethernet Shield
2x TMP36 Temperature Sensors (internal and external) .
1x Flex sensor (used in the custom oil-level sensor).
1x Photo cell (positioned over the power-led of the wireless router, telling me it's status).
1x Power Switch Tail (that turns on/off the Pump, Heater and Wireless router if the Arduino detects that the Oil has drained-out or if the temperatures get too high/low).
1x 9v Power Supply (stripped down to it's breadboard).
Xx Lots of hookup wire (I really love the red/black/yellow wire you sell, its Great).

Next updates will be views from the trees and work on the Linux server, which will be fully managed and controlled by Adafruit Arduino gear.

Kris
Kristopher Kortright
Father, Husband, Horseman, Maker, Writer, Internet Technologist and Inventor of Strange of Useful Things
Supporter of the Open Source Hardware movement

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by miax on Mon Jun 13, 2011 7:55 am

Weekend Update #1: Man vs. Mineral Oil

I have come to believe that mineral oil is almost as sneaky as gun oil in terms of getting into places and finding micro-holes! I spent many hours on the weekend tracking down and fixing micro-leaks around the seams and finally fixed them all. Next time I WILL buy small 1.5 gallon aquariums instead of trying to make my own - Dammit Jim, I'm an Engineer, not an Aquarium Builder!

The "engineering" (network in this case) part of the weekend wasn't much fun either - I had to configure-in the last 3 ( of 8 ) wireless routers into the Wireless Distribution Systems (WDS), turning the entire array into one flat class-C network that extends out from each router - so we can go anywhere on the 30 acre site and get wireless. Sounds Great, IS Great once it's working - but configuring it is a pain in the rear. If I wasn't working with Linux (I over-wrote the Netgear bios with DD-WRT), I would go mad. :) They are now ready for deployment to the farm - I pray for luck.

The rest of the weekend was spent getting the sensors and Arduino components wired-into the RiderTrack system and shopping at Adafruit! It's a very nice site to shop in, pictures are all crisp and clear, the details are great, the prices are Good and the service is ... uncommonly excellent. The service and tutorials really hooked me on using Adafruit for all of my micro-controller project needs (except when I have to buy a connector at another shop linked from Adafruit). Much of the new goods will start arriving today and tomorrow for the rest of the RiderTrack system - including the RFID boards/cards - I can't wait! :)

Also saw Ask an Engineer for the first time live this weekend - Very Cool, original show! Keep up the good work!

I'll be putting the routers outside in their eventual permanent locations to confirm the range is good. I'm excited to get these deployed so I can move on to finishing the server and the NFC/RFID stuff!

More picture updates coming soon,

Kris
Kristopher Kortright
Father, Husband, Horseman, Maker, Writer, Internet Technologist and Inventor of Strange of Useful Things
Supporter of the Open Source Hardware movement

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by miax on Wed Jun 15, 2011 8:03 am

A Bad Day - Setbacks and Challenges.

I had expected more from the wireless routers, their range (while very good) isn't giving enough signal strength at the periphery to do the job. I walked about placing them at the strategic points on the farm where I have power and the clearest-line of sight possible. It all worked great and it felt good to grab a DHCP address and hit the web while sitting on a stack of hay bails at the main barn. :) But the reception was crap, the routers were pulling 15-19% at one point, 25-29% at another. That just isn't going to cut it, and after another hour of placing routers at different points and checking for signal strength, it turns out that I'm going to need 2 more wireless exterior/weatherproof routers to cover the distance the network needs to cross..

Then while pondering the costs at home last night of what another 2 routers is going to cost me to build, one of my 4 completed wireless exterior routers started having problems. It looks like the power supply wasn't wired quite right or perhaps a bad solder joint, but it caused the router to power cycle intermittently. Realizing that I had no good way to get at the stuff aside from prying-off the cover (and re-gluing it later - a horrible design flaw that I reluctantly accepted in my rush to get it done quickly, and now paid for that haste). While disassembling the router I had a much better idea of how to build these routers that will provide quick, easy access to all components while still retaining a water-tight, weather-proof seal. It means going back to the building phase to make 6 new outer cases - this will be my weekend.

More updates in 3 or 4 days..

Kris
Kristopher Kortright
Father, Husband, Horseman, Maker, Writer, Internet Technologist and Inventor of Strange of Useful Things
Supporter of the Open Source Hardware movement

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by miax on Tue Jun 28, 2011 9:59 am

It's been a few weeks instead of 3 or 4 days - things have been very busy!

I re-designed the front-panel to make it a little cleaner and remove the sensor mounts so it just handles LEDs. I then used the Mega Protoshields from Adafruit (http://www.adafruit.com/products/192) combined with the Shield stacking headers for Arduino (http://www.adafruit.com/products/85) to create a Mega shield that would also support the Ethernet shield on-top:

RiderNet3_ComponentsReady.JPG
Components complete
RiderNet3_ComponentsReady.JPG (200.89 KiB) Viewed 4260 times


The main function of the shield is to provide 5 pairs of sensor pins that lead to the mounted sensors in/around the router/casing and to clean-up the wiring connections between the Arduino and the front LED Panel. I have to say I really like the Mega proto shield, though I would recommend to Adafruit to add a sentense on the Mega Shield page that mentions it doesn't come with the shield stacking headers, and provide a link to the shield stacking headers for users that need to stack stuff on top. That Adafruit sells both makes it really convenient.

RiderNet3_Stacked.JPG
Stacked Shield combo
RiderNet3_Stacked.JPG (195.02 KiB) Viewed 4260 times


It took about a week to make 6 LED panels and 6 Mega Shields, test them all with temporary sensors (shown above) and get them ready:

RiderNet3_MegaShield.JPG
Mega Shield
RiderNet3_MegaShield.JPG (348.25 KiB) Viewed 4260 times


Now I have to focus on finishing the little aquariums that will hold the new router "slips" - I'll describe/photo those at depth in the next update on the weekend.

All feedback welcome!

Kris

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by brucef on Tue Jun 28, 2011 12:32 pm

Miax wrote:All feedback welcome!

Kris

I expect people aren't interjecting because they don't want to break the flow of your posts; you're doing an excellent job of documenting your project here, it's really fun to read.

The only thing I can think to mention that might possibly be of interest to you is directional wifi antennas (tonnes of good links on Google), which might be useful for some of your remote locations. If you're using default omnidirectional antennas in places where you really want point-to-point connections it may be hard to get a good quality signal through.

Also, based on no knowledge whatsoever, it occurs to me that 2.4GHz (the b/g band, and one variant of n) is in that 'microwaves are absorbed in water' part of the spectrum that we use to make tasty microwave popcorn, which suggests you might have signal issues with rain, humidity or snow. I wonder if the 5GHz band (a, and the other variant of n) might be more useful, although I seem to remember it has a harder time passing through walls and other objects. In your shoes I think I'd be applying some google-fu to antenna issues before final deployment.

Please keep reporting on this project, it looks great!
- Bruce

brucef
 
Posts: 215
Joined: Tue May 03, 2011 4:51 pm

Re: RiderTrack / RiderNet Project

by miax on Tue Jun 28, 2011 12:47 pm

"BruceF wrote:
I expect people aren't interjecting because they don't want to break the flow of your posts; you're doing an excellent job of documenting your project here, it's really fun to read.

The only thing I can think to mention that might possibly be of interest to you is directional wifi antennas (tonnes of good links on Google), which might be useful for some of your remote locations. If you're using default omnidirectional antennas in places where you really want point-to-point connections it may be hard to get a good quality signal through.

Also, based on no knowledge whatsoever, it occurs to me that 2.4GHz (the b/g band, and one variant of n) is in that 'microwaves are absorbed in water' part of the spectrum that we use to make tasty microwave popcorn, which suggests you might have signal issues with rain, humidity or snow. I wonder if the 5GHz band (a, and the other variant of n) might be more useful, although I seem to remember it has a harder time passing through walls and other objects. In your shoes I think I'd be applying some google-fu to antenna issues before final deployment.

Please keep reporting on this project, it looks great!


BruceF,

Thank you! I really do appreciate the feedback and encouragement. :) As a newbie to DIY I make alot of mistakes and still have much to learn!

Your absolutely right about the Antennas, I'll take your advice and do some additional research about them for the project. Funny thing about this very point actually, several months ago as I was in the early stages and just learning about what Arduino was, I found some posts on-line where a guy soldered better Antennas to his router (the same model I have) to extend the range. As I read it I literally thought to myself, "Man that would be cool to have that, but I can't solder those connections.." and completely put it out of mind as an option. :(

Now I realize that with a Hakko 888 (936 Upgrade) from Adafruit, the Panavise, several other tools from the site as well as a month of soldering Arduino projects, I actually think I can do it. :) My experience with Arduino/Adafruit projects has built that much confidence (though I will probably still hose at least one router - lol). Still after reading your post, I think I'll give it a try - as I know your right, it could extend the range considerably. I didn't know about the 2.4GHz note - and people around here make alot of microwave popcorn! :shock: Fortunately it's a dual-band router, so I can run tests and see how good each channel is (I'm using the Netgear WNDR3300 wifi routers running DD-WRT linux).

Cheers and thanks again!

Kris

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by miax on Sat Jul 02, 2011 9:55 am

Friday Update:

I've completed mounting the new Arduino/Shield setup into each router "slip" (as I'm calling them), which is simply a sheet of 5/8" Acrylic to which I mounted all of the hardware. Some of the bits like the LED panel I wanted close to the front of router, so I mounted that on little Acrylic stilts. I came up with this alternative to mounting the hardware inside already-built enclosures, as this method will require no holes anywhere in the router bodies/aquariums, which will both look Much nicer than the crap I made before (above posts) and should be much more waterproof. Most of all if I need to maintenance the routers, I can simply pop the top off, unplug it and pull the entire slip out of the mineral oil, work on it, and "slip" it back in when done. I placed them side-by-side on the table and wired them into one plug strip for testing, this was much more fun than I expected:

RouterSlipsOnTable.JPG
Routers laid out on table
RouterSlipsOnTable.JPG (283.01 KiB) Viewed 4225 times


I did away with the loose hookup-wire and went with some of the 6-wire female/female cables from Adafruit, made the wiring look alot nicer. The new shield is safely hidden underneath the Ethernet shield, with all the wiring working out:

RouterSlipOverPic.JPG
Picture of new router "slips" from above.
RouterSlipOverPic.JPG (334.02 KiB) Viewed 4225 times


The underside of the slips doesn't look as nice, but that will be hidden-away from view when they are mounted outside.

RouterSlipUnderPic.JPG
Picture of new router "slips" from below.
RouterSlipUnderPic.JPG (335 KiB) Viewed 4225 times


I tried my hand at making a small video of the LED blinky light show on YouTube!

http://www.youtube.com/watch?v=J0fuO7O9AHA

Right now I'm nursing hurt-hands from overdoing it while sanding the edges of the router bodies (small mineral oil aquariums), which have smooth edges now and all 12 are ready for gluing (this weekend). I'm also mounting a VFD LCD and one of the new Adafruit temp/humidity sensors outside the router. This one will go in the main barn, so it wont be directly exposed to rain/snow - so I figured it would be nice to have the temp/humidity of the barn displayed on the VFD. I'm also investigating some directional/better Antenna ideas BruceF gave me. I'll take more pics as the router bodies come together.

All feedback is welcome!

Cheers!

Kris
Kristopher Kortright
Father, Husband, Horseman, Maker, Writer, Internet Technologist and Inventor of Strange of Useful Things
Supporter of the Open Source Hardware movement

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Re: RiderTrack / RiderNet Project

by miax on Sun Jul 03, 2011 9:42 am

Loved AAE last night, I think it's the Bomb that there is a weekly venue in which we can ask questions about things we purchased at Adafruit - it really ads alot of customer loyalty IMHO!

With that just a quick update: Got the VFD LCD working with the "showcase" router, REALLY NICE LCD! I had shied away from it for a long while because it was much more expensive than standard LCDs that have double the character rows - but man have I changed my view! I like the standard LCDs I got, but this VFD is so much brighter and easier to read at distance. I don't really even have to "try" as I do when focusing on a regular LCD panel. So shameless plug, this LCD rocks:

http://www.adafruit.com/products/347

Also got the DHT22 working on the showcase router, and have the Temp/Humidity piped to the LCD for folks at the barn to see. :D Now I have to figure out how to add a clock to all this..

More updates to come!

Kris
Kristopher Kortright
Father, Husband, Horseman, Maker, Writer, Internet Technologist and Inventor of Strange of Useful Things
Supporter of the Open Source Hardware movement

miax
 
Posts: 157
Joined: Tue Apr 05, 2011 11:41 am

Please be positive and constructive with your questions and comments.