OpenMarine

Full Version: lifting keel sensor, how to integrate ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a boat with a lifting keel. I know it is not that common. But i would like to make a sensor which tells me the position of the lifting keel.

So I've found a sensor which measures distance. This sensor has an I2C interface. And there is an C arduino library available, which arrange calibration, measuring etc.

On the end I would like to have a signal K format signal, which can be displayed.
Code:
/vessels/<RegExp>/design/keel/lift

Units: ratio (Ratio)

Description: In the case of a lifting keel, centreboard or daggerboard, the part of the keel which is extended. 0 is 'all the way up' and 1 is 'all the way down'. 0.8 would be 80% down.

related to this is of course 
Code:
Description: Depth related data

/vessels/<RegExp>/environment/depth/belowKeel

Units: m (Meter)


I now come to the implementation part and have several possibilities;

  1. directly connect sensor to I2C bus of PI. I don't have a library, i think I have to program something in phyton ?
  2. connect sensor to a small arduino board and use USB/serial interface to communicate between (sensor/arduino) and openplotter 
    a. native like described in: part2  and part 3
          b. via MQTT between (sensor/arduino) and OP/PI sending native or JSON messages
          c. via NMEA 0183 (Private) messages between (sensor/arduino) and OP/PI
      3. ??

I'm sailor and not an experienced programmer ..
Any suggestions are welcome

G.
(2016-11-20, 02:00 PM)gniersma Wrote: [ -> ]Hi,

I have a boat with a lifting keel. I know it is not that common. But i would like to make a sensor which tells me the position of the lifting keel.

So I've found a sensor which measures distance. This sensor has an I2C interface. And there is an C arduino library available, which arrange calibration, measuring etc.

On the end I would like to have a signal K format signal, which can be displayed.
Code:
/vessels/<RegExp>/design/keel/lift

Units: ratio (Ratio)

Description: In the case of a lifting keel, centreboard or daggerboard, the part of the keel which is extended. 0 is 'all the way up' and 1 is 'all the way down'. 0.8 would be 80% down.

related to this is of course 
Code:
Description: Depth related data

/vessels/<RegExp>/environment/depth/belowKeel

Units: m (Meter)


I now come to the implementation part and have several possibilities;

  1. directly connect sensor to I2C bus of PI. I don't have a library, i think I have to program something in phyton ?
  2. connect sensor to a small arduino board and use USB/serial interface to communicate between (sensor/arduino) and openplotter 
    a. native like described in: part2  and part 3
          b. via MQTT between (sensor/arduino) and OP/PI sending native or JSON messages
          c. via NMEA 0183 (Private) messages between (sensor/arduino) and OP/PI
      3. ??

I'm sailor and not an experienced programmer ..
Any suggestions are welcome

G.

I might  be worth looking at node red,  already installed in raspian,  just type "node-red"  in a terminal to check it out, very powerful. It has an i2c input so it may be a way to get the data and format a signalk message then send it out to openplotter. 
https://www.npmjs.com/package/node-red-contrib-i2c
thx Paddy,

Managed to get this working via node-red. 
Signalpath:  Sensor (I2C or SPI)--> arduino --> USB(serial) --> Openplotter PI --> Serial interface node-red
Point now is that in the real practice the sensor has to be installed outside, harsh environment, seawater. So USB is not the correct way i think. ESP8266(wifi) is not reliable on an aluminium boat. So thinking of RS485. N2k looks to complex to me

G.