Freediving depth meter + surf time

Hello,

I would like to make simple freediving app

1) Depth meter
Ive played with that on Suunto Ambit 2
this should be formula which worked with Suunt - (pressure - 1013.25) / (10.26*9.81)

2) Surf time
Time count which start when you reach surface (based on pressure) and should be reseted to 0 once you swim to -1m

I dont have much time to work on it but should start this weekend and will see
  • 1) OK, but I would not show the actual depth until it does not exceed 0,5 m (like most Dive computers)

    2) My Suunto Dive computer resets Surf time to 0 at depth 0,5 m
  • 1) OK, but I would not show the actual depth until it does not exceed 0,5 m (like most Dive computers)

    2) My Suunto Dive computer resets Surf time to 0 at depth 0,5 m


    Yeah that make sense
  • Hi

    First step for making any freediving Applications is to get the depth.
    One problem for calculating depth is, that the barometric pressure, that can be retrived from the sensor API, is not accessible for making datafields.
    But I've come up with a work-around, and that is to use the attitude data from the activity API.
    I've made this work and shared the code a the end of my post. (Use at your own risk :))
    I've tested it on my Fenix3 in the local public pool. The stated depth of the pool is 3.5m. My depth gauge measured 3.46m.
    So the presicion is definetly good enough for me. I'm not sure that happens at greater depths.
    (Maybe I should get it tested in a pressure chamber at a local Watch shop.)
    One thing that doesn't work too well is that it takes about 10 sec for the gauge to settle at the depth. But I guess that the attitude function averages the pressure data using a 10 sec running average, to keep the reading stable.
    Using the pressure gauge for depth wouldn't need this averaging, so I guess that the Depth function could be made more responsive if acces to the un-averaged data were possble.

    I'm going to try and make other freediving datafields, but are also looking forward to your ideas and Developments.

    //! ----- Code begin -----

    //!SimpleDataField
    class DataField extends Ui.SimpleDataField
    {
    var LowestPressure;

    //! Constructor
    function initialize()
    {
    label = "Depth";
    LowestPressure = 6000.00;
    }

    //! Handle the update event
    function compute(info)
    {

    var Pressure = null;
    var AltEQ = null;
    var Calc = null;
    var Depth = null;

    //! Pressure calculated from a formula found on wikipedia and
    //! rearranged in the following form:
    //! Pressure[mBar] = ((1-HeightInMeters/a)^b)*c
    //! Where:
    //! a = 44307.69 (Different value needed in imperial mode)
    //! b = 5.255303
    //! c = 1013.25

    if( info.altitude != null )
    {
    AltEQ = info.altitude;
    Calc = 1 - AltEQ/44307.69;

    AltEQ = Math.pow(Calc , 5.255303);
    Pressure = AltEQ * 1013.25;
    if(LowestPressure > Pressure )
    {
    LowestPressure = Pressure; //! Save lowest pressure for sea-level pressure correction.
    }
    Depth = (Pressure - LowestPressure)*1.02/100;
    //! 1.02 : Water density correction; 1.019 for fresh water or 1.02 to 1.029 for sea water
    }
    return Depth;
    }
    }
    //! ----- Code end -----
  • Hi

    I've just uploaded an updated version for Connect IQ. It should take only a few days before it becomes availabe.
  • Hi

    I've just uploaded an updated version for Connect IQ. It should take only a few days before it becomes availabe.


    It is already available on https://apps.garmin.com/en-US/apps/1121d6d5-596b-4b48-9341-97c3d76fae8f
  • Hi Again

    Now I've also uploaded a "Freediving Maximum Depth Gauge " . I guess it will be availabe within the Next 24h.
  • Hello Miguel,

    Ive finally tested your app and it works great. So far just 5m wish there was no limitation in refresh but I guess there is no other way arround. When you setup custom screen you can get actual depth, max depth and lap/interval time. Lap and interval timer you can reset on surface that way you can check breath up time and dive time :)
  • Hi SEMI666

    I'm glad you like it. :)
    5 meters is also the deepest I've been, so far.
    I'm actually working on a surface-time datafield, the code is written and compiles, but when I install it in the watch, and have selected the datafield for use in an app. Then, when I want to use the app, my Fenix3 somehow replaces the datafield with a "timer"-datafield ...? I'm still trying to figure out what goes wrong. If you've any suggestions to what could be wrong, I'm all ears :confused:
    Initially I thought it was a good idea to make freediving datafields and then you'd be able to configure your own custom made app with them. But now I've discovered that you're only allowed to use two ConnectIQ datafields in an app, which somewhat kill's that idea.
    It would probably be better to make independent app or to make datafields with two or even three sets of freediving specific data in them.
    Another advantage of making an independent app, could be that; app's have access to the sensor class and maybe the data from the raw "sensor.pressure" is faster and with less averaging.
  • Hello Miguel,

    Nice to see the development of you data fields. I have a small question about your depth calculation. Is there e reason why you use the altitude instead of the pressure field from info structure?
  • Hello Miguel,

    Nice to see the development of you data fields. I have a small question about your depth calculation. Is there e reason why you use the altitude instead of the pressure field from info structure?


    He explained in #4:

    "First step for making any freediving Applications is to get the depth.
    One problem for calculating depth is, that the barometric pressure, that can be retrived from the sensor API, is not accessible for making datafields.
    But I've come up with a work-around, and that is to use the attitude data from the activity API."