I just got a text from my boat.
In November, I wrote about how to protect your boat from frozen engines and dead batteries with smart sensors. These Internet-connected devices can “call” you when problems arise.
Well here is the update. I built a monitor for about one-fifth the cost of commercial models. My device is bare bones, but it has the critical features I wanted.
Over Thanksgiving, I sat down with a cup of coffee and ordered a starter kit from from Adafruit.com. Adafruit sells Arduino and other hobbyist electronics. The starter kit arrived a few days later packed with an assortment of parts. Boards, wires, processors, battery packs, buttons and knobs came in the box. I was eager to get started on the project.
I’m no programmer, so I had to learn enough ‘C’ computer language to run the sensor instructions on the Arduino “brain.” After lots of reading at Arduino.cc (and the Adafruit website) I had simple functions working. First, I saw temperature readouts from the sensor to my laptop — a good first step.
Over the following weeks I devised new, more useful configurations. My friend and fellow boater Dave helped me think through the logic for sensing and alerting.
Before texting would work, I had to head over to T-Mobile and pick up a SIM card like the one in your cell phone. SIM cards — about the size of a thumbnail — identify your unique device and phone number on the cell network. For $3 per month I get 30 texts or 30 minutes of calls (with no contract). I won’t be using voice calls. That’s a pretty good deal.
After more wiring, soldering and coding I got my first text from the gadget! Using code lines like
dtostrf(vbat,3,0,battText); //convert battery floating # into char
the sensor can alert me on temperature and power thresholds I set.
It was easy to test temperature increases because I could start at say 70 degrees and hold my finger on the temperature probe. Heat from my fingertip would cause the temperature to rise past the threshold I set, triggering a text to my cell phone.
Finally, I programmed the Arduino to answer back whenever I ask “what’s up?” If I text the word “status,” the sensor sends back battery voltage and temperature. Below you’ll notice it was around 60 degrees and the battery was still charging up. Cool! [Note: the battery voltage you see is for the cell radio battery in millivolts. I use that voltage as a proxy for shore power. Logically, I know that if the shore power is running the battery is charging and voltage will be above 4000 millivolts. If it drops below 4000, I can infer that shore power was lost because the unit switched to battery and it’s slowly discharging below 4000.]
I tested in the garage for several days over a range of temperatures and it worked well. I’ll install the sensor — in its Container Store plastic box — this weekend in the boat.
I’m satisfied with the result and pleased I was able to get it working. Now that I’ve discovered this technology I’m looking for my next project (maybe a wind station on my boat).