Thanks to all for your help, my project is up and running, albeit with a few changes. First, I have eliminated S3. Rather than use a push-button switch to alternate between displaying bilge 1 and bilge 2, I wrote code to toggle between the two for about 10 seconds each. I also changed the input mode to INPUT_PULLUP on pins 2 and 3 as suggested, and because it appears to be very stable, I did not use the CAPS to ground. Below is what it does so far. Items eight and nine have not been implemented yet.
My sketch is designed to do a number of things:
1. It counts the number of times each bilge pump comes on
2. It logs the start and end time of each occurrence on a mini SD card
3. It logs the duration of each activation
4. It logs the date and time using RTC
5. It displays the current count on a seven segment LED display
6. It alternates between displaying bilge pump 1 and bilge pump to 2
7. It displays the corresponding pump number in the first digit of the LED
8. It sends an SMS message to my cell phone each day
9. It warns me if a bilge pump comes on for an extended time
There are two issues which I have yet to resolve. First, the 5 V regulator gets very hot when subjected to 14.5 V. I have a 12 V battery system on my boat, however when the engines are running, the batteries may [sometimes] charge at 14.5 V. It is uncommon, but it does happen. I had to machine a heat-sink for my 5 V regulator, otherwise it got too hot to touch. My plan is to use a 12 V regulator and redesign the circuit using a voltage divider after the regulator to provide somewhat less than 5 V to the Teensy. Converting 14.5 V to 12 V should result in much less wasted energy, thus less heat.
My next step is to implement items 8 and 9. I have absolutely no idea how to do that, so it will take me some research to figure it out. If you all have any suggestions where to start, I’ll take anything I can get.
Again, thank you all so much for your help.
Drew