arduino on I2C - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1) +--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=2) +--- Thread: arduino on I2C (/showthread.php?tid=840) |
arduino on I2C - Sprokkie - 2017-11-02 Hi, is it possible to connect an arduino on i2C with openplotter te get values from sensors connected to the arduino in openplotter ? if no what would be a better or the corect solution for connecting arduino to openplotter ? RE: arduino on I2C - abarrow - 2017-11-02 Openplotter includes Firmata hooks, which allows you to use a USB connection to an Arduino. Having said that, you ought to be able to get I2C working between the two devices. A quick Google search turned this up https://oscarliang.com/raspberry-pi-arduino-connected-i2c/ RE: arduino on I2C - Sprokkie - 2017-11-02 i tried that option you googled for me. The arduino was in the I2C list in openplotter, but i could not use it. I had to define a sensor the arduino was not in the list. usb is niot a good option, there are only 4usb availabe on a pi RE: arduino on I2C - shark24 - 2017-11-03 Maybe you can use UART instead of USB for the connection and firmata. I had some trouble with firmata and i2c sensors connected to the arduino. RE: arduino on I2C - PaddyB - 2017-11-03 "usb is niot a good option, there are only 4usb availabe on a pi" USB hubs cost little, plus i2c is only designed for short distances so might be worth considering a usb connection. What sensor data is it? You could maybe get the arduino to create a NMEA XDR sentance for openplotter to read. Sent from my SGP511 using Tapatalk RE: arduino on I2C - Sprokkie - 2017-11-03 It will be oil pressure, oil temperature, coolant temperature, RPM, I want to build a fuel consumption meter, but for that I need much more arduino skills the idea for that is having two flow measurement sensors on in the fuel line to the engine and one in the return to the dieseltank. If I know the amount of diesel for each impulse from that sensor I know the amount of fuel that is going in to the engine and the amount of fuel that is going back to the dieseltank. The result of both is the actual fuel usage. So for now it will be pressure, temp and RPM. Eventually I want to connect reedcontacts as well for a alarm system. How do I get the nmeaxdr to the arduino ? Where can I find some information how to create such a message ? RE: arduino on I2C - jim321 - 2017-11-03 where do you want to display the data ? using node red it could be displayed on the dashboard, there would be no need for nema at all to arduino .. you could do alarms text email ect.. sk data can be read and actions taken in N.R. and sent back to arduino to do something open close relays ect. arduino can read analog sensors and take actions in node red , display,or other actions.. so the short answer is Node-Red.. you will need a usb hub eventually.. jim https://www.dropbox.com/s/8vz16igfyydbx5g/Screenshot%202017-11-03%2006.28.35.png?dl=0 RE: arduino on I2C - PaddyB - 2017-11-03 (2017-11-03, 10:40 AM)Sprokkie Wrote: It will be oil pressure, oil temperature, coolant temperature, RPM, I want to build a fuel consumption meter, but for that I need much more arduino skills For temperature it might be easier just to use ds18b20 thermometers straight into the Raspberry Pi, there's a tab in openplotter to set them up, then a node red dashboard to display - really handy, I have one on the alternator, exhaust & engine headblock. Also openplotter turns the engine head temperature into water temperature so it cn be displayed in an openpcn dashboard so the info can be seen on a tablet without having to change screens. It all gets saved to a database as well. Cheap waterproof ones available on ebay. Openplotter can handle reed contacts directly as well, on a gpio pin. http://www.ebay.co.uk/itm/DS18B20-18B20-1-WIRE-Digital-Thermometer-in-waterproof-casing-BRAND-NEW-UK-STOCK-/190784248550 Pressure & RPM might be better going into node-red like Jim said. Lots info on the web for NMEA message types. http://www.catb.org/gpsd/NMEA.html#_xdr_transducer_measurement Something else worth considering is the ESP32 or ESP8266 and pass the data over wifi. I haven't got a ESP32 to play with yet but the ESP8266 works OK over wifi. Programmed just like an Arduino. This sketch connects to the AIS nmea output of a GX2100 radio and sends the data to openplotter. The ESP32 looks even more powerful. Also, adding a ADS1115 board to Openplotter means you can measure battery voltage so you can keep and eye if all this stuff is draining your bank too much You'll need a serial to TTL convertor to get NMEA into an arduino or ESP, cheap on ebay. Code: /** This sketch sends broadcast udp message. RE: arduino on I2C - shark24 - 2017-11-03 If power consumption isn't an issue I would also go for the ESP8266 and transmit the data via wifi. I've played a little with the ESP32 but currently I would prefere the older ESP8266 if you want to use Arduino Ide. Unfortunately the Mongoose os framework isn't working as good as Arduino Ide right now but hopefully it will be a easy to use cross controller framework in the near future. RE: arduino on I2C - Sprokkie - 2017-11-13 Hi Paddy, i have nmea2000 and not nmea0183. I look in the sketch and i see also mqtt do need that ? (2017-11-03, 11:15 AM)jim321 Wrote: where do you want to display the data ?really wonderfull gauge display, where did you get the gauges ? i will google on arduino and node red, this might be the solution, only how to get the information from the arduino to the node red server ? |