This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I add water and diesel sensor?
#1
How have you solved adding water and diesel level sensors to your Openplotter?
I want to use the original sensors in my tanks (0-180ohm)...
  Reply
#2
to answer my selfe:

I added the sensors to an arduino with analogtoserial read.
The serial output goes into node-red and further to freeboard.
My next challenge is to forward this to NMEA2000 so I can read the datas on my Raymarine.
  Reply
#3
(01-10-2017, 06:17 AM)dreuf Wrote: to answer my selfe:

I added the sensors to an arduino with analogtoserial read.
The serial output goes into node-red and further to freeboard.
My next challenge is to forward this to NMEA2000 so I can read the datas on my Raymarine.
How did you get the Arduino data into the Openplotter RPI?

Chris
  Reply
#4
First of all, my arduino sketch tells the arduino to serialprint my results.
Then its two ways, either connect TX/RX from the arduino to the ras-pi or via USB.
I choosed USB.

Then I take the signal from arduino who is separated in 3 lines:
Waste 0-90
Diesel 0-255
Water 0-255
Then I separate those 3 into singel lines and then again separate the value from the text.
And finally the 0-255 is converted to the size of the tank. So f.ex the diesel tank is 90liter, so then 255 equal 90. And 0 equal 0.
This number is then transferred to Freeboard where I have my statusscreen of the boat.

The Node-red setup:
[Image: skjermbilde2.jpg]

And the Freeboard:
[Image: Skjermbilde.jpg]

(The temperatures and the 230v system comes from Domoticz via Z-wave and RFXCom, the 12v system are not integrated yet. Just text to show my plans..)

Also its possible to download a Arduino-node into node-red, but this is only working when I install it, and next reboot its gone again..
  Reply
#5
I'm going to want to measure 12v battery status on my Openplotter at some time in the future too.

I have been monitoring 12v battery voltage with an Arduino for some time. The sketch monitors the stand-alone solar power system in our house, and high voltage (when the battery is approaching full) triggers a relay to turn on a small inverter that I use to pump water. The circuit is easy with the Arduino analog pins; just wire up a voltage divider and measure the voltage in the middle. All you need is a couple of resistors. I have the Arduino drive a LCD display to provide monitoring of the operation.

Now I want to do this again on the boat, and push the data into Openplotter and out on an instrument panel like your example.

I'm new to Openplotter, so I can not help with how to get this data across from the Arduino into the Rpi and Openplotter. I have read about using COMs (RX/TX) through the serial pins on both devices (I've done this already with Arduino and the battery management system on my lithium cells), or by USB or the I2C interface. While the USB comms seems to be simple, it is limiting in terms of the number of ports as I may want to use more than one Arduino in my system. 

Chris
  Reply
#6
I think the easiest solution is to get it into the node-red via the serialport and convert the signals from there.
I have ordered a Victron Energy MTTP regulator for my solarpanels, this regulator also have the possibility to connect to an Ras-pi, so hopefully I can extract the datas I need from that to my 12v system. If not I will do the same as you and use and arduino.

For now I have a sketch that reads diesel level, water level and waste level. If I set ut to update to fast the readings are floating. This is because the arduino only have one ADC and get unstable when switching pin to read.
Therefor I now read every sensor two times and discard the first reading.
I will also look in maybe use one arduino for each sensor if that makes it more stable. (They are so cheap so doesnt matter how many you use Smile ).

I havent testet yet, but if you connect more than one arduino to the ras-pi. Will it not just get new names? like ttyUSB1, ttyUSB2 etc?
If so, when you import the arduino to node-red you choose wich port you want it to listen to, so in my mind I think you can have as many as you want..
(Have 5xarduino on the way by mail so will test this as soon as they arrive).
  Reply
#7
Gentlemen,
I would like to chime in on this subject as I'm actually in the design stage of adding analog / digital data onto my OP setup. Last season I started using OP on my 30ft sailboat with great success and this year will start expanding the setup, predominantly to display analog and digital data on gauges.
My idea is to convert analog and digital signals into a (custom) NMEA strings that will be send to the RPI. This is a very common procedure in the commercial marine electronics (my profession), especially in the new integrated bridges / VDR systems. I'm working on a custom board that allows me to get 8 analog and 16 digital signals. On this board, a uP will convert this into a NMEA string. For some data there are NMEA strings (RPM, Rudder) however, to make it adaptable to other signals (temperature, pressure, water levels, voltages, current etc), it could be a possibility to make custom NMEA strings with raw Analog (0-1024) and digital (0,1) data.
In OP, there should then be a decoder that will allow you to define this NMEA data into readable information.
The beauty of this is that you will be able to start adding multiple PI's on a ship network enabling you to monitor multiple functions; ea; one unit at the engine for engine data, one unit in or near your batteries / switch board for battery / voltage info, one near the bilge for bilge sensors etc etc.
  Reply
#8
Im also trying to read my fuel levels but Id rather just use Pi/OP and not have to learn Arduino
Has anyone figured out how to implement the MCP3008 ADC on the Pi/OP SPI sensor interface in OP V0.9?
I cant find any instructions in the on-line documentation on the physical connections or how to configure it in OP.
Also what is "aktiv" which I see in the SPI settings tab?
Thanks
Steve 

BTW - I have written a Python script to read my fuel sensor using an MCP3208 and display the result on an LED bargraph but Id really like to get the fuel level read by OP.
  Reply
#9
(02-28-2017, 01:28 PM)affinite Wrote: Im also trying to read my fuel levels but Id rather just use Pi/OP and not have to learn Arduino
Has anyone figured out how to implement the MCP3008 ADC on the Pi/OP SPI sensor interface in OP V0.9?
I cant find any instructions in the on-line documentation on the physical connections or how to configure it in OP.
Also what is "aktiv" which I see in the SPI settings tab?
Thanks
Steve 

BTW - I have written a Python script to read my fuel sensor using an MCP3208 and display the result on an LED bargraph but Id really like to get the fuel level read by OP.

OK answered my own question ...
A bit of experimenting and I have my MCP3208 working in SPI/OP and can see the output in the SignalK diagnostic window.
Now to get my head around SignalK/NodeRed to display the result Smile
  Reply
#10
(03-02-2017, 08:54 AM)affinite Wrote: OK answered my own question ...
A bit of experimenting and I have my MCP3208 working in SPI/OP and can see the output in the SignalK diagnostic window.
Now to get my head around SignalK/NodeRed to display the result Smile

If you haven't figured it out already this might help a little, its part of a node red flow I use to display engine temperatures. It uses to dashboard nodes to display - https://flows.nodered.org/node/node-red-dashboard
I put a delay node in as well otherwise there was too much data for the graph. 

Hope this might be of use. 

PS Ctrl-i opens the nodes import dialog box.


Code:
[{"id":"12d9eb57.4dee05","type":"websocket in","z":"a1ba0b6c.b93d98","name":"SignalK input","server":"58d1334a.a72ecc","client":"","x":75,"y":98,"wires":[["11b86291.f8905d"]]},{"id":"11b86291.f8905d","type":"json","z":"a1ba0b6c.b93d98","name":"","x":96,"y":208,"wires":[["7517c8ee.de2b48","dbc2f1fc.c6e78","bc5087ef.c78118"]]},{"id":"7517c8ee.de2b48","type":"jsonpath","z":"a1ba0b6c.b93d98","expression":"$.updates..values[?(@.path==\"propulsion.Eng.temperature\")]..value","split":true,"name":"EngTemp","x":264,"y":100,"wires":[["29d547b8.f04588"]]},{"id":"29d547b8.f04588","type":"delay","z":"a1ba0b6c.b93d98","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":408,"y":52,"wires":[["7e631a32.8bc014"]]},{"id":"7e631a32.8bc014","type":"function","z":"a1ba0b6c.b93d98","name":"Convert to deg C","func":"var numInput = Number(msg.payload);\nmsg.topic = \"Eng\";\nvar T =  numInput-273.15;\nmsg.payload = T.toFixed(0);\nreturn msg;","outputs":1,"noerr":0,"x":592,"y":88,"wires":[["66a37c6d.494d34","d864e825.200108"]]},{"id":"d864e825.200108","type":"ui_chart","z":"a1ba0b6c.b93d98","name":"EngineGraph","group":"67dca234.faad9c","order":0,"width":"23","height":"7","label":"Engine temperature history","chartType":"line","legend":"false","xformat":"%H:%M:%S","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"4","removeOlderUnit":"3600","x":829,"y":73,"wires":[[],[]]},{"id":"66a37c6d.494d34","type":"ui_gauge","z":"a1ba0b6c.b93d98","name":"EngTempGauge","group":"8861c889.240108","order":1,"width":"3","height":"3","gtype":"gage","title":"Engine temperature","label":"Deg C","format":"{{value}}","min":0,"max":"120","colors":["#00b500","#e6e600","#ca3838"],"x":911,"y":203,"wires":[]},{"id":"58d1334a.a72ecc","type":"websocket-listener","z":"","path":"ws://localhost:3000/signalk/v1/stream","wholemsg":"false"},{"id":"67dca234.faad9c","type":"ui_group","z":"","name":"Engine/Alt/Exhaust temporature history","tab":"1d99b92f.cedb87","disp":true,"width":"23"},{"id":"8861c889.240108","type":"ui_group","z":"","name":"Temperature gauges","tab":"aeffa403.23f5f8","disp":true,"width":"19"},{"id":"1d99b92f.cedb87","type":"ui_tab","z":"","name":"Graphs","icon":"dashboard","order":2},{"id":"aeffa403.23f5f8","type":"ui_tab","z":"","name":"Gauges","icon":"dashboard","order":1}]
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)