Build A SAS

Building Your Own SAS

an image
This sub-surface automated dual water sampler (SAS) was designed, created, and tested by researchers at NOAA and the University of Miami to enable researchers to study water chemistry on shallow reef habitats to further our understanding of conditions in coral reef ecosystems. The SAS was also designed to minimize some of the financial hurdles present in marine research by acting as a low-cost open-source alternative to other existing automated water samplers. To do this we used free design software, 3D printed unique components, and built the "brain" of the sampler from a Teensy microcontroller. The Teensy is compatible with the Arduino IDE and it's simplified version of C++, making futher development and changes to the code easier for people not well-versed in computer coding. The open-source design will continue to be developed and improved on by NOAA and University of Miami researchers, and any updates will be made available on this website. This site is meant to serve as an exhaustive resource for any group to build, program, deploy, and troubleshoot their own water samplers. The build and operation manuals can be downloaded here, along with the sampler code, 3D printing design files, laser cutting files, and circuit board design files.

Start Building

Below you will find 5 sections that provide detailed information on how to build a sub-surface automated dual water sampler. The sections are:

1. Resources and materials needed
2. Building the waterproof housing
3. Setting up the motors and motor mounts
4. Building the internal armature
5. Building the circuit board
6. Putting it all together

Important downloads

Resources and materials needed

The SAS is meant to embrace simplicity in its design, so no extensive background in circuitry or engineering is required to build your own; however, there are some tutorials that might prove useful in introducing skills to novice builders such as soldering, 3D printing, laser cutting, or circuit board milling. If a builder intends to edit parts of the design, an introduction to a CAD program could prove useful as well.

The grant that funded the SAS project also funded construction of a workspace at NOAA’s Atlantic Oceanographic and Meteorological Lab (AOML) for prototyping this and future marine research equipment. This Advanced Manufacturing and Design Lab (AMDL) includes multiple stereolithography (SLA) 3D printers, an automated circuit board milling machine, a laser cutter, and a pressure chamber, all to allow rapid prototyping in-house. These tools can get expensive and would be cost-prohibitive to most groups; however, there are alternatives to making all the components yourself, with many online businesses available to order parts from using the SAS design files. To make sure this build process is functional for both large and small budgets the build guide will begin with a list of all the components that were made in-house along with alternatives to personally making these parts, followed by a list of all parts required. At the time this website was created the cost of building one SAS, production equipment notwithstanding, is $213.34.

3D Printed Components

All of the 3D printed parts that were made in-house were first designed in OnShape’s cloud-based CAD software. It’s worth noting that OnShape offers a free account for students and educational institutes and has excellent customer service, online tutorials, and webinars to reduce the learning curve for a CAD program. The parts required for the SAS were printed on a Formlabs Form2 SLA printer. The need for waterproof components required that the SLA method be used over the more traditional fused deposition modeling. At the time this manual was written the cost for a Form2 kit is $3,350 and a 1 liter cartridge of the standard resin used for this project costs $149. For builders new to 3D printing Formlabs also has excellent online resources and tutorials for understanding SLA printing. If access to a SLA printer or the purchase of one is unrealistic, parts can be ordered online through sites like or, or through the OnShape compatible company i.materialise. The cost of printing the parts necessary for one SAS in-house, as figured by the price of the resin required, and not including the cost of setting up a 3D printing lab, is $37.01. Those components are listed below and the 3D printing file for each part can be downloaded from the website and used to print identical parts or sent to a manufacturer for production.

3D Printed Components List

● (3) Endcap

● (2) Motor Mount

● (2) Motor Mount Adaptor

● (1) Internal Frame

● (2) 4mm pump head roller carriage

Laser Cut Components

The one laser cut part for the SAS is the quarter inch clear acrylic face plate. The laser used at OCED is a Boss LS-2436 150W. The cost of this laser at the time this manual was written is $13,000.00, as such, if this isn’t a tool available to the builder, a CNC machine could also be used to cut the part from stock acrylic, a local Makerspace may be able to cut the part, or it can be ordered from a company online like The vector file for cutting the face plate or ordering an identical part can be downloaded from the website. To create an identical faceplate the part should be cut or milled out of 1/4 inch clear acrylic, the black lines in the vector file should be full cuts, and the red lines should be engraved to 1/64 inch deep. The vector file is scaled in millimeters. The cost of the material for the face plate is $0.50.

Laser Cut Components List

● (1) Acrylic Face Plate (Testing the sampler housing for leaks will require 3 face plates)

Milled Circuit Board

The double-sided circuit board in this design is where the majority of the electronics are mounted. It can be milled on a desktop milling machine, like an Othermill, using the Gerber files that can be downloaded here, or it can be ordered. The benefit of ordering the part rather than milling it in-house is that it’s typically more cost-effective, the circuit board comes out cleaner, and the components can be ordered soldered in place to save time. One option for ordering the circuit board online is a company called Seeed Studio. Using the files downloaded for the circuit board design, and the following board specifications, the circuit board alone, or the assembled circuit board can be ordered from Seeed Studio.

Seeed Studio Board Specifications:

Base Material: FR-4 TG130

No. of Layers: 2 layers

PCB Dimensions: 61.85 mm x 43.65 mm

No. of Different Designs: 1

PCB Thickness: 1.6 mm

PCB Color: Black

Surface Finish: HASL

Minimum Solder Mask Dam: 0.4 mm↑

Copper Weight: 1 oz.

Minimum Drill Hole Size: 0.3 mm

Trace Width / Spacing: 6/6 mil

Blind or Buried Vias: No

Plated Half-holes / Castellated Holes: No

Impedance Control: No

To order the circuit board assembled, the BOM (Bill of Materials) and the Assembly Drawing files needs to be uploaded on the Seeed website as well. The circuit board will be received with all the necessary components installed except for the Teensy 3.5 microcontroller, the temperature breakout board, and the RTC coin cell battery holder. These parts are not included on the Seeed Studio order to avoid complicating the process and to keep costs down. To have the Teensy 3.5 installed it would need to be sourced separately and sent in advance to Seeed Studio for installation, and the cost per unit goes up significantly if more than one side of the circuit board is being soldered. If the board is ordered from Seeed Studio assembled, then the parts listed on the BOM are not needed in the list of parts to order below.

Parts to Order

The majority of the parts for building the SAS housing can be purchased at a hardware store while most of the electronic components are easily ordered online. The total cost of purchased parts for one SAS is about $175. Something worth noting is that sourcing parts for the SAS project was limited to our approved vendors, which excluded online resale shops and online marketplaces (e.g., Having access to these types of stores could considerably reduce the cost of many of the SAS components. Below is a comprehensive list of all the parts not made in-house that are required to build a SAS, and each is hyperlinked to the store the part was ordered from. Where necessary, extra information is included to highlight the necessary part specifications since many different sources for purchasing these parts online or in stores exist.

List of Hardware Needed

List of Specialty Items Needed

List of Electronics Needed

Tools Needed

Building the waterproof housing

Prepare the parts

an image

Image 1

Print and cut all parts listed in the 3D Printed Components and Laser Cut Components lists in the Resources and materials section above.

Take the three end caps and use sand paper to sand away any tabs and roughen the surface on the inner walls of the cap (See Image 1). All of the surfaces to be attached with epoxy or other adhesives will be sanded first to improve adhesion.

an image

Image 2

an image

Image 3

an image

Image 4

Cut the 2” PVC Schedule 40 piping into one 6.75” long section and two 2.25” long sections. Sand the first inch or two of the outer edge of each piece of PVC as well as the lip of the piping to help the adhesives bind (See Image 2). Also sand the inner edges of the PVC Tee fitting. Use a cloth or paper towel moistened with isopropanol to clean off all sanded areas on the PVC and 3D printed components and allow to dry (water can be used instead of isopropanol but more care will be needed to ensure the sanded areas are clean). Check the depth of the PVC piping on the PVC fitting and the 3D printed caps (it should be about 1.4” on the PVC Tee and 0.6” on the cap) and put a strip of tape on the sections of PVC to keep the edges of the glued and epoxied areas clean.

Apply PVC primer to the insides of the two opposite PVC Tee fitting holes and to one side of each of the two inch long PVC sections. Apply PVC cement to the newly primed areas on the PVC Tee fitting and the two inch PVC sections and push the PVC parts into the fitting until fully inserted giving a quarter twist. Stand up the newly cemented PVC fitting and weight the top section to add pressure to the parts, clean up any excess PVC cement and remove tape, and then leave to cure for at least 15 minutes. Next add PVC primer to the inside surface of the middle PVC Tee fitting and one side of the longer PVC section (See Image 3). Add PVC cement to the same surfaces and then push the PVC section into the fitting until fully inserted giving a quarter twist. Stand up the PVC Tee and weight the top section to add pressure to the parts, clean up any excess PVC cement and remove tape, and then leave to cure for at least 2 hours for a full cure.

an image

Image 5

an image

Image 6

an image

Image 7

The 3D endcaps will be epoxied onto the free ends of the PVC sections using a two-part epoxy. Be cautious to not get epoxy on the O-ring face of the endcap as that could create problems making the housing watertight later on. Ensure proper mixture of the two-part epoxy (See Image 4) and then add epoxy to the corner of the entire wall of the inside of one of the endcaps and along the lip and upper edge of one of the short PVC pieces (See Image 5). Smooth out the epoxy to ensure consistent coverage across the inner walls of the endcap and the outside end of the PVC pipe. Push the two pieces together until the PVC is fully inserted giving a quarter twist to remove any gaps in the coverage of the epoxy. Make sure the tabs of the endcap are oriented at 45 degree angle from the long PVC section so that the body of the housing doesn’t get in the way of accessing the tabs (See Image 6). Be careful not to let the endcap shift in position or slide off the PVC section. Clean off any excess epoxy from both the outside and the inside edges of the endcap and then flip the housing over. Use the same method to epoxy an endcap to the opposite free PVC section. With both endcaps on, stand the PVC frame up with one endcap on a flat surface and the other pointing up. Again, clean off any excess epoxy. Place a weight on the raised endcap to apply pressure to the PVC/endcap joins (See Image 7), remove the tape, and leave for 18-24 hours for a full cure.

After the epoxy on the first two endcaps has cured use the same method described above to epoxy the third endcap onto the free end of the long PVC section. Clean off any excess epoxy and then stand the PVC frame on the new endcap, weight the top to apply pressure, then remove the tape. Leave for 18-24 hours for a full cure.

Testing the housing for leaks

Once the adhesives are all fully cured the housing can be checked for leaks using three of the acrylic faceplates. Install four #6-32 x 1 inch long stainless steel screws into each of the endcaps in the threaded tabs. Lightly lubricate the three -227 O-rings with a silicone lubricant and install one into each of the three endcap O-ring grooves. Remove the plastic layer from the side of the laser cut acrylic face without the scored circle in the center. Place an acrylic face plate onto the mounting screws on each endcap, plastic layer facing out, and secure using four #6-32 lock nuts.

Please note, to create a watertight seal the nuts only need to be hand-tight and the O-ring will visibly deform and seal against the acrylic. Overtightening the nuts can break the 3D printed endcap, or the acrylic face plate, or both.

Place the now sealed housing into a bucket of water and hold beneath the surface or weight it down. Look for any streams of bubbles escaping the housing as an indicator that water is getting in and the housing is leaking. When you remove the housing look for any signs of water intrusion inside the housing. If there is a leak, determine where it is located. Leaks on the epoxy may be repairable by adding a line of epoxy to the edge of the endcap/PVC connection. Leaks at the O-ring/acrylic seal may be evidence of a damaged O-ring or dust, hair, or another particle on the O-ring or in the O-ring groove preventing a proper seal.

Setting up the motors and motor mounts

Attaching the adaptor

an image

Image 8

an image

Image 9

an image

Image 10

To mount the 12V 170RPM Econ Metal Gearmotor in the sampler it needs to be attached to the 3D printed motor mount adaptor. Use sandpaper to roughen the top of the body of the motor (See Image 8A) and the inside surface of the adaptor. Use a cloth or paper towel dipped in isopropanol to clean off the sanded surfaces of the motor and the adaptor and let dry. Put a bead of two-part epoxy around the top of the body of the motor and around the inside of the adaptor. Push the motor into the adaptor giving a full turn and stop so that the flat end of the adaptor is flush with the motor face (See Image 8B). Clean off any epoxy that has made it onto the face of the motor, keep the motor and adaptor face flush, and let the epoxy cure for 18-24 hours before using the motor.

Wiring the Motors

Remove the last 1/2 inch of the insulated sleeve from one end of a 15” length of each red and black 22 AWG wire and twist onto the positive (red) and negative (black) terminal on the back of the motor. Solder the wires onto the terminals and cover with a 1/2 inch of heat shrink tubing for added stability. On the opposite end of each 15” wire remove the last 1/8 inch of the insulated sleeve and connect a KK crimp terminal. Install the crimped wire into a 2-hole female KK connector with the red wire on the left side (See Image 9). Repeat for the second motor.

Mounting the Motor

The motor mount needs to be sanded smooth before being used. Starting on the outside face of the motor mount (the side without the X-ring groove), use a rough sandpaper to sand the surface until it appears uniform and smooth. Using a high grit (e.g. 600 grit) wet/dry sandpaper, wet sand the inside edge of the motor mount (See Image 10A). Once the surface seems uniform and smooth, clean and dry the motor mount. Lightly lubricate the -007 X-ring and install into the X-ring groove on the inside of the motor mount. A pen cap, screw head or any other small object without sharp edges can be used to push the X-ring into place and ensure it sits flat in the groove. Once the X-ring is installed push the shaft of the motor into the X-ring so that the motor and adaptor are flush to the inside wall of the motor mount. Holding the motor flush to the motor mount, use four #4-40 x 1/2" screws to secure the motor (See Image 10B). Again, only tighten screws hand-tight. Overtightening screws may strip the holes or break the 3D printed motor mount.

Check for water tight seal again

an image

Image 11

To ensure the seal on the housing is water tight with the addition of the motor mounts, install the motors into the two short sections of the PVC housing (See Image 11A). The motor wires will need to be led through the housing to open end of the long PVC section. A simple way to do this is to tape a light weight to the end of the wires so gravity will pull the wires through to where they will later connect to the main circuit board and power source. The O-rings on the endcaps should all be lightly lubricated and the motor mount should only be tightened to hand-tight to create a water-tight seal and prevent breakage. If the acrylic face plate was removed from the endcap on the long section of the housing it should be replaced and secured again as described in the previous water test. Using freshwater, hold the housing underwater and look for any streams of bubbles. If any water enters the housing examine all O-rings and X-rings for dirtiness or signs of damage. If water does enter the housing and the motors become wet, remove from the housing and allow to dry thoroughly before using to prevent damage to the motors.

To install the 3D printed roller carriage for the pump heads, open the two unsealed pump head and remove the existing carriage wheel. Carefully pull apart the carriage wheel, remove the rollers and place on the 3D printed roller mount, and clip the shaft and rollers back into the original top piece of the carriage wheel. Using a synthetic lubricant, heavily lube the back of the carriage wheel and the rollers (See Image 11B) and then reinstall into the pump head. To mount the pump head onto the motor line up the flat edges of the motor shaft and the pump head shaft housing and then install the shaft into the pump head. Make sure that the pump head lines up with its outline on the motor face mount and then secure in place with two #6-32 x 1 1/8" screws (See Image 11C).

A step that will be useful when using the sampler later on is to label the housing next to the pumps “A” and “B” using a permanent marker or a waterproof label. This will help ensure that the pump is connected to the correct terminal and that the calibration settings for each pump are accurate. Similarly, labeling the KK connectors on the motor wires will also makes it easier to connect the pumps properly when that time comes.

Building the internal armature

an image

Image 12

an image

Image 13

Use a rough sandpaper to sand all surface of the 3D printed internal frame to smooth out surfaces and remove any resin tabs. Make sure that the face of the frame, where the OLED, IR sensor, and reed switch are mounted, is sanded until smooth and uniform, then use a high grit wet/dry sandpaper to wet sand the face of the frame further. Clean and dry the frame.

Remove only the center circle from the plastic layer on the laser cut acrylic face plate (See Image 12). Coat the face of the frame with a small amount of clear acrylic solvent cement and press the frame face onto the inner circle of the acrylic face plate, being careful to line up the frame face with the boundaries of the circle and the openings in the frame face with their matching shapes on the acylic. Weight the frame in place to create pressure on the frame/acrylic join and let the adhesive cure for 18 to 24 hours. Afterwards remove the plastic layer on the outer edge of the acrylic face plate and the smaller pieces inside. It may be necessary to use tweezers to remove the inner layers.

If the frame is not well lined up with the face plate during gluing the armature may not be able to be inserted into the housing fully.

an image

Image 14

Insert the Reed switch into the space on the face of the frame (See Image 13). Attach the reed switch using two #6-32 x 1/8 inch long screws. All components installed into the 3D printed frame should be no more than finger tight to avoid damaging threaded holes or the frame. Cut the wires of the Reed switch to be about four inches long and remove the last 1/8 inch of the insulated sleeve. Attach KK crimp terminals onto the ends of the two wires and plug the wires into a 2- hole female KK connector (the order does not matter).

Insert the Reed switch into the space on the face of the frame (See Image 13). Attach the reed switch using two #6-32 1/8 inch long screws. All components installed into the 3D printed frame should be no more than finger tight to avoid damaging threaded holes or the frame. Cut the wires of the Reed switch to be about four inches long and remove the last 1/8 inch of the insulated sleeve. Attach KK crimp terminals onto the ends of the two wires and plug the wires into a 2-hole female KK connector (the order does not matter). Insert the OLED into the space in the face of the frame, taking care to orient the screen properly and making sure it sits flat in the space (See Image 14), then attach the OLED to the frame using two #2-56 x 1/8 inch long screws at opposite corners. The OLED has a glass screen which is easily cracked if tightened too much, so only screw in the screen until there is some resistance, less than hand-tight.

Use a flat edge to bend the pins of the IR sensor at a right angle to the flat back of the sensor. Clip the pins so they’re 1/3 of an inch long. Lightly coat the outside edges of the sensor in two-part epoxy and place into the IR sensor hole in the face of the frame (See Image 14). A small piece of tape can hold the sensor in place while the epoxy cures for 18-24 hours.

Install the power connection

Remove 1/8 inch of the insulated sleeve on a four inch length of red 26 AWG wire. Solder the end of the wire onto the free positive terminal on the 9 volt dual strap (See Image 15) and add ½ inch of heat shrink tubing onto the solder to strengthen the connection. Route the new red wire through the upper left hand hole and push the dual strap into position in the battery compartment of the frame (See Image 16).

The original black and red wire should be led through their respective channels in the frame to the outside of the battery compartment. The dual strap should be secured using two #2-56 x ½ inch long screws and two #2-56 nuts. Strip the last 1/8 inch of the insulated sleeve of each of the 3 wires and attach a KK crimp terminal to the end. Install the wire terminals into a 3-hole female KK connector with the new red wire (6 volts) on the outside edge, the original red wire (12 volts) in the center, and the original black wire (negative) on the inside (See Image 16). A piece of heat shrink, a ziptie, or a piece of tape can be wrapped around the set of wires to keep them together.

To make connections for the OLED and the IR Sensor take the seven different colored 26 AWG wires and strip 1/8 inch off each end of the wires. On one end of each wire attach a DuPont female crimp pin, on the other end of each wire install a KK crimp terminal. Plug four of the wired KK crimp terminals into a 4-hole female KK connector and plug the other ends (with the DuPont pins), in the same order, to a 4-hole DuPont connector housing (See Image 17). Plug the KK crimp terminals of the other three wires into a 3-hole female KK connector and the three DuPont pins in the same order to a 3-hole DuPont connector housing.

an image

Image 15

an image

Image 16

an image

Image 17

Building the circuit board

All of the components for building a SAS circuit board.

Image 18

an image

Image 19

To better understand the design and function of the SAS circuit board prior to construction, the schematic and diagram in Image 19 can be examined to trace the track of the circuit between components and compare it with the board's layout. Understanding the circuit isn't crucial to construction of the SAS but it is helpful to perform advanced troubleshooting or alter the open-source design for other purposes.

With a home milled circuit board vias must be installed and soldered into the board. If the circuit board is purchased online the vias are likely already installed. To install the vias, take 1 inch long sections of wire filament and place through each of the 1/64 inch via holes and bend in half to keep in place (See Image 20). Any wire filament from discarded wire, like the excess from the reed switch can be used for this task. Once all via wires are in place, solder them to the board being careful to heat both the wire and the copper of the circuit board to prevent cold solders that might break up conductivity. It’s easiest to solder all the via wires on one side of the board before flipping it over to solder the others. Using flush cutters remove any excess wire and solder from the vias.

an image

Image 20

an image

Image 21

an image

Image 22

Install the header pins for the Teensy 3.5 and flip the board over and solder the header pins to the board, being careful to keep the headers straight up and down so that the board fits (See Image 21). To double-check, flip the board back over and place the Teensy on the pins to see if any are out of alignment. Remove Teensy for now, it will be the last piece to be soldered to the circuit board.

Use a flat edge to bend the pins of the resistors and diodes at right angles. Install the resistors to the board and solder the top of each of the resistor pins. While direction of the resistors is unimportant, placement is, so be sure to double-check the location of each resistor before installing (See Image 22). Keep the resistors as low to the board as possible to save space. Install the diodes with the cathode (gray stripe) facing the outer edge of the board (toward the motor connection) and solder the pins onto the board. Direction with diodes is very important so be sure to double-check that they are installed in the correct orientation (See Image 23). Flip the board over and solder the other side of the resistor and diode terminals and then use flush cutters to remove excess pins and solder.

an image

Image 23

an image

Image 24

an image

Image 25

Install the male KK connectors onto the top of the circuit board (See Image 24) and flip the board over. Be sure KK connectors are installed straight up and down and then solder the pins to the board.

an image

Image 26

an image

Image 27

Use a flat edge to bend the pins of the Mosfets at a right angle. Install the Mosfets into the top of the board and solder the pins in place (See Image 25). Flip the board over and solder the pins into place on this side as well, then, use flush cutters to remove excess pins and solder. As with all the board’s components, be careful to heat both the board and the pins to ensure a good solder connection to avoid function and conductivity issues later on.

On the bottom of the board install the header pins for the temperature breakout board. Flip the board over and solder the header pins in place. Use flush cutters to remove excess pins and solder. Flip the board back over and solder the four indicated pins of the temperature breakout board to the header pins (See Image 26). Use the flush cutters to remove any excess pins and solder.

Install the RTC coin cell battery holder into the bottom of the board. Flip over the board and solder the battery holder pins in place. The short pins of the battery holder can make it difficult to get a good solder connection between the holder and the circuit board. To verify that the solder was done properly install a coin cell battery and use a voltmeter to verify current traveling between the two newly soldered pins. The next step will cover these pins with the teensy, so it’s important to check proper installation before moving on.

Place the Teensy microcontroller in position on the pins on the top of the board and carefully solder the pins (See Image 27). Use caution not to touch any of the other components of the Teensy which might damage the function of the board.

Prepare the microSD card

The Teensy 3.5 microcontroller can log data on a microSD card inserted in the Teensy’s microSD slot. This is where the general settings for the sampler will be stored and where all the data will be recorded, including temperature, time and date of pump alarms firing, and codes for sampler troubleshooting. For the microSD card to communicate with the Teensy properly, two blank text files need to be uploaded to the card prior to using it. The two text files should be titled “dataLog.TXT” and “sampleParam.TXT”. On the sampleParam.TXT file type the following three lines of code to input initial settings for your water sampler:

1,10,10,100,1 1,0,1,1,18 1,15,1,1,18

Once the text files have been added to the microSD card it can be inserted into the slot on the Teensy.

Install the sampler code to the Teensy 3.5

Follow the instructions on the Teensy website to setup both the Arduino and Teensy software on your computer. Be sure to download a version of the Arduino software that is compatible with the Teensy software (e.g. Arduino 1.8.8).

Once both the Arduino and Teensy software are installed, download the code for the SAS and place it into a new folder within the Arduino libraries folder, found in the Arduino folder in the Documents folder. The folder the code is placed in needs to match the name of the code for it to work with the Arduino software. For example, if the code file is named "brainV2B.ino", name the folder "brainV2B".

Next, the necessary Arduino libraries need to be added to allow the SAS code to function properly. Run the Arduino software and select the Sketch menu. Select "Include Library" and then "Manage Libraries" and the Library manager window will pop up. Search for "Adafruit_MCP9808 library" in the search bar and install the most recent version of the library. The installation process will place the library in the same Documents folder as the SAS code. Next search for the library called "SdFat" and install the most recent version. The last library required for the SAS code should already be installed. Open up the "hardware" folder inside the Arduino folder and then go into the "teensy" folder, open up the "avr" folder, and then the "libraries" folder. Look for the "Adafruit_SSD1306" folder. On a Mac the Arduino icon can be selected with a right-click to bring up the drop menu, then select "how Package Contents", the "Contents" folder, "Java" folder, "hardware" folder, from which point the process is the same as described above.

Once the Adafruit_SSD1306 folder is found, or placed into the libraries folder, open the Adafruit_SSD1306.h file with a text editor (e.g. Notepad or TextEdit) and scroll down to the following line:

--------------------------*/ // #define SSD1306_128_64 #define SSD1306_128_32 // #define SSD1306_96_16 /*========================*/

The default setup will be the 128 x 32 bit screen resolution. The SAS resolution needs to be 128 x 64 bit. To fix this, uncomment the 128 x 64 bit screen resolution by deleting the two forward slashes in front of SSD1306_128_64 and add two forward slashes in front of SSD1306_128_32 so it looks like this:

--------------------------*/ #define SSD1306_128_64 // #define SSD1306_128_32 // #define SSD1306_96_16 /*========================*/

Once finished, save and close the text file. The last step in preparing the code for use is to edit the code for the SAS's sleep mode. This code minimizes the amount of current draw while sleeping so the SAS can be deployed for long periods of time. The following edits allows sampling alarms to be set in advance for a larger range of time (years rather than weeks). In the same Libraries folder as Adafruit_SSD1306, open the folder labeled Snooze and then the folder labeled Utility. Use a text editor to edit and save these two files: SnoozeAlarm.h and SnoozeAlarm.cpp. In SnoozeAlarm.h find the line near the bottom of the document that looks like:

void setRtcTimer( uint8_t hours, uint8_t minutes, uint8_t seconds );

Change that line to:

void setRtcTimer( uint32_t hours, uint32_t minutes, uint32_t seconds );

In SnoozeAlarm.cpp find the line near the top of the document that looks like:

void SnoozeAlarm::setRtcTimer( uint8_t hours, uint8_t minutes, uint8_t seconds ) {

Change that line to:

void SnoozeAlarm::setRtcTimer( uint32_t hours, uint32_t minutes, uint32_t seconds ) {

The SAS code is now ready to be uploaded onto the Teensy microcontroller. Open the Arduino software, also called the Arduino Integrated Development Environment (IDE), and select the Tools menu. Select "Board:" and choose Teensy 3.5; this step is necessary the first time you open Arduino so the program knows which type of microcontroller is being programmed. From the File menu select "Open…" and navigate to the Arduino library folder, where the SAS code was saved, and open the code file. When the code has opened on the Arduino IDE click the verify button to compile the code for uploading to the Teensy. Once the code is compiled the Teensy program (Teensyduino) will automatically open. Connect the Teensy to the computer using the micro USB port. Under the Arduino Tools menu go to "Port" and choose the serial port that the Teensy is plugged into. Press the tan reboot button next to the microSD card slot on the Teensy (See Image 19) and then click on the upload button on the Teensy program to upload the SAS code to the Teensy. Once the upload is complete the circuit board is now ready and can be connected to the sensors and the screen to verify its function.

Typically when the Teensy is plugged into the computer for the first time it does not appear as a serial port option until after a file has been uploaded. If no serial port is available, complete all of the other steps above and, once the SAS code is uploaded, a serial port should then be available on the Arduino program. To ensure the code was loaded properly, push the reboot button on the Teensy again and re-upload the SAS code. This should only be necessary the first time a Teensy microcontroller is connected to a computer.

Putting it all together

an image

Image 28

an image

Image 29

an image

Image 30

Place the circuit board into the armature with the battery and temperature breakout board down. The coin cell holder and the temperature breakout board will stick out of the frame slightly through their customized openings. Put on the circuit board cover and secure in place with the #2-56 x 3/4 screw. The screw head will be flush with the lid and the tip of the screw will just start to exit the back of the armature. Attach the KK connectors to the board for the Reed switch, IR sensor, and OLED (See Image 28). Reverse the wire order for the OLED by twisting the wires and then plug the 4-hole DuPont connector onto the OLED pins. Plug the 3-hole DuPont connector onto the IR sensor pins in the same order as it's KK connector. Insert the microSD card. Finally, attach the KK connector for the battery connection.

Note that attaching the power before the OLED, IR sensor, and Reed switch might interfer with the function of those components, so always attach the power last.

Fill two of the 4AA battery packs with fully charged batteries and insert battery packs into the sampler to snap into the 9-volt dual battery strap. The battery pack below the power connection to the circuit board should always be plugged in first (see Image 29) followed by the second battery pack. The sampler will turn on automatically, ready for programming using the IR remote. Looping a rubber band under the battery packs and hooking it on the power connection hardware will help ensure the batteries don't disconnect from the 9-volt connector if the internal armature gets jolted. Attach the two motor KK connectors to the circuit board. The connection for Pump A is on the left and Pump B on the right. Slide the complete armature into the housing (See Image 30) and secure with four #6-32 lock nuts.

Making the Neoprene Sample Bags

Cut the neoprene according to the dimensions in Image 31 (the dimensions are shown in mm). Then fold the neoprene along the depicted dotted lines. Next fold the neoprene in half and install grommets in the two top corners of the bag (See Image 32). Each sampler requires two of the neoprene protective bags. A Tedlar sample bag should be placed in the folded contours of the protective bags with as few creases as possible. The valve of the Tedlar bag comes out of both holes in the neoprene to secure the neoprene flap. Attach a six inch length of Tygon tubing from the outflow of the pump to the stem of the Tedlar bag valve using the neoprene slits to secure the tubing and minimize valve movement during deployment (See Image 33).

an image

Image 31

an image

Image 32

an image

Image 33

For instructions on programming and deploying the sampler please refer to the SAS Operation Manual or visit the USE A SAS page.