Smart Boat 14: Oil Pressure monitor with ESP32, INA219 and Home Assistant

3 min read 4 hours ago
Published on Oct 10, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, we'll guide you through setting up an oil pressure monitoring system for your boat engine using the ESP32 microprocessor and the INA219 sensor. This project will allow you to monitor oil pressure, set alerts for deviations, and analyze historical data to ensure your engine operates efficiently.

Step 1: Gather Required Components

Before starting, ensure you have all the necessary components:

  • ESP32 (38-pin model)
  • INA219 module
  • Pressure sensor (oil sender)
  • 12V to 5V converter
  • Dupont breakout cables
  • Junction box (80mm x 80mm)

Practical Tips

  • Purchase components through the provided affiliate links for convenience.
  • Make sure your ESP32 has the necessary pins available for connections.

Step 2: Solder INA219 Pins

You'll need to prepare the INA219 module by soldering the pins if they are not pre-soldered.

Steps to Solder

  1. Heat your soldering iron.
  2. Insert the pins into the INA219 module.
  3. Apply solder to each pin while holding it in place.
  4. Allow the solder to cool before moving the module.

Step 3: Wire INA219 to ESP32

Next, connect the INA219 module to the ESP32. This involves routing power and data lines correctly.

Connection Points

  • Connect VCC of INA219 to 5V on ESP32.
  • Connect GND of INA219 to GND on ESP32.
  • Connect SDA of INA219 to GPIO 21 on ESP32.
  • Connect SCL of INA219 to GPIO 22 on ESP32.

Wiring Diagram

Ensure you refer to the wiring diagram provided in the video for clarity.

Step 4: Connect the Oil Sender

Now, connect your oil pressure sensor (oil sender) to the INA219 module.

Connection Steps

  1. Connect the positive output of the oil sender to the INA219's V+.
  2. Connect the negative output of the oil sender to the INA219's V-.
  3. Ensure the oil sender is properly calibrated to the specifications of your engine.

Step 5: Add to Home Assistant

To monitor the oil pressure data, you'll need to integrate it with Home Assistant.

Integration Steps

  1. Open Home Assistant and navigate to the configuration menu.
  2. Add a new sensor entry in your configuration.yaml file.
  3. Use the following code snippet as a template:
sensor:
  - platform: ina219
    name: "Oil Pressure"
    address: 0x40
  1. Save the changes and restart Home Assistant.

Step 6: Configure the Sensor

Once added, you'll need to configure the sensor settings to ensure accurate monitoring.

Configuration Steps

  • Set alerts for when oil pressure falls below or exceeds certain thresholds.
  • Use the historical data feature in Home Assistant to analyze trends over time.

Common Pitfalls to Avoid

  • Ensure correct wiring to avoid sensor malfunctions.
  • Double-check the addresses and configuration in Home Assistant.

Conclusion

You have successfully set up an oil pressure monitoring system for your boat engine using the ESP32 and INA219. This system will help you maintain engine health through proactive monitoring and alerts. Next steps could include expanding your monitoring system to include other engine parameters or exploring additional integrations with Home Assistant to optimize your boat's performance. Happy boating!