DEVELOPMENT OF A WIRELESS PRESSURE SENSOR MODULE TO CONVERT THE MOBILE PHONES INTO DIVE COMPUTERS

Diver carried computers are basically designed to measure the depth and time and provide safe ascent profiles in order to avoid decompression sickness in divers. All of the units in the market are based on embedded systems where the user cannot reprogram the units except entering limited number of dive parameters such as the content of cylinders and the conservatism of the computation. An innovative system is designed and patented by the authors for implementing a diver carried computer using a mobile phone inside a pressure and waterproof housing in combination with an external microcontroller based electronic module. The aim of this work is to communicate the design of the key component of this system which is the external module built in order to measure pressure and temperature data and send them wirelessly to the mobile phone. The external module compartment is placed adjacent to the mobile phone compartment. The impermeability is provided by two successive o-rings. A double lock system is used to prevent the external module and the mobile phone compartment from breaking apart underwater. The external module collects data from its sensors and peripherals and put them together into a so-called frame. This frame is transmitted to the mobile device using wireless communication (Wi-Fi or Bluetooth) and analyzed by the mobile device when received. This functionality is ensured by a minimalistic electronic design that includes a microprocessor, an oscillator, Wi-Fi module (IEEE 802.1x protocol) or Bluetooth, resistors and capacitors. The module is tested and benchmarked successfully with 7 existing dive computers in the market up to 42 m in open water conditions. The system has the advantage of rapid model implementation and deployment, ability to run multimodel decompression procedures, user specific screen layout through the application of “skins”, very large data logging capacity and all the advantages of mobile phones including sending post dive SMS messages in case of preset rules for emergencies, automatic wireless transfer of dive logs to research centers via internet and/or to dive center management services. Future projects target the use of photo and video recording, music and film playing capacities of mobile phones to entertain divers during long decompression stops as well. This platform is further expandable with additional modules to capture a wide variety of information such as oceanographic parameters like salinity, conductivity and dissolved oxygen.


INTRODUCTION
Recreational SCUBA diving has become a mass leisure activity engaging millions of divers worldwide.The age of electronic has arrived with the development of the modern electronic dive computer as the most significant advancement in self-contained diving since the invention of the Aqualung by Jacques Cousteau.A dive computer is basically a submersible digital depth gauge that predicts a safe ascent in order to avoid Decompression Sickness (DCS).Decompression Sickness (DCS) is believed to be due to gas bubbles formed in the tissues and circulatory system after an excessive reduction in the ambient pressure (Elliott and Moon, 1993).
The first approach to avoid DCS was to tabulate "safe" decompression profiles in form of "Dive Table ".The tables were designed basically for square depth-bottom time profiles followed by staged decompression or decompression with a fixed ratio.DCS is modeled and preventions on designing safe ascent schedules were designed as early as 1908 (Boycott et al., 1908).However, they need continuous improvements on safety even today (U.S. Navy Diving Manual, 2016).An example of US Navy Air Decompression Tables is given in Figure 1.The use of tables is still valid for military and commercial diving areas; however, typical recreational diving cursion involves multilevel and repetitive dives.The conservative use of dive tables was challenged firstly by alog computers allowing the estimation of inert gas exchange at each dive depth and allowing more bottom time.ey were followed soon by digital dive computers.The most important advantage of these computers is that they llect real-time pressure data and they theoretically calculate the amount of nitrogen dissolved in tissues according actual depth of diver.As the result, they are more effective than dive tables.Digital dive computer's function ay include measurement of tank pressure, ambient temperature, theoretical computation of acute oxygen isoning as well (Azzopardi and Sayer, 2010).The photos of some modern dive computers are given in Figure 2. On the other hand, all of the units in the market are based on embedded systems where the user does not have access to an operating system, and have limited programming options except entering limited number of dive parameters such as the content of cylinders and the conservatism of the computation, Consequently, actual dive computers can be defined as automatized gauges rather than "real computers" as their functions cannot be expanded and their algorithms cannot be assessed or altered according to different needs.Users have no possibility to use the data they store in computers for example with different algorithms and prepare post dive reports.
Research has been conducted to implement a diver carried computer using mobile phones protected in a pressure and waterproof housing (Dalış Bilgisayarı Tasarımı ve İmalatı; The Scientific and Technological Research Council of Turkey TÜBİTAK Project).Communicating wirelessly with an external microcontroller based electronic module equipped by sensors, the phone is able to collect data about ambient pressure and temperature.The decompression App developed for IOS and Android mobile phone can use these data to provide safe decompression profiles and some other useful information to divers (DepthMonitor App available at Google Play and iTunes).It can also benefit from mobile phone features in emergencies for sending automatic post dive messages, Global Positioning System (GPS) to mark dive locations and data storage capacity for dive logbook and photos.This system has been patented (Patent TR2009 02025B) and commercialized (Cep Telefonu ve PDA Tabanlı Dalış Bilgisayarlarının Üretim Altyapısının Geliştirilmesi ve Ticarileştirilmesi Projesi-Small and Medium Enterprises Development Organization of Turkish Science, Industry and technology Ministry) under the name "Divephone" as a groundbreaking alternative to dive computers.The aim of this work is to communicate the design of the key component of this system which is an external module built to send pressure and temperature data to the mobile device wirelessly.

MATERIAL AND METHOD
High frequency RF communication is not widely used in underwater applications.RF signals are attenuated to a great extent underwater.Therefore, the effectiveness of the signals is diminished.The following equation shows the changes of this attenuation; α = 0.0173 √(fσ)I (1) The equation where α is attenuation in dB/meter, f is frequency in hertz, shows that attenuation increases as frequency rises and finally σ is conductivity in mhos/meter.This shows that low frequency transmission should be used for the underwater applications.

Practical Approach
In order to avoid the attenuation problem, two PDA devices are used to test the operation of short range Bluetooth and Wi-Fi transmission underwater.Two devices are put into the sealed boxes and file transfer over Bluetooth between two devices tried to be established.One of the devices is set as the sender whereas the other one is set as the receiver.First, two devices are located by 1-meter distance to each other.It is observed that no transfer could be established.When the distance set to less than 10 cm, the transfer could be established.This distance depends on temperature and salinity as well.In Figure 3, photos of the experiments on Bluetooth transmission underwater are given.Based on the results of the tests, it seems that reasonable to conclude that high frequency RF transmission underwater over a short distance is possible.There are two types of modules one of which is Wi-Fi to be used with iOS based mobile devices such as iPhone, iPod touch.The other one is Bluetooth to be used with Android based mobile devices.

Mobile Phone Housing
The housing is used to protect the mobile device from water under pressure and to carry the external module beside the mobile device.It has; • Rectangular shape with 118x61 mm internal dimensions • The housing internal size is determined with respect to the iPhone 4/4S; thickness +5 mm, height +2.5 mm which is 16 mm.
• A transparent window topside of the dry compartment enabling the user to see the screen of the mobile device clearly • A double lock cover system uniting the external module with the mobile device compartment • A soft laying preventing the mobile device from being sketched and getting loose into the housing • A ring (or a hole) to attach the system to the diver's gear • Slots for strap enabling the diver to put the system on this arm • Rated to 75 m (tested to 117.5 m) The photo of the system's mobile phone housing is given is Figure 4.The housing's window for mobile device's screen is to be made by polycarbonate.It is mounted to the housing by multiple screws.The polycarbonate is demountable to be changed by a new one if broken.The user is able to see the mobile device's screen easily when the temperature measured between 0°C (32°F) and 60°C (140°F).The PDA compartment of the housing is sealed with o-ring and lock system.The closing system includes a secondary locking mechanism

Wireless Module Design
The main aim of the external module is to send dive data to the mobile device wirelessly.There are two types of modules one of which is Wi-Fi to be used with iOS based mobile devices such as iPhone, iPod touch.The other one is Bluetooth to be used with Android based mobile devices.As shown in Figure 5, the external module has, • An independent housing/compartment rated to 75 m (tested to 117.5 m), such that if it is flooded the housing of the mobile device will not be affected.
• 3x5 cm dimensions • Battery compartment with cover to allow the user the user for replacement of the battery In addition to the mechanical and electronically parts, the following components are the parts soldered separately, • An integrated pressure and temperature sensor • Wet contacts • Battery The external module compartment is placed adjacent to the mobile phone compartment.The impermeability is provided by two successive o-rings.A double lock system is used to prevent the external module and the mobile phone compartment from breaking apart underwater.The lock system is designed not to get cause entanglement.The external module checks for the wet contact every 180 seconds.If the contact is cut, it returns to sleep mode after the next check.Upon wakeup, the external module shall begin to sense the pressure (depth), temperature and send the data by IEEE 802.1x protocol to the mobile device.The external module's circuit design is given in Figure 6.The battery compartment of the external module has no opening to the mobile device compartment so that the mobile device compartment is not affected in case of leaking.In addition to this, each module has a Serial Number, buried inside the cover of its housing.

Communication Protocol and the External Module Firmware
The purpose of the communication protocol between the external module and the cell-phone is to transmit the measures of the module to the mobile device with the best speed, reliability and safety of communication.The external module collects data from its sensors and peripherals and put them together into a so-called frame.This frame is transmitted to the mobile device using wireless communication (Wi-Fi or Bluetooth) and analyzed by the mobile device when received.A frame is made up with data collected by the module and some additional data in order to help the mobile device application to read the frame.In order to ensure that every data (frame) sent by the module will be properly received and read by the mobile device, the mobile device must send an acknowledge signal.This is a frame sent by the mobile device to inform the module a frame was properly received.If the module doesn't receive any acknowledge, it keeps sending the same frame to make sure the mobile device will receive it.Meanwhile, it stores the new frame to be sent into its flash memory (buffer) to send them later.

Frames
It would be wise to describe all the frames.Frame structure is the base idea of the mobile devicebased sensor development board.New frames can be specified and included into the monitoring system.

Pressure sensor frame
The pressure sensor frame contains the measures of the pressure sensor.Namely the pressure value (mbar) and the temperature.Time is the time the frame was generated by the module, in second.Time is an unsigned short that starts from 0 at the start-up of the module and counts the seconds.The maximum count of Time is 65535.Temperature is coded as a signed Integer on two bytes (short).Its unit is 0.01•C.Its range is from -327.68•C to 327.67•C.The diagram of the pressor sensor frame is shown in Figure 7. Pressure is coded as a float (four bytes).Its unit is 1bar and its precision is 0.00001bar = 0.01mbar = 10μbar.Its range is infinity.For instance, if the HEX value received is: "40 08 93 9F", then its decimal float value is 2.13401 which makes 2.13401bar.

Battery frame
The battery frame contains the ADC values of the Battery level acquisition and the of the +3V3 Line level acquisition.Time is the time the frame was generated by the module, in second.Time is an unsigned short that starts from 0 at the start-up of the module and counts the seconds.The maximum count of Time is 65535.The diagram of the battery frame is shown in Figure 8.

RESULTS
The Divephone basic module is tested and benchmarked successfully with 7 existing dive computers in the market up to 42 m in open water conditions and in dry chamber.Considering that one of the most critical concerns is the correct data collection form external module, the wireless communication between the modules and the mobile phone were tested and were proven to relay data without loss for Wi-fi and Bluetooth communication protocols.In Figure 11, a photo of the system used by a diver underwater is given.In Figure 16, another diver with the system is diving in İstanbul Aquarium.

Algorithm Validation Tests Results
The system, both pressure (and depth) measurement and application algorithm for providing a safe ascent schedule are tested by comparing with trusted dive computers widely used in diving community.One can found a variety of methods to algorithm validation (Huggins, 2006), (Lippmann, and Wellard 2004), (Blogg et al. 2004) and safety assessment (Sayer et al. 2016) of dive computers.For validating the Divephone system, we compared No-Deco limits and ascent schedules calculated by our system and various dive computers in markets.In Figure 17, an example for algorithm validation test form can be seen.In this for, the No-Deco Limits calculated by two decompression models of the system are compared with Suunto Vytec (Suunto -Vantaa, Finland) and Oceanic Veo (Oceanic Worldwide -San Leandro, California, United States).The No-Deco Limits calculated by both decompression models are consistent with the values calculated by the two different computers used as benchmarks.As the result, the system collects pressure and temperature data from external module and runs the decompression algorithms without any problem.Wide screens of PDAs inform the diver about current dive parameters and decompression plan effectively and the warnings are noticed easily.

DISCUSSION
Twenty-five years after modern day dive computer introduction, several key questions remain surrounding the decompression models used, validation and human testing, acceptable risk, limitations, failures, and operational reliability mainly due to the lack of cooperation between dive computer manufacturers and scientists (Lang and Brubakk, 2009).The system described in this communication offer a better platform for such cooperation.The system has many advantages against conventional dive computers.First of all, it is flexible as it allows rapid model implementation and deployment.The algorithms and user interface can be altered quickly with some programming adjustments.The system has the ability to run multi-model decompression procedures, user specific screen layout through the application of "skins", very large data logging capacity using external SD Cards and all the advantages of mobile phones including sending post dive SMS messages in case of preset rules for emergencies, automatic wireless transfer of dive logs to research centers via internet and/or to dive center management services.
Future projects target the use of photo and video recording, music and film playing capacities of mobile phones to entertain divers during long decompression stops as well.The platform is further expandable with additional modules to capture a wide variety of information such as oceanographic parameters like salinity, conductivity and dissolved oxygen.Consequently, it can be used not only for safety and comfort of divers but also as a convenient data collecting and processing device for underwater scientific studies.

Figure 4 .
Figure 4.The housing of the mobile phone.

Figure 7 .
Figure 7. Diagram of pressure sensor frame

Figure 8 .
Figure 8. Diagram of battery frame

Figure 9 .
Figure 9. Diagram of message frame

Figure 10 .
Figure 10.Diagram of some message definitions.

Figure 11 .
Figure 11.The system during a dive in Sharm el Sheik (Egypt)

Figure 14 .
Figure 14.The display after entering to decompression.

Figure 15 .
Figure 15.A logged dive sent by e-mail.