Create depth alarm function