2016-11-21, 07:00 AM
(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;
b. via MQTT between (sensor/arduino) and OP/PI sending native or JSON messages
- directly connect sensor to I2C bus of PI. I don't have a library, i think I have to program something in phyton ?
- 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
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