Yacht engine room monitor based on ESP32 monitoring following sensors:
- Temperature of engines 1 & 2 (DS18B20 temperature sensor)
- Temperature of engine room above engines 1 & 2 (DS18B20 temperature sensor)
- Oil pressure from engines 1 & 2 (+24V DC from VDO oil pressure sensor)
- Engine room smoke sensor
- Kitchen gas sensor
Intended operation:
- Any of the sensors report an emergency.
- An internal buzzers gives signal. This is mainly for debugging the device.
- An external 24V device gives signal. The device is connected via a reed relay.
- The OLED shows the reason for the alarm.
- The external signal can be cut for certain period of time by pressing a button.
- We have a working code for all the sensors.
- The PCB v4 was installed to the boat. It turned out that 24V to 5V conversion based on the voltage regulator 7805 created too much heat. Therefore, an external step down converter was introduced.
- The PCB v5 has not neither been produced or field tested.
Main unit (green = power, red = activity):
Acknowledgement button mounted to the top of the display unit:
See board/
for Fritzing schematic & PCB and Gerber PCB files.
- U1 ESP-WROOM-32
- U2 5V reed relay with protective diode, Meder SIL05-1A72-71D (Local electronics shop)
- U3-U6 24V reed relay with protective diode, Meder SIL24-1A72-71D (Local electronics shop)
- OLED screen with SSD1309 driver, I2C version (Aliexpress)
- LED1, LED2 5mm LED in THT package
- R1 resistor 330 ohm
- R2 resistor 4,7 kOhm
- External DC 24V to DC 5V step down converter (Joy IT SBC-Buck04-5V)
- Box for central unit including J1 and J2 (Aliexpress)
- J3 internal piezo 3V (Local electronics shop)
- Box for screen and cancel button (Aliexpress)
- Acknowledgement button (Aliexpress)
- Smoke Detector: Orbis Marine Multisensor Detector ORB-OH-43003-MAR and Orbis Marine Relay Base ORB-RB-40004-MAR
- Gas Sensor: a random 24V gas sensor from Aliexpress (ordered smoke sensor, got gas sensor)
When selecting OLED screen make sure its driver chip is supported by u8g2 library.
Input
- DC VCC (9-32V)
- DC GND
- Engine room smoke detector (+24V) - GPIO 33
- Engine room smoke detector (GND)
- Engine 1 Oil (+24V) - GPIO 25
- Engine 1 Oil (GND)
- Engine 2 Oil (+24V) - GPIO 32
- Engine 2 Oil (GND)
- Kitchen gas detector (+24V) - GPIO 26
- Kitchen gas detector (GND)
- Engine room temperature 1-wire, 3V3 (red)
- Engine room temperature 1-wire, GND (black)
- Engine room temperature 1-wire, signal (yellow) - GPIO 4
- DC VCC (5V)
Output
- DC +5V (OLED)
- DC GND (OLED)
- I2C SDA (OLED) - GPIO 21
- I2C SCL (OLED) - GPIO 22
- Alarm bell (DC VCC 9-32V from input pin 1) - GPIO 19 via relay U2
- Alarm bell GND
- Clear button A (closed when pressed) - GPIO 23
- Clear button A (closed when pressed) - GND
- Engine room temperature 1-wire, 3V3 (red)
- Engine room temperature 1-wire, signal (yellow) - GPIO 4
- Engine room temperature 1-wire, GND (black)
- Engine room temperature 1-wire, 3V3 (red)
- Engine room temperature 1-wire, signal (yellow) - GPIO 4
- Engine room temperature 1-wire, GND (black)
- Internal buzzer - GPIO 18
- Install PlatformIO
- Copy the configuration template
include/settings.cpp.sample
toinclude/settings.cpp
. Make necessary changes. - If you are planning to use OTA updates copy
include/settings.mk.sample
toinclude/settings.mk
. Make necessary changes. - You'll find more configurations in
src/engineguard.cpp
. If you don't have twin engines just remove references to the engine 2. It is OK to comment both engines if you don't want to monitor temperatures at all. make upload
should build and upload the code to your ESP32 via USB.make upload_ota
should do the same as OTA update after you have uploaded the first version of the code via USB.- I had problems uploading the code to an unused ESP32. It appears that my chip was missing some boot code. Uploading a simple Hello World from Arduino IDE did the trick.
Engine Guard is configured by editing include/settings.cpp
i.e. compile time.
Engine Guard can monitor two temperatures per engine. You can define 0-2 engines.
Configuration procedure (settings.cpp
):
- Configure a WiFi network using related variables
WIFI_SSID
,WIFI_PASS
andMDNS_NAME
. - Set
OTA_PASSWORD
to random string. Don't forget to editsettings.mk
so you can upload new versions using OTA. - Set engine name(s) and set some placeholder for temperature sensor 1-wire addresses (e.g. "foobar").
- Upload the first code version via USB and
make upload
. Later you can usemake upload_ota
as long as your workstation and Engine Guard are connected to the same network. - Connect the first temperature sensor to Engine Guard.
- Power up the EG and go to (http://eg.local) or any other name you defined by
MDNS_NAME
. - The status display should tell you the 1-wire address of the connected sensor.
- Copy & paste the address to
settings.cpp
. - Upload the code and see the status page. Now you should see the sensor being claimed by defined task.
- Repeat the above to define all sensors.