CTDizzle Mk 2

Now with more lights!

I’ve added some code that will make the OpenCTD a little more user friendly when used in the field. There might be times when a computer is not accessible, so I have set the Qduino to display different LED colors if certain conditions are met.

I have also integrated an RTC into the unit, so timekeeping is now kept even when main power is removed. I anticipate that a fully charged battery could keep the unit running for a little over 50 hours. I might be able to increase this by turning off the LED on the Atlas EC EZO. Or by using a bigger battery. No luck with a reed switch yet.

I have ordered parts from McMaster Carr and will hopefully have another case built by the end of next week. With some luck, it should be able to go down to 50m without the use of mineral oil.

Cheers!

Posted in OpenCTD | Leave a comment

CTDizzle Mk 1

Introduction

I was first introduced to the concept of the OpenCTD while out at Station Papa this summer. After a long day deploying a mooring (followed by a midnight CTD cast), I deliriously purchased the necessary parts. Two weeks later, I arrived back home and excitedly began construction.

My initial plan was to follow along with the Oceanography for Everyone – OpenCTD Build Guide step-by-step, but as materials and tools became available I tweaked my build a bit. If you are interested in building your own OpenCTD, I highly recommend that you follow their instructions. If you are looking for information here, take the remainder of this post with a grain of salt and learn from my mistakes.

While out at Station Papa, several coworkers and I spent the better part of an hour debating what would be an appropriate name for a CTD. We all agreed on CTDizzle.

Mistakes

I’ll admit I made the mistake of not reading the OfE guide completely through prior to purchasing the parts and I ended up with a few that I didn’t need. My first major mistake was setting up the entire thing to run through the Arduino Uno R3. I was able to get my bench tests to run without issue, but on my very first trial, as soon as the CTD hit the water surface, both the temperature and conductivity sensors did not report correctly to the SD card. I traded a few emails with the OfE team and discovered that the Uno has some crosstalk issues between pins. This may have contributed to the issues I experienced. I switched to the Qduino Mini without having to make any major changes to the build. The Qduino is a great choice simply for its ability to act as a battery charger.

Crappy breadboard setup.

Breadboard test setup with the Uno. Here the Shield 3.0 acts as the SD module.

I decided not to use the 3D printed cap provided by OfE. Instead, I used a variety of pvc fittings found lying around the farm and work. The downside to this is that CTD now has more areas for potential leaks and the sensors are not protected. I have done my best to seal those areas, and did not experience any leaks during my initial surface test, but I will likely not deploy the CTD past 25 meters in the future. I am currently contemplating ways to protect the sensors.

I also did not use three DS18B20 temperature probes and opted to use just one. I don’t really have a valid reason for this. Mostly laziness during the pressure housing construction.

I also fried my first MS5803 pressure sensor by applying 5v instead of 3.3v. Oops.

Pinouts

20161009_140213

Qduino Mini after soldering.

My first attempt at soldering everything ended in frustration. I attempted to clean up each pin as best I could, but there was still a significant amount of left over solder. Despite the ugly solder job, everything worked with no issues, so I decided to leave everything as is.

Sunfounder SD Card Module – Qduino
CS – D5
MOSI – D16
SCK – D15
MISO – D14

20161009_140006

Sunfounder SD Card Module connected to the Qduino.

Sparkfun MS5803 – 14BA Breakout Sensor – Qduino
SDA – D2
SCL – D3
MS5803 Sparkfun Webpage and Datasheet

20160814_180843

O-ring around the metal cap of the pressure sensor. The manufacturer recommends use of an o-ring, but does not specify a size. I scrounged up a size 70 o-ring that seemed to do the trick.

DS18B20 Temperature Sensor – Qduino
Data (Yellow) – D6

A 4.7k resistor bridges the data and Vcc pins. In my build, I opted to do this connection along the wires themselves instead of at the pins on the Qduino (as seen in the OfE guide). My solder job for this portion may explain the occasional false value that the temperature probe reports.
Sparkfun DS18B20 Webpage and Datasheet

HI-7632 Conductivity Sensor – Atlas EC EZO
Gray – PRB1
Green – PRB2

This is highly dependent on the type and brand of conductivity sensor that you choose. Use a multi-meter to test for continuity. In my case, it was the gray and green wires of the probe that worked with the electrodes. The order the wires were connected did not matter. The sensor would still work if the wires switched PRB connections.

20160813_145521

Backside of the Atlas EC EZO.

Atlas EC EZO – Qduino
TX – D8
RX – D9

20160813_145506

Front of the Atlas EC EZO.

The neat thing about the OpenCTD is that majority of the parts can be purchased through Amazon and Sparkfun.

Coding 

The guys at OfE have already pieced together the code necessary to get an OpenCTD up and running. It can be found in their build guide.

I started this project with no experience coding in Arduino. After a couple months playing around with the Arduino IDE, I can confidently say that I still have no idea what I am doing. Things just magically happen to work after a few attempts (and curse words).

You can find sample code for the sensors on the manufacturer webpages. To learn more about how each sensor worked, I downloaded the sample code to play around with. It was very informative. I considered adding a date/time line to the output text file, but that would require the user to change the date in the code for each deployment. That might not always be feasible. If the data were to be analyzed in conjunction with another data source, a timekeeping function would be beneficial.

The Atlas EC EZO requires calibration prior to deployment. I found it easiest to download the sample code from Atlas, which allows you to interact with the circuit through the serial monitor. You can do things such as change the sampling rate, name the circuit, and perform a calibration.

Building the OpenCTD

My first regret is not taking more pictures during the build process.

Using a micrometer, I measured the diameter of each sensor and drilled the corresponding holes into a 3″ pvc cleanout cap. My placement was not perfect, but there was ample space between each hole to accommodate the sensors. I used a small amount of hot glue to lightly hold each sensor, and then used 2-ton marine epoxy to make sure things were really secure. Over the course of several days, I added a generous amount of epoxy and allowed it to cure.

20160814_184819

20160814_184829

I then glued the cleanout cap to a 3″ cleanout-to-female threaded adapter using PVC glue. I  filled the cap with 2-ton marine epoxy just below the top of the conductivity sensor.

20161009_14065720161009_140445

I cut a 10″ section of 3″ pvc and glued a male threaded fitting on one end and a female threaded fitting on the other. Using even more 2-ton marine epoxy, I covered the internal and external seams.

20161009_140741

20161009_140719

The sensor cap of the CTD can then be threaded to the male side of the main body, and a threaded plug can be installed on the female end. Teflon tape or thread paste is used to aid in leak prevention. My version allows for the main body of the CTD to be removed and replaced if necessary. I opted to build it this way so that cleaning and the replacement of parts would be easier.

20161009_140643

I made a few mistakes along the way, but I learned a lot and really enjoyed the build process. The idea behind the OpenCTD is to aid students and citizen oceanographers with data collection for their own projects while maintaining a cheap price point. Overall, not including my mistakes, I spent roughly $325 for a semi-functioning CTD. Some of that cost was in purchasing items that can be used over multiple projects, such as heatshrink, epoxy, and wire. I absolutely believe the OpenCTD can be a useful tool in an educational environment.

First Official Test of the CTDizzle Mk1 – 11 October 2016

To deploy the CTDizzle Mk1, the cap with sensors is screwed on to the main housing. The battery is then hooked up to the Qduino and turned on. Immediately, the Atlas EC EZO should signal that it is sampling by alternating between a cyan and green LED. The main housing is then filled with mineral oil. Mineral oil is a non-compressible fluid and will ensure that the OpenCTD does not get crushed at depth, and it also serves as a leak indicator.  After it is filled with mineral oil, the screw plug is installed and the device is now ready for deployment.

On 11 October 2016, the CTDizzle Mk1 was sent down to 25m for its first official depth test. Unfortunately, I was unable to witness this event. I can happily say that it did not experience any leaks. However, the recorded data shows a number of issues.

At roughly 20m depth, the CTD stopped recording data. I am not entirely sure why this happened. After opening it up, power was still supplied to the Qduino and the Atlas EC EZO was still sampling. I suspect that at some point the SD card may have moved ever so slightly, and thus was unable to receive input. I may change the code to have the Qduino flash a red LED if a connection to the SD card cannot be made.

For the data that was recorded, temperature and pressure both looked good. Conductivity did not record properly and was significantly lower than it should have been. I think this might be a combination of a bad calibration, the rate at which the conductivity probe is capable of sampling, and the delay I have placed in the code. I will look into this in the coming weeks.

If I had to give the CTDizzle a grade for performance, I think I would give it a B-.  The results were not quite what I expected, but it worked in some aspects. There is room for improvement. I think in its current state, it would be more suitable for in-situ deployments instead of profiling.

Things to Try Out on the Next Build

On my next build, I am going to attempt to build a pressure case that does not require the use of mineral oil. Schedule 120 pvc might be thick enough to slot for an o-ring. The downside to this is that construction will require the use of a lathe or other tools not readily accessible to others.

I found the HI-7632 conductivity probe to be a little problematic. I was unable to purchase the probe through Amazon and purchased it directly from the Hanna Instruments online store. If you decide to purchase the HI-7632, I suggest that you purchase the probe with the elongated body, as potting the sensor will be much easier then. I think I might cough up the extra cash and purchase an Atlas Scientific Conductivity Kit. It includes the probe, EC EZO, BNC connector, and conductivity solution for calibration. My experience with the Atlas EC EZO was extremely positive, so I can imagine that there would be no issues with their conductivity probe. Additionally, Atlas offers a fitting that would make installation easier and might reduce the amount of epoxy needed for potting. It would be greatly beneficial to be able to replace sensors should they break.

Atlas Scientific also offers thermowells that protect temperature probes from high pressure and flow. It might be something to consider if sending the OpenCTD to greater depths.

Turning off the device without having to open it every time would be a huge benefit. I may try to add a reed switch into the mix.

OpenROV uses a similar depth module that also includes compass, roll, and pitch measurements. Their version includes an acrylic case for potting and may aid in waterproofing the electronics further. Unfortunately, it is double the price of the Sparkfun MS5803. It might be worth it to find a similar case for the Sparkfun sensor.

Update: 03 November 2016

Last weekend I presented a poster at State of the Coast that detailed my progress. Apart from my general inability to interact with people, I think it went well.

I purchased parts for a second CTD a couple weeks ago.  Arduino recently released some updates for existing boards, and after the update I didn’t realize that the Arduino IDE had reset and made the Arduino Yun the default board. The Qduino and Yun communicate a little differently, and because I didn’t catch the change right away, I ultimately bricked my second Qduino. Oops.

I tested all the new parts on the Uno and everything seemed to work just fine. This time I went with the more expensive Atlas Conductivity Kit. It was a breeze to calibrate. I tried tossing a reed switch into the mix and the EZO didn’t seem to like that too much.

I’ve also spent some time over the last week sketching up a possible case design. The main body would be made of delrin, and the caps would be similar to those used on the WETLabs ACS (one flooded during the last Endurance Array turn and I had to take it apart, I swear).  Drill a few holes into one cap for the sensors, and a hole in the other for a purge plug, and you have yourself a brand new CTD. Construction is going to be a bit tough as it will require the use of the lathe at the OOC. I wanted to avoid this, but the resulting case, in theory, should be good to use at greater depths without the use of mineral oil. The CTDizzle Mk2 should be ready for its first depth test just after Thanksgiving.

I also think this one will be a lot prettier than the first one.

This will be a continually evolving page as changes are made and new information is made available. 

Posted in OpenCTD | Leave a comment