Temperature monitoring and alarming
Temperature sensors can ble placed on vital parts. The engine is obvious, cooling water, exhaust manifold, engine block, alternator etc. With almost costless sensors any part where it would be nice to know the temperature can be monitored. Charger, fridge, fridge's compressor, SSB radio power stage etc. The list can be long. The temperature sensors of the DS18B20 (DS18B20 datasheet) type are extremely easy to connect (One wire). All the output can be connected together just like a bus and every sensor has it's own address. Only 3 wires connect to the module (Pi or ESP board). After testing the DS18B20 failed in the engine room, and was replaced with more robust NTC sensors which require analog to digital conversion which require a more sophisticated board like ESP32.
Internet of Things on Board (IoToB) solution
The temperature sensor client will transmit the temperature data over wifi and using the SignalK protocol to the OpenPlotter SignalK server. The breakout box has connections for 5 NTC temperature sensors. Currently engine block, cooling water, exhaust outlet, alternator metal body and engine room is monitored. It's a sail yacht, but still the engine is often run for some hours. The alternator is the most critical component, with Li batteries and an external controller it's possible to fry the alternator. It's made for cars and not really designed to run at full amperage for hours.
Current version - NTC sensors and ESP 32
The first attempt using DS18B20 electronic one wire sensors and ESP8266 failed due to sensor failure. By learning from the automotive industry where they use NTC sensors I took the advice. As these sensors need analog to digital conversion and the fact that the ESP8266 only has one ADC input it was an easy decision to use the ESP32 which has several. NTC sensors come in a large range of bort resistance and packaging. M8 threads, lugs, small sylinders, tube sping clamping, magnetic etc.
A lot of details can be found at the git project page.
The ESP32 box is mounted above the engine room inside the engine compartment. It takes two connections 12V for power and a 6 way connection to a distribution box beside the engine where the sensors are found. The distance to the RPi yacht server with the OpenPlotter SignalK server is about 2 meters, hence no problem with wifi connection. The heat from the engine is not a problem as it sits outside end thermal and sound isolation.
The sensors come on serveral variations sylinders, lugs, M8 threads, magnetic etc.
The pictures below show the ESP32 box just above the engine, the breakout box mounted on the engine (strapped into a set of cables), one M8 NTC screwed into the engine block in the front of the engine, one clipped into the hot cooling water from the engine (there is some uncertainty by clamping onto a rubber hose, rubber so not conduct heat very well) and one lug screwed onto the aleternator. The latter is quite important as the Li-battery charge controller can put a very high load on the alternator which is actually not really built to tackle. Running at 70 Amp for a long time can cause it to overheat, good keeping an eye on that temperature. In addition to those on the pictures one is monitoring the actual machine compartment and an magnetic NTC sensor is fixed at the exhaust bend where cold seawater mix with the hot exhaust from the engine. Any increase in this temperature is an indication of less water from from the seawater impeller pump.
In total 5 x 10k NTC sensors of varying types are employed and the ESP send 5 SignalK sentenses to the OpenPlotter SignalK server. The labels on the breakout box is the SignalK senteses keywords.
Older stuff
First attempt - using DS18B20 sensors and ESP8266 / ESP 12N
The sensor client is based on a ESP8266 / ESP12E, a simple little module that does this task nicely. For more information see Wikipedia on ESP8266 and the ESP12E module.
The picture on the left show the finished box with a 12V power input at the short side and 3 x three pin connections for the DS18B20 sensors. Initially interference caused the 1-wire to fail after some time (a few minutes) and just report the standard error code -127. Replacing the pullup resistor with a 2.2k as opposed to 4.7k before and introducing a single 100 ohm resistor in series with each signal lines (hidden under the yellow crimp-on-plastic) on the connectors.
Using connectors for all connections make it a simple matter to bring the box home for maintenance or reprogramming. The system is using a ND buck converter making 5+ from 12V with full isolation, to be sure that ground og sensors ground ar not in any way connected to the ground of the electrical systems on board. Having an aluminium boat stray current can be problematic.
Unfortunately I chose a 1W converter which can only supply 200mA, which is a but on the low side for initiation of the wifi connection. It does manage to start after some time, but a 2-3 W converter would be a better option. Adding an electrolytic condenser of 100 uF solved this problem as the peak current is only transient. It now works fine with the 1W power converter. I also connected power directly to the pins Vin and GND and eliminated the bulky micro USB plug (still present on the picture).
The systems works very well, until the engine is started, the power surge by the electric starter motor is enough to make the ESP8266 board and sensors to go bananas. The only thing that will reset it is a power cycle. It's a simple flip of a switch on the power distribution panel, but far from how things should be. I'll try to add a couple of capacitors on the 12V supply side. A ferrit choke is already installed on the power line.
The software to set this up is available at github. The names of the individual sensors are found inside this file, so any changes require the Arduino IDE to be called up and the module connected through USB. There are other project to set this up over a we page, bit so far I have kept using my own scripts with one per unit. A piece of core to restart the 1-wire connection in the event of a failure in reading is also now present.
Once connected to OpenPlotter data can be displayed on a SignalK web page application and maybe more important the values can be fed into OpenPlotter's action service. Thresholds for alarms can be set and different actions can be triggered, ranging from sounding alarms to setting IO pins that in turn can switch relays on or off.
Older:
In order to achieve electrical isolation and avoid drawing signal cables around the boat a wifi based IoToB solution is very close to an optimal solution. It's a stand alone server that feed the Signal K server running on the Raspberry/OpenPlotter. OpenPlotter receive the SignalK message strings and convert it to the web page display we all know so well.
The picture to the right show a prototype with an ESP8266 based ESP-12E module with two DS18B20 sensors connected. The one-wire bus is a very simple and easy to use connection and the processing complexity of well served with the simpler ESP8266 chip. This setup can handle up to several tens of temperature sensors, the software normally set a limit. The Arduino IDE sketch is available at github. It's only set up to use two sensors, but this is easy to expand, just figure out sensible names as labels for SignalK to display, but make sure the names follow the guidelines in the SignalK documentation.
The picture show the simplicity of the ESP8266 and one-wire combined, a simple module doing all conversion and connecting to wifi and sending data to OpenPlotter and SignalK. All at a cost of less than 10 Euro all together.