Thursday, May 30, 2013

Horseshoe nails

Horseshoe nail hooks
and jewelry

"For want of a nail, the shoe was lost;
For want of the shoe, the horse was lost;
For want of the horse, the rider was lost;
For want of the rider, the battle was lost;
For want of the battle, the kingdom was lost;
And all for the want of a horseshoe nail."

- Author unknown
from All Things Crafty

Friday, May 24, 2013

Arduino sketch to read depth/pressure sensor


/*
//depthSensor1B sketch
//analog pressure sensor attached to analog pin
// added VCC measure directly to get better precision
// 1A works well
// 1B cleaned up code to make functions
// also added a DEBUG for Depth Sensor function that can be used if needed by uncommenting


*/

String sketchName = "depthSensor1B";

int pressureDepthPin = 3; // analog pin 3 connected to pressure sensor

float VCC = 5027.00;  // actual measured voltage of VCC in mV
//int analogPressure = 0;


void setup() {
  Serial.begin(9600);
  Serial.print("Program name: ");
  Serial.println(sketchName);
}

void loop() {
 readDepth();

 // Debug routines (uncomment to use
 // Debug Depth sensor
 debugReadDepth();
 
}

//++++++++++++++++++++++ Depth sensor +++++++++++++++++++++
void readDepth() {
    float depth = calculateDepth ();
    Serial.print("Depth = ");
    Serial.print(depth);
    Serial.println(" m ");
 
  delay(500);
}

// Debug depth sensor
void debugReadDepth () {
    float voltageDepthSensor = measureVoltage ();
    Serial.print("DEBUG: Voltage: ");
    Serial.print(voltageDepthSensor);
    Serial.print(" mV ");
    float pressure = calculatePressure();
    Serial.print(": Pressure = ");
    Serial.print(pressure);
    Serial.print(" kPa ");
    Serial.print(": Depth = ");
    float depth = calculateDepth ();
    Serial.print(depth);
    Serial.println(" m ");
}




//****** Depth sensor reading **************************************************
float measureVoltage ()
{
  int analogPressure=analogRead(pressureDepthPin);
  float voltage = (analogPressure*VCC/1024.000);
  return voltage;
}

float calculatePressure ()
{
   int analogPressure=analogRead(pressureDepthPin);
   //analogPressure/1024 to give volts
   float voltage = (analogPressure*VCC/1024.000);
   float pressureReading=(0.04+(voltage/VCC))*250;
   return pressureReading;
}

float calculateDepth ()
{
   int analogPressure=analogRead(pressureDepthPin);
   //analogPressure/1024 to give volts
   float voltage = (analogPressure*VCC/1024.000);
   float pressureReading=(0.04+(voltage/VCC))*250;
   float depthCalc = (pressureReading/100.00)-1.00;
   return depthCalc;
}

CTD construction

Starting on the construction of a conductivity/depth/temperature sensor system.  These CTD systems are used by oceanographers and limnologists to measure chemical parameters in water.  The initial work is based on the SeaPerch project at MIT.  They released a prototype version of a system in 2010 but it appears to have not gone beyond beta testing.
So starting from their hard work, I am going to make some adjustments and hopefully improvements.

The brains are the arduino microcontroller and then I will use an Adafruit Datalogger shield - I am using an old one and Lady Ada now has a more refined and improved shield but that maybe for version 2.
Just like the SeaPerch version, I started with an Otterbox and will use similar sensors except a 10K thermistor from adafruit. I used an array of these thermistors in a chain under the ice for the winter and they worked well.

So first thing is to drill holes for the sensors

Thermister on left 5/32" hole, then two 1/16" holes (1 cm apart) for conductivity probes,
and then a 3/8" hole for the depth/pressure sensor
Drilling holes needs a little jog to keep it all stationary

Tightening the barb for the pressure sensor
Testing the resistanc eof the thermistor before pouring epoxy

Sealing it all with epoxy - tape to protect the watertight seal


Titanium rods are 4cm long

Ventilation with epoxy is essential

Wednesday, May 8, 2013