WetRuler--Measuring Ocean Height
by rabbitcreek in Circuits > Arduino
7121 Views, 46 Favorites, 0 Comments
WetRuler--Measuring Ocean Height
The announcement came early this summer that the area in Alaska called Prince William Sound would be unexpectedly hit by a global warming initiated Tsunami. The scientists who made the discovery pointed to an area of rapidly retreating ice that had left behind a mountain of debris that would slip into a fjord and initiate a 30 foot wave that would eventually hit the town of Whittier. This has happened before, during the 1964 earthquake where shaking initiated multiple tsunamis in the surrounding fjords and devastated the coast including Whittier and Valdez with multiple deaths. Cruise boats already wary from the virus decided not to go near the area and the USFS offered refunds on any cabins that had been rented. A week later a Tsunami warning hit all of our cell phones! An underwater beacon had detected a wave associated with a small earthquake off the coast. All regional towns were told to evacuate if near water. It came to nothing. How do you measure these events? This Instructable details the building of small sensors that are able to measure ocean height and send the data to either a LORA receiver or straight to GSM. The units are compact and seem resilient to their environment and are solar operated. I have tested them here for achieving reproducible tide heights but they could be also used for wave height and Tsunami predictions.
Gather Your Materials
There are two sending units that I built--one involves GSM(cell phone) upload and the other LORA upload. You may also consider interfacing with a Sat beacon since many of these areas do not have cell phone coverage. The sensor at the heart of these instruments is the MS5803-14BA and its use and assembly in different scenarios can be found in these web sites: https://thecavepearlproject.org/2016/09/21/field-... and http://owhl.org. The second of these shows a brilliantly designed remote logger with its own custom designed PCB for long term measurement of wave height. The sensors seemed to be tolerant of water for months to a year depending on setup.
1. MS5803-14BA--you can get these from DigiKey for $13 but you need to do some surface soldering work or get a pre-made breakout board from SparkFun but it will set you back $60. If you DIY it you will need a small Adafruit board to solder it to and some low temp solder gel(140F) that I found helpful. The cavepearlproject has a great tutorial on how to hand solder these--I suggest getting a cheap rework station from Amazon for $30.
2. LILYGO 2pcs TTGO LORA32 868/915Mhz ESP32 LoRa--$27 these are for the LORA box.
3. ARDUINO MKR GSM 1400 $55--this is a great board. It works perfectly with the Hologram sim. Unfortunately I could not get their Arduino Sim to work with their new service in spite of multiple tries. If you still have access to 2GM service you can go with something cheaper but that totally failed up in Alaska.
4. Solar Cells Uxcell 2Pcs 6V 180mA Poly Mini Solar Cell Panel Module DIY for Light Toys Charger 133mm x 73mm $8
5. 18650 Battery $4
6. TP4056--charger $1
7. Switch Rugged Metal On/Off Switch with Green LED Ring - 16mm Green On/Off $5
8. Icstation 1S 3.7V Lithium Ion Battery Voltage Tester Indicator 4 Sections Blue LED Display $2
9. Adafruit TPL5111 Low Power Timer Breakout--brilliant little timing device $6.00
10. N-channel power MOSFET - 30V / 60A $1.75
11. Differential I2C Long Cable Extender PCA9600 Module from SandboxElectronics X2 ($18 each) -- there is some mentioned success with long cables for I2C in the literature but with daily 25 foot tides in Alaska you need long cables...oh yea some cable..I used big box 23 g 4 twisted pair cable suitable for outside.
12. Adafruit BMP388 - Precision Barometric Pressure and Altimeter $10
Build the Sensors
The sensors have to be surface soldered to small PCBs. The two prior works give you some hints about how to do it. I bought both the sensors and the tiny boards from Digikey. Use the low temp solder from Adafruit and dab just the tiniest amount adjacent to the feet of the sensor as you place it on the board. Use a rework blower to melt it into place. I failed to do this well with my hand soldering setup and ended up shorting some of the pads. The rest of the wiring if you check out your leads correctly is easy--putting a small capacitor(0.1n) between the power and ground leads and raising the CS and PSB leads Hi to initiate I2C and control the Address for the sensor. (See drawing) You have two choices 0 X 76 Hi and 0 X 77 for Lo. I used both to form a sensor wand with the sensors placed one foot apart to give the pressure differential of whatever your measuring. I designed a 3D printed housing for the sensor to allow it to be totally encapsulated in clear epoxy. The mouth of the cone mount perfectly fits the tiny stainless neck of the sensor and sealed placement is accomplished with a tiny ring of superglue which hold it in position and seals it for epoxy encapsulation.
Downloads
3D Print Your Housing
The two main housings for GSM and Lora are the same with side panel inserts for the solar panels. The only mod for the Lora was the antenna hole at the top which has to be drilled depending on the diameter of your unit. The GSM antenna fits inside the other box. The control panel in each is identical with holes for the ON/OFF and pushbutton to turn the battery level screen on. The feet are printed separately and superglued on to the cases at the corners and provide various mounting options. The small turret and screw cap are glued around the opening for the microUSB mount to protect it from water incursion. The unit is basically very water-resistant and printed in PETG to minimize heat distortion. I used heat inset brass screw mounts in the main housing for 3mm screws in the case. There are files for two mounts for the sensors--one has two sensors mounted a foot apart on a wand of lucite plastic with a mount for the I2C "booster" box with the circuit mounted and epoxied on the inside. This wand also has two 3D printed holes to accommodate mounting options. The other sensor housing is a single puck with one of the sensors screwed into it and a cutout in the back for the I2C "booster" epoxied into it. All of these are printed in PETG. The remaining files are the tiny housing for the Lora receiver unit with small window for the OLED. https://www.thingiverse.com/thing:4581608
Wire It
The sensors are wired in parallel with the SDA lines, SCL lines, Pos and Gnd all joined into one twisted cable with four conductors. The I2C boosters are very easy to use--attaching both sensors to the input lines and the intervening long cable up to 60 meters attached to the same type of receiver unit. If you go longer you may have to change the pull up resistors on the boards. The wiring diagrams for the rest are above. The circuit works by on/off switch sending power to the Adafruit TPL5111 which is set for 57 ohms to turn its Enable high every 10 minutes--you can of course adjust this for less or more data transmission frequency. This controls a MOSFET on the ground of the main board (either Lora or the Arduino 400 GSM) . (I have found boards like the GSM and ESP32 have too big a power draw for the TPL unless you use a MOSFET with them...) Power for the sensors and the BMP388 comes from the main board when its on: 3v. The pull up resistors are on the I2C boosters and you don't need them for the sensors on this circuit. The charging board TP4056 works great with the two solar panels and the 18650 battery attached. The pushbutton just connects the battery output to the small battery level screen. The two sensors attached to the lucite wand use up the two available addresses including the address of the BMP388 (0 X 77) so you must connect the BMP with SPI to the main boards if you are using two water pressure sensors. If you are using only one(the puck) you can connect it with I2C and use the remaining available address(0 X 77) for the BMP.
Build It
I used perf boards to mock everything up. The main board TPL, BMP all went on one board. The switches were screwed into place with their rubber grommets. The charger board mounts on the outrigger of the control face plate with the microUSB facing out. The water protection turret was superglued to the front and the screw cap was sealed with some silicon grease on the threads. The lucite wand was cut out of two layers of 1/4 plastic with the sensors mounted exactly one foot apart. The 3D printed hole mounts were placed on the ends and the I2C booster was screwed in the middle where all the wire connections were made. The puck sensor was 3D printed and the booster epoxied inside and wired up to the one sensor. A hole was drilled in the top of the Lora unit to accommodate the antenna and holes were placed in the back of each unit to accommodate the wire from the sensors A 3D printed wire hold-down is provided. Zip tie the wire to it after supergluing it in place. All wire connections are marine heat shrunk and then painted with liquid electrical tape for water security.
Program It
There really isn't much to the program. It relies heavily on the libraries provided for the sensors---which work perfectly and the miracle of the GSM Blynk software for the Arduino board which meshes perfectly with the Hologram Cloud. Sign up for a Hologram account and get a SIM card from them to place in your Arduino 400 GSM board. The handshaking process is all handled by the Blynk--GSM Arduino library. Adafruit wrote the library for the BMP and I used the SparkFun library for the MS5803. Both supply outputs of temperature from your sensors if you want. Software adjusted pins can use just about anything on the main board. I used the Blynk timer routine so as not to accidentally overload the Blynk app. You have of course to be careful with the amount of data you put through the GSM-Hologram link or you can run up a small bill--not to much--it used about 3MB a week which comes to about 40 cents. I was uploading only the three pressure measurements -- 2 from underwater and one from the case(BMP). The last part of the program is turning off the TPL by raising to HI the done pin on the unit that says the data was transferred. The Blynk app is wonderful as always and you can design any sort of output screen you want and the best part is the ability to download your data pile by email anytime you want.
The Lora unit uses the same libraries and uses an OLED unit ( I turned this off in the software of the sender unit to save energy) and sets the frequency for your particular location. It then builds a data string with separators that allow it to send your sensor readings in one shot. It then activates its done pin to shut down. The receiver unit breaks up the word and sends the information to the Blynk app over an always on WIFI link. The receiver is incredibly small and plugs into a wall wart.
Using It
The tiny sensor face picks up with a high degree of accuracy all the pressure force on it from above--this includes all the air and water pressure. So intermittent changes in ocean height--like waves and changes in the air pressure from storms above the ocean all effect it. That is the reason for including the Barometric Pressure sensor in the case (make sure you provide a couple tiny air holes to allow it to read correctly) . The sensor wand with the two sensors is anchored in the ocean at a depth where it will still be covered by water even at low tide. It is arbitrary at what depth you place the sensors as they will be only measuring the change in the height of the water column above not the absolute height. I used a brick as an anchor with a rope attached to mount the sensor wand a couple feet off the bottom. A float was attached to the upper pole of the wand to hold the sensors in their foot apart vertical orientation. The twisted pair wire and the rope led to a dock where they were tied off with lots of slack to accommodate the tide excursion. The GSM sender unit was mounted on a nearby boat. Monitoring took place over a month. The two sensors gave readings consistently separated by 28 units which represented the pressure difference in a foot of water at that location. The barometric pressure was subtracted from the lower sensor data and divided by 28 to give a foot equivalent of the rise and fall of the ocean surface over 10 min periods. The chart above gives the comparison to the NOAA chart for the same date period. The actual rise and fall sensor/feet was checked against the actual movement of the dock and found to be accurate to 1/2 inch. Even with the high energy use of GSM transmits every ten minutes the solar panels easily kept up with demand in this dim rainforest environment.
More
The prior uses of these sensors by the sources already mentioned were for studying wave height. My results were from a calm harbor with minimal wind driven wave activity but you can capture that data by increasing the sampling frequency and having rolling averages of the results. The Lora system works well at distances that would supply a mesh network of wave information for multiple locations along a coast. This would be ideal for those interested in surf activities The low cost and very small size of these independent units would make fleshing out of coastal information an easy task. Currently tide information capture is a very complicated and infrastructure dependent government activity, but this may change with adoption of alternative devices. Blynk is now programed to notify me of the next Tsunami!