Anchor chain calculator

Overview

This project started when my sailing boat s.y Elmadam need to measurement the depth of anchor. I use often a nature harbour when sailing and  anchor too!

Before this measurement system I didn’t know when anchor will come up position when take up when  standing near steering wheel.

Now there is Hall- sensor measurements rounds under the shaft of windlass. The knowledges transfer to Picaxe 08M2 chip for analysis and results will shop on OLED- display near steering wheel outside on deck.

Materials

Picaxe 08M2 chip

Hall-sensor e.g  Melexis MLX90316

Magnetic, which have poles on horizontally

Picaxe 16×2 Oled display

3- wires cables for hall-sensor and display unit

Some metal or plastic box for chip

Program file

’************** ANCHOR DEPTH MEASUREMENT *************************

’ Using in s.y Elmadam since summer 2017. Works fine

’            Design 10.5.2017      OH1TV and OH1XFE       185/2054 bytes

’—————————————————————————–

’Hall sensor MLX90316 in 5 volts out 0,5 – 4,5v

’Picaxe 16×2 AXE133Y OLED display

’Picaxe 08M2

’——————————————————————————

’PINS Picaxe-08M2

’Pin1 = V+  = +5V                    

’Pin2 = C.5 = programming in              

’Pin3 = C.4 = grounding resets to 0      

’Pin4 = C.3 = grounding displays the result              

’Pin5 = C.2 = Hall-sensor interface              

’Pin6 = C.1 = display output Picaxe AXE133y          

’Pin7 = C.0 = programming out      

’Pin8 = V-  = ground

’VARIABLES (max b27, w13)

’b0 = for variable

’b1 = Hall-sensor voltage

’b2 = measurement outcome 0,1,2

’b3 = previous measurment

’b8 = display writing, not used

’b9 = display writing, not used

’b10= display writing

’b11= display writing

’b12= display writing

’w9 = scaled depth

’w10= sum of 10 measurements

’w11= previous measurement result

’w12= difference between measurements cycles

’w13= measured turns

’—————————————————————————–

   pause 1000                   ’let display to get started

   serout C.2 ,N2400,(254,1)       ’clear display

   serout C.2 ,N2400,(254,128,” Anchor out”,32,32,32,” m”)    

Main:

   if PinC.4 = 0 then

      w10=0                   ’ reset turns register

      w11=0

   endif

   readADC C.3, b1               ’read Hall-sensor

   if b1<b2 then

      b3=b2-b1

      if b3>80 then

          w10=w10+1

      endif

   endif

   if b1>b2 then

      b3=b1-b2

      if b3>80 then

          w10=w10-1

      endif

   endif

   b2=b1

’Display:    

   w11=w10/3               ’scale to meters

   if w11 = 21845 then

      w11=0

   endif    

   bintoascii w11,b8,b9,b10,b11,b12

   if b10=48 then

      b10=32               ’blank zero

   endif

   if b11=48 then

      b11=32               ’blank zero

   endif

   serout C.2 ,N2400,(254,139,b10,b11,b12)    ’show depth on lower line, 3 digits

   goto Main