www.holdentechnology.com

WiFi Boat Monitor

Free WiFi!

When my marina added free wifi for slipholders, I decided to create a boat monitoring system.

There are commercially available boat monitoring systems out there, mostly using a cellular data connection.  A cell connection is nice because it works anywhere you have cell service, but it does require paying for a phone line for your boat.  Wifi only works where you can find an access point, but it's free once you have it.  Since my boat spends almost all its time at its slip, it can keep me updated for free.

This is still a work-in-progress, but it's gone far enough for me to list the specs, and document them as they're finished:

 

 

  • Twitter as a front-end for real-time updates and sensor statuses (follow me) (now all data is also archived on the web server)
  • GPS logging and track uploading (after returning to the marina)
  • Onboard sensors for:
    • Hatch boards in/out (as a burglar alarm)
    • Engine run time
    • Interior temperature
    • Battery Voltage

I used an arduino mega as the baseline processor, the wifly shield for communication, and a sparkfun microsd shield for logging GPS data.

GPS data is saved to my web server, and a link is sent to Twitter.

Cost of the hardware used is right around $200.  If I make any more I could do a custom circuit board that would cut that down a little I think.

  • Status as of Sept 2011:  My marina switched to a new wifi contractor, who uses a captive portal authentication technique (like starbucks where the first web page you open has the authentication stuff).  This is beyond the ability of my wifi module to handle.  So I've abandoned the project for now.   I'm a bit sad, it was fun

  • Status as of May 30, 2011:  Took it home for some modifications.  Mostly the GPS on the boat wasn't configured to send the RMC sentence, so the GPS log files didn't have a real date.  
    Once I got it home, I made a lot of modifications to the system.  Since you can't send twitter updates directly to twitter without using Oauth, I moved the server scripts to firebolt.holdentechnology.com instead of the arduino library ones.  I wrote some php code to tweet data uploaded to the server as an http post.  I also log the twitter data (regular sensor data and events like hatchboards moving) to the website in csv format for archiving or analysis, and there is a viewer over at firebolt.holdentechnology.com.  
  • Status as of April 8, 2011:  It's installed on the boat!  Almost.  It is wired to the boat power.  It is using wifi at the marina, which is not all that reliable it seems.  I haven't connected the hatchboard sensor, GPS data, or engine on sensor yet, but will get there soon I think.  The temp sensor seems to read a little high, I should calibrate it.
  • Status as of March 2011:  Fixed the hardware.  The arduino board was toast but the wifi and sd-card/sensor boards were okay.  I actually had a spare arduino board so it wasn't too hard to fix, but I got busy doing other things so it took a while.  You can see some twitter updates again, and I'll try to get it mounted on the boat soon.
  • Status as of Nov 21, 2010:  Went down to the boat to install the electronics today.  First task was to double-check it was working with the marina wifi.  I wired the power up backwards and-- poof.  Smoked it.  Damage assessment still ongoing, but I'll be fixing things for a bit.
  • Status as of Nov 2010: It's still sitting on my workbench, waiting to be installed in a box to go on the boat.
  • But I took it along on the Vallejo 1-2 race while I singlehanded to Vallejo.  Here's a link to the track it logged and uploaded.  The alternate view is actually better until I get more charts uploaded to my GPS Action Replay installation.
  • Status as of Sept 2010:  I have been testing it extensively at home and in my car.  All the twitter updates are from my house's network.  I have a few more things on my "to do" list before I install it in my boat, but I'll get that done in the next month or so I hope. 

 

 


Twitter updates

For hardware details see my separate article.

The boat sends a twitter status update three times a day no matter what, giving the sensor readings. 

Twitter updates are also sent for the following events:

  • If the hatch boards are opened or closed
  • If the motor is turned on or off.
  • If it returns from a trip using GPS data it tweets a link to the track on my server.

GPS Logging and Web Server

The GPS data is saved to the sd flash data card

Whenever GPS data comes into the machine, it gets saved to a log file in the gpx format.  After a few minutes of no data, the monitor assumes you've come home and shut down the chartplotter, so it tries to upload the track and create a web page to display it.  If it can't connect right away, it will try every day to clear out the log files.  Log files get archived on the sd card as well. 

Here's an example track from testing around my house.  I haven't decided whether the best display is by GPS Action Replay (which animates and can show things like speeds, but requires you upload maps), or by gpsvisualizer (which uses google earth maps but you can't control the way it looks at all).  In the example above, GPS AR is the default and there's a link to the gpsvisualizer version at the top of the page.

The track stuff requires a separate web server, and I wrote some server scripts to handle the data uploading in an easy-for-a-microcontroller fashion.  firebolt.holdentechnology.com is the boat's domain, separate from this one so it is hopefully less likely to get hacked.


Sensor Suite

  • Hatch boards in/out (as a burglar alarm)
    This uses a magnetic burgler alarm switch (I used the kind that mounts in a hole like the NTE 54-629).  I enable the pull-ups on the Atmel, and wire the switch so it shorts to ground.  Here is a sketch:
  • Engine On/Off (to calculate run time)
    This uses a 12V supply that turns on with the engine.  For example, the ignition key, or the supply to the electric fuel pump.  To reduce the voltage from 12V to 5V, I considered a Voltage divider, but went instead with a 5V regulator.  The 3 terminal part is easier to hook up, and gives a logic high voltage for a wide range of input voltages.
  • Interior temperature
    I used the LM335A with a 5.1K resistor.  The Voltage from the circuit is 10 mV / deg K (note the drawing below is mislabeled).  This one needs an analog input on the microcontroller to read it.  It seems to read a little hotter than it actually is, by 5 degrees or so.
  • Battery Voltage
    Just a simple voltage divider.  This drains the battery over time.  I was too lazy to think of something better, hopefully my solar panel can keep up with the mA it draws.

More to come.  A bilge water level detector would probably make sense too, but the sensors above are actually in place and working.


User Interface

Not much of one for now, I just update the software.  Later I plan to do all setup through the USB port.

 

Random Images

clock.jpg
twitter.jpg