Most sailboats have one of these gigantic brass barometers as depicted here. They look nice, impress your landlubber friends and give you something to polish if you've got stuck in a place where you can't sail in winter. They're however not very useful on their own, and I don't just meant the Rain and Fair nonsense someone printed on them. You might occasionally tap on them when you walk past and mumble something about seeing the needle move, but unless you religiously do this exactly every half hour and write the result into a sheet and then plot it on a piece of graph paper by hand, it will do very little to warn you about an impending storm. You see, the usefulness of a barometric reading only derives from watching it change over time, on something called a barogram.
A classic barograph is however expensive, unwieldy and due to its mechanics not suitable to being bounced around on a sailboat plowing through some waves. There are marine versions too, but you still have to feed them paper, ink and batteries (or wind up the clockwork drive that rotates the barrel). Ridiculous - these days we have computers and cheap, tiny electronics for such jobs!
So I wanted a barograph and thought that would be a nice little project for an Arduino microcontroller and some fiddling with electronics and code. Of course every time a nerd starts something like that, it tends to suffer from a horrible disease called feature creep. I soon had the pressure sensor working, but then decided it needed a display and a humidity sensor and oh wait, if I add a colour touchscreen it could do the graphing and maybe also add audible alarms at sudden rapid pressure changes. Then this would need a power supply, and a buffer battery or flash chip so it wouldn't lose the graph history when switched off. Soon I had an entire breadboard full of stuff and an Amazon wishlist of more electronical bits to add to it. Then I bought a boat and the project ended in a plastic box somewhere in a locker as there was more important stuff to deal with, such as scraping antifouling, servicing saildrives and repairing fridges.
Fast forward to a considerable time later, which had given me some time to think about this. The boat had several computers running all the time anyways, and those were already having displays and hard drives and buffered power and permanent data storage. So all I really needed was much simpler - a device that would report the barometric pressure once in a while and send it to one such computer. The computer could then do all the plotting of graphs and keeping of data. So I've made a much simpler version and because it was based on a tiny Arduino Nano, I called it Nanobaro.
This just reads the barometric pressure (and temperature) via a small, but clever chip called a BMP180. It comes pre-calibrated and is very accurate. Nanobaro then uses the USB-serial interface of the Nano to send the data to a computer, in standard NMEA 0183 format. The rest was up to the computer, and luckily software such as OpenCPN can already interpret this data and draw a graph from it.
The hardware couldn't be simpler - you need to connect four wires from the BMP180 to the Nano. Ground to ground, +5V to +5V, I²C data to A4 and clock to A5. Then program your Nano with the Nanobaro firmware from my Github repository. You can use the Arduino serial monitor to test if it worked, but note that you will need to set it to 4800 bps, because that's the NMEA 0183 default speed (and plenty fast for a few bytes every 10 seconds - atmospheric pressure doesn't change that fast). Stuff the thing into a plastic case, but don't forget some breather holes. Not because it gets very warm in there, but because you're trying to sense the pressure outside the box, so a water- and airtight box wouldn't make for a particularly useful pressure reading.
I've licensed the code under a MIT license and you're welcome to use the design in any way you want. If you find it useful, feel free to throw some money my way so I can buy more electronics bits to play with.