Code Monkey home page Code Monkey logo

engineguard's Introduction

EngineGuard

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:

  1. Any of the sensors report an emergency.
  2. An internal buzzers gives signal. This is mainly for debugging the device.
  3. An external 24V device gives signal. The device is connected via a reed relay.
  4. The OLED shows the reason for the alarm.
  5. The external signal can be cut for certain period of time by pressing a button.

Project Status

  • 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):
Main unit

Display unit:
Display

Acknowledgement button mounted to the top of the display unit:
Acknowledgement button

PCB:
PCB

Technical Details

Schematic and PCBs

See board/ for Fritzing schematic & PCB and Gerber PCB files.

Components

When selecting OLED screen make sure its driver chip is supported by u8g2 library.

Connectors

Input

  1. DC VCC (9-32V)
  2. DC GND
  3. Engine room smoke detector (+24V) - GPIO 33
  4. Engine room smoke detector (GND)
  5. Engine 1 Oil (+24V) - GPIO 25
  6. Engine 1 Oil (GND)
  7. Engine 2 Oil (+24V) - GPIO 32
  8. Engine 2 Oil (GND)
  9. Kitchen gas detector (+24V) - GPIO 26
  10. Kitchen gas detector (GND)
  11. Engine room temperature 1-wire, 3V3 (red)
  12. Engine room temperature 1-wire, GND (black)
  13. Engine room temperature 1-wire, signal (yellow) - GPIO 4
  14. DC VCC (5V)

Output

  1. DC +5V (OLED)
  2. DC GND (OLED)
  3. I2C SDA (OLED) - GPIO 21
  4. I2C SCL (OLED) - GPIO 22
  5. Alarm bell (DC VCC 9-32V from input pin 1) - GPIO 19 via relay U2
  6. Alarm bell GND
  7. Clear button A (closed when pressed) - GPIO 23
  8. Clear button A (closed when pressed) - GND
  9. Engine room temperature 1-wire, 3V3 (red)
  10. Engine room temperature 1-wire, signal (yellow) - GPIO 4
  11. Engine room temperature 1-wire, GND (black)
  12. Engine room temperature 1-wire, 3V3 (red)
  13. Engine room temperature 1-wire, signal (yellow) - GPIO 4
  14. Engine room temperature 1-wire, GND (black)
  • Internal buzzer - GPIO 18

Software

Building and Uploading the Code

  • Install PlatformIO
  • Copy the configuration template include/settings.cpp.sample to include/settings.cpp. Make necessary changes.
  • If you are planning to use OTA updates copy include/settings.mk.sample to include/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.

Configuring Your Engine Guard

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):

  1. Configure a WiFi network using related variables WIFI_SSID, WIFI_PASS and MDNS_NAME.
  2. Set OTA_PASSWORD to random string. Don't forget to edit settings.mk so you can upload new versions using OTA.
  3. Set engine name(s) and set some placeholder for temperature sensor 1-wire addresses (e.g. "foobar").
  4. Upload the first code version via USB and make upload. Later you can use make upload_ota as long as your workstation and Engine Guard are connected to the same network.
  5. Connect the first temperature sensor to Engine Guard.
  6. Power up the EG and go to (http://eg.local) or any other name you defined by MDNS_NAME.
  7. The status display should tell you the 1-wire address of the connected sensor.
  8. Copy & paste the address to settings.cpp.
  9. Upload the code and see the status page. Now you should see the sensor being claimed by defined task.
  10. Repeat the above to define all sensors.

engineguard's People

Contributors

mplattu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.