NB: Boat Alarm has been deprecated. Please use Net Receiver instead.

Boat Alarm is a free application to monitor your boat and send alarms by email. Boat Alarm requires an Arduino-compatible microprocessor to be placed on your vessel where it can be connected to both shore power and battery power. This is the "client" and will cost you less than US $25 in parts. The client periodically monitors the health of its power connections and reports problems to the service over WiFi and the Internet. The service is completely free, and the source code for both the client and the service is also free and open source.

If you'd like to try Boat Alam but lack the technical skills to do so yourself, please register interest by specifying "INQUIRY" (all uppercase) for your vessel name.

Alarms

Alarms are invoked via HTTP GET methods on the Boat Alarm service. In the jargon, Boat Alarm uses a simple REST interface, as follows:
/alarm?k=KEY&v=VESSEL&a=ALARM&ad=ALARM_DATA&ac=ACTION&acd=ACTION_DATA.

Alarms are colon-separated strings, which are completely user-definable. For example:

( * not yet implemented.)

In order for the service to send email, the email action must be specified and action data must be set to the colon-separated pair: recipient:message. For example:
ac=email&acd=joe@bloggs.com:Message goes here

Alternatively, omit the message as follows:
ac=email&acd=joe@bloggs.com

Alarm Configuration

Alarms are configured in the client software via the Alarm array. Alarm fields in order are:

  1. alarm name
  2. alarm pin
  3. report value (true to report value, false not to report)
  4. expected value (if digital, otherwise ignored)
  5. low threshold (if analog)
  6. high threshold (if analog)
  7. scale (= voltage divider ratio, if analog)

The default configuration is as follows:

  Alarm alarms[] = {
    { "Power:ShorePowerLoss", "D2", false, HIGH },
    { "Power:BatteryVoltageLow", "A0", true, 12600, 12000, INT_MAX, 16.0 }
  }; 
  

There's no limit to how many alarms you may choose to implement. It's just up to you and your Arduino prowess.

Shore Power Loss

The first alarm senses shower power on digital port 2 (D2) where HIGH is expected. To utilize this alarm, ensure both your client hardware AND your WiFi access port are powered by battery, not shore power!

Battery Voltage Low

The second alarm senses battery voltage on analog port 0 (A0) where the normal range is above 12V (i.e., 12000mV), To utilize this alarm, use a voltage divider to scale down the maximum battery voltage to the range of your client hardware's Analog/Digital Convertor (ADC).

Notifications

Boat Alarm sends notification emails from boatalarmservice@gmail.com, so ensure this address is not treated as spam by your email provider. Note that this email address is not monitored.

Notification emails always have the subject URGENT: Boat Alarm. The maximum number of notifications is one per hour. Alarms raised more frequently than the notification period result in a RecentlyNotified error.

Security

Alarms without a valid key are ignored. The key is a 16-byte long randomly generated string (technically, it's 12 bytes encoded in base 64). Further, the key must correspond to the registration with the correct vessel name. This is to stop you from getting spammed. Your vessel name may be well known (mine is "Arriba") but they will need to guess your key before you'll receive any email notifications. Obtain your key by registering here. Please keep your key secret.

CAVEAT: Unfortunately Arduino does not have the oomph to provide encryption, so keys are sent to the service in the clear, making them vulnerable to so-called "man in the middle" attacks. Why anyone would care to intercept your boat alarms is another matter though.

Client Software

The default client is an Arduino program ("sketch"). You can download the source code for the client here.

Configuration

The client is configured by setting the following definitions located at the top of boatalarm.ino:

Set DEBUG to true to enable debug statements.

Client Hardware

The client has been tested running on (1) an Arduino Uno R3 with a CC3000 WiFi shield and (2) the Adafruit HUZZAH ESP8266.

STOP PRESS: I have found the CC3000 WiFi shield to be unreliable and recommend using the ESP8266 instead.

Digital Pin 2

This pin measures shore power, albeit indirectly by measuring the output voltage from a mains USB adapter (not a 12V adapter). Ensure the USB voltage is relative to ground by connecting the USB black wire to one of the ground pins. For the Arduino limit the digital pin voltage to a maximum of 5.0V and for the ESP 8266 limit it to 3.3V.

Analog Pin 0

This measures battery voltage (Vbat). For the Arduino use a 3:1 voltage divider (to limit the ADC to 5V) and for the ESP 8266 use a 16:1 voltage divider (to limit the ADC to 1V) You can combine the battery power supply with the voltage divider as shown below. The red wire supplies VBat and the yellow wire supplies Vbat/16.

Alarm Pin

For the CC3000 version, Boat Alarm writes HIGH to digital pin 7 whenever an alarm has been triggered. For the ESP8266 version, Boat Alarm writes LOW to digital pin 0, the built in LED. The pin is alarmed until conditions are normal again.

Internet Connection

The default client uses a WiFi connection to reach the Internet. This could be an old Android phone running in tethering mode, or your boat's access point (if you have one), or your marina's WiFi, if you're so lucky. Just ensure your access point is battery powered and does not rely on shore power.

Note that Boat Alarm does not require a WiFi connection that is either permanent or 100% reliable. Boat Alarm connects to the WiFi network only after it has detected changes, and will keep trying to reconnect indefinitely until it is successfully able to connect and send an alarm. Between alarms Boat Alarm disconnects from the WiFi network and puts the WiFi shield into standby mode, both to save power and improve reliability.

See Also

License

Boat Alarm is Copyright © 2015-2016 Alan Noble.

Boat Alarm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Boat Alarm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.