Exodus
Project · sensors

Watching the generator
for pocket money.

A Raspberry Pi, a CAN hat, a stacking header, a barometer and a few temperature probes on wires. Perhaps sixty dollars of parts doing a job that marine suppliers charge hundreds for — and doing it on an open standard anything can read.

Why bother

The problem it solves

A diesel generator that overheats quietly will destroy itself quietly.

Our Fischer Panda has its own panel, and it will shut down on an alarm. But a panel only tells you something when it's already gone wrong, and only if you're standing in front of it. It doesn't tell you that the exhaust elbow has been running fifteen degrees hotter every week for a month, which is the kind of thing that means a raw-water impeller is tired or the heat exchanger is furring up.

Trends catch failures. Alarms catch wreckage. We wanted the trend.

The stack

What's physically bolted together

1. The Pi and the CAN hat

A Raspberry Pi running OpenPlotter and Signal K, with an MCP2515 CAN hat sitting on the GPIO header. That's the bit that turns the Pi into a device on the NMEA 2000 backbone, so it can hear every instrument on the boat. One line in config.txt brings it up:

dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25

After that it is just a network interface called can0, and everything on the bus is readable.

2. The stacking header

One problem: a hat covers the GPIO pins it sits on. Add a second hat and they fight over the same header.

A stacking header — a tall extension that passes every pin straight through and up — solves it. The CAN hat sits on the bottom, the pins come up through it, and everything else hangs off the top on jumper leads. That's the nest of wires coming out of the top of the box, and it's deliberate: every sensor can be unplugged and swapped without taking the hat off.

3. The barometer

A BME280 on the I2C pins — pressure, temperature and humidity in one chip the size of a fingernail. Four wires. It's reading 1031.5 hPa and 69 °F inside the boat as this page is written.

Barometric pressure logged every minute is genuinely useful at anchor. A falling trend is worth more than any forecast you can get offshore.

4. The temperature probes, and the resistor

DS18B20 probes — stainless steel, on a lead, waterproof. One on the coolant inlet, one on the outlet. The difference between them tells you how hard the generator is working and whether the heat exchanger is still doing its job.

These run on 1-Wire, which is the clever part: power, ground and a single data line, and you can hang as many probes off that one data line as you like. Each has a unique serial number burned in at the factory, so they sort themselves out.

The catch, and the reason there's a breadboard in the box: the data line needs a 4.7 kΩ pull-up resistor between data and 3.3 V. Without it you get nothing at all, and nothing in the error messages tells you why. That resistor is the whole reason the build isn't just plug-in modules.

Enabled with one more line:

dtoverlay=w1-gpio
Wire colours matter and they are not standard. On the probes we used: red is power, yellow is data, blue is ground. Other suppliers use black for ground and white for data. Check yours against a known-working one before you connect anything — getting it wrong can cook the sensor.

Where it gets interesting

The sensors that aren't wired to anything

Wires are the limiting factor on a boat. Running a cable from the engine room to a bilge forty feet forward means lifting sole boards and a day you won't get back.

ESP32 boards fix that. A few dollars each, WiFi built in, and they'll run the same kind of sensors. Put one where the wire won't go, let it talk to the boat's own network, and it lands in Signal K beside everything else. Propane locker, bilge, fridge compartment — anywhere a cable run is more trouble than it's worth.

The point is that it all arrives in the same place, in the same format, whether it came down a wire or over the air.

Where it goes next

From watching to acting

Everything above only reads. The obvious next step is a relay.

A relay board on the same GPIO header turns the Pi from an observer into something that can act. Start the generator when the house bank drops below a set state of charge and the sun isn't going to fix it. Stop it when the batteries are full. Stop it immediately if that exhaust temperature crosses a line.

That last one is the real prize. A generator that shuts itself down three seconds after the raw water stops flowing is a generator you still own next season.

The honest caution. Anything that can start an engine can start it at the wrong moment. Automatic control needs hardware interlocks, a physical disable, and a lot more care than a monitoring script. We're reading first and writing later, deliberately. If you build this, do the same.

Roughly what it costs

Why this is worth doing yourself

A Pi, a CAN hat, a stacking header, a BME280, a couple of DS18B20 probes, a breadboard and one resistor. Not free — but a fraction of a commercial engine monitoring package, and the data lands on an open standard instead of inside somebody's app.

Prices move, so we're not quoting numbers we haven't checked. Look them up before you buy.

← All projects How the networks work