Swim timer code listing

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /homepages/22/d233747096/htdocs/dougsdiy.com/wp-content/plugins/prettify-gc-syntax-highlighter/prettify-gc-syntax-highlighter.php on line 63

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /homepages/22/d233747096/htdocs/dougsdiy.com/wp-content/plugins/prettify-gc-syntax-highlighter/prettify-gc-syntax-highlighter.php on line 69

3 thoughts on “Swim timer code listing”

  1. Sealing the switches seems to be a failure point in the design, especially as they wear. How about using hall effect devices to replace the switches. Buttons on the outside of jar would contain a magnet which activates the switch when it is pushed and moved close to the hall effect device on the inside of the lid. Or, use reed switches and magnets.
    And, you could gut one of the rechargeable toothbrushes that use inductive coupling to charge a rechargeable battery inside the jar. Seal the toothbrush electronics in the jar and use the charger as is to charge the unit.
    Or if you want to go green, use solar charging to charge a rechargeable battery in the jar. During the day, the unit would charge by the pool.

    1. Properly designed o-ring seals are pretty reliable. I am planning to modify the design for magnetic reed switches. Hopefully they will be slightly simpler than the current switch mechanism. Removing the switch seals might improve reliability. Properly designed static o-ring seals are extremely reliable.

      As far as rechargeable, I don’t think that would be an improvement. It is not difficult to change the batteries twice a year and the big benefit is that I don’t need to give the timer special handling different from the rest of my swim gear. That means it won’t be left on the charger when I go to the pool or left somewhere to get sunlight.

  2. I just started swimming laps in my backyard pool just before bedtime. I can use the exercise and the workout helps me get to sleep when I’m done. I wanted to bring a clock outside to time my workout but I’d need one that would be weatherproof, and visible in the dark. So your post is timely. I have a surplus Arduino and quite a few loose 7 segment displays, but they are common cathode. Looking at your code I realized you are scanning the display bass ackwards. IE: turning on the same segment as required in all digits at once instead of all segments as required in each digit one at a time. This way you keep within the 20ma current limit of the AVR I/O (clever!). However if I reverse the logic levels for the segments and digits I can substitute common cathode displays for the common anode. Adafruit now has some nice waterproof ‘Otter boxes’ that might be the ticket for this. I’ll probably run the timer off a wall wart as there is an outlet available by the pool.

Leave a Reply

Your email address will not be published. Required fields are marked *