Sensor for detecting a swimmer in a pool?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
nedbat
 
Posts: 3
Joined: Wed Jun 20, 2018 6:34 am

Sensor for detecting a swimmer in a pool?

Post by nedbat »

I'd like to make a lap counter for my workouts in the pool. I'm envisioning a battery-powered box that sits on the pool deck, "watching" me swim. Once a minute or so, it would detect that I am close, and increment the count of how many laps I have swum. (Swimmers can't seem to agree whether "lap" means once across the pool, or across and back. I mean across and back.)

I don't want to have to touch the box to activate a switch. I'd like to use a remote sensor of some kind, but I have no experience with them, so I don't know what would work. It doesn't have to work underwater: there's plenty of action above the surface of the water. The sensor needs to have a narrow field of view, so that swimmers in adjacent lanes don't confuse it. It doesn't have to be super accurate, so long as it can detect the cycle of "he's near; he's far" or even, "he's here; he's not" on a minute-long cycle.

This is my first project, so any tips are appreciated! :)

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: Sensor for detecting a swimmer in a pool?

Post by adafruit_support_bill »

You could use something like a Pixy CMUCam or PiCam. These can be programmed to do object tracking based on color. You could train it to recognize the color of your swim cap and trigger when it is near. You could also program it to restrict its view to just your lane.

https://www.adafruit.com/product/1906

https://www.adafruit.com/product/3099

User avatar
nedbat
 
Posts: 3
Joined: Wed Jun 20, 2018 6:34 am

Re: Sensor for detecting a swimmer in a pool?

Post by nedbat »

Thanks. I know I used the verb "watch" in my description, but computer vision seems a little advanced for me, and I imagined that a cruder sensor would do the trick.

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: Sensor for detecting a swimmer in a pool?

Post by adafruit_support_bill »

I haven't worked with the Pi cam, but the Pixy is actually pretty simple to use. The object-tracking is built-in. You just need to teach it the colors to track.

Another option might be an ultrasonic rangefinder. These are pretty directional. If directed downwards toward the water surface, it could detect when there was something above the surface. For use near the water, I'd recommend the weather-resistant version.

User avatar
nedbat
 
Posts: 3
Joined: Wed Jun 20, 2018 6:34 am

Re: Sensor for detecting a swimmer in a pool?

Post by nedbat »

If I put the entire device into a transparent water-tight box, would an IR sensor work through the case?

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: Sensor for detecting a swimmer in a pool?

Post by adafruit_support_bill »

Most plastics will transmit IR. I've had good luck with the Hammond cases. You can find those at Mouser or DigiKey. IR rangefinders can give strange results with surfaces like water. You will probably need to experiment a bit to find a good working angle.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”