Previous years began around Memorial Day. This year, we had a late start.
CA's Side Project has been Yoga Teacher Training. 200 hours of classroom time is a lot of work.
S.Lott's Side Project has been an Anchor Alarm.
The core concept is this.
A Liquid Crystal Display (LCD) to show what's going on.
A push button to mark Red Ranger's position.
A knob to set the scope (really the radius of a guard zone.)
A switch to arm the horn.
A horn that will wake the dead when we drift off the marked position. This requires a MOSFET transistor that will allow a 12V horn to coexist with the 3V Arduino.
This will be LOUDER than the little beeper in the chart plotter. And it won't require leaving a phone on all night to check our position.
For the last few months, it's been an evolving pile of wires and stuff as it moves closer to something I can install on Red Ranger for sea trials.
Today, I finally figured out why the LCD display wasn't working even though almost everything else was humming along well.
[Updated with new details.]
The v1 prototype used a cool little "breakout" board: https://www.adafruit.com/product/746. The GPS and not much more. There's room on the back for a battery (to make it acquire satellites more quickly.)
The v2 prototype is using a more sophisticated "shield": https://www.adafruit.com/product/1272. This includes a data logger with an external storage device. Pretty slick.
In order to have color-coded LED backlighting for the LCD display, I needed all of the digital output pins available on an Arduino Uno. All. Worked good with the (simple) breakout board.
The data logger shield uses Arduino digital pin 10 for chip select, 11 for MOSI, 12 for MISO and 13 for SCK. Ugh. The logger can conflict with four of the pins I wanted to use.
The breadboard version #1 worked pretty nicely. I took it out on the boat to play around and gather some data. It had the following digital connections.
Pins 0 and 1 are the built-in serial interface to the board as a whole. Don't touch or you can't easily debug.
Pins 2 and 3 are part of the data path to the LCD. As are Pins 4-6 and 12. (Yes. 7 pins required for the LCD.)
Pins 7 and 8 are part of the serial interface to the GPS. Stuck with these.
Pins 9-11 provided a slick LED backlight to provide Red/Green/Blue illumination for the LCD to show the status of the alarm system. Red for armed. Green for ready. That kind of thing.
Pin 13 is the trigger for the alarm horn. (And yes, reset will beep the horn.)
The buttons and switches are read with Arduino analog inputs.
In order to build version #2 with the parts I have on hand, I'm may need to change the user experience to stop using the LED backlighting as a status indicator.
Pin 9 will be used for the LCD data (instead of pin 12.)
The LED backlighting will be an optional feature. (And the wires in digital pins 10-12 can be removed from the board, if necessary.)
I can replace it with a simple switch for the LED backlight on the LCD: red for night-time, off for day. It's simple: a switch and current-limiting resistor to the red LED.
Next Gen Options
For version #3, I have two choices.
Upgrade to an Arduino Duo or something with more pins. Not sure I like this. The Uno has the right number of pins and almost enough memory to handle what I'm doing.
Build a smarter shield. Get an AdaFruit ProtoShield — maybe a https://www.adafruit.com/product/2077 and plug the breakout board onto the "bare" shield. This will get me back to the version #1 user experience with the backing LED's to show status.
The Secret Agenda
My secret agenda is to use a more sophisticated anchor watch algorithm. I want to use bearing to the original mark and course over ground to detect drift directly rather than rely on a simple guard ring to see if we've drifted too far off our marked position.
During a change in wind or tidal flow, the boat will appear to drift, but then will stop — ideally inside the guard ring.
When COG is 180° from the bearing to the marked position, we're moving away from the anchor. If this slows and stops, the anchor caught us. Good. If this doesn't stop, we're moving and alarms need to be sounded.