FuzzyFrog
Posts: 2
Joined: Sun Sep 24, 2017 10:40 pm

Track and Field timing system

Sun Sep 24, 2017 10:48 pm

Description

I'm very much a noob in terms of RPi projects so bear with me if I'm making no sense. I'd like to build a simple track and field timing system with 2 raspberry Pi's. The idea is that I'd have 2 RPi's, one acting as a transmitter to record the start of a run and the second acting as a transmitter to record the finishing time of a run. Each raspberry Pi would simply record the datetime when an athlete has passed by. It'd be great to be able to get some in session feedback of how the athlete was doing and view their times. I'd really appreciate some feedback just in terms of the feasibility of the idea and any other direction (ie equipment I'll need etc) that you may think is helpful. Thank you :)

Breakdown

Things I need RPi #1 to do:

- I need it to mark the datetime and store it once it has detected that something has moved passed it. Now the tricky bit is, I need it to detect the athlete and not the coach or anybody else that is around. The athlete can wear some kind of chip if necessary to identify him as the target to be recorded.

- I'd like to be able to connect to the first raspberry Pi via Bluetooth in order to extract all the data for the training session.

Things I need RPi #2 to do:

- I need it to mark the datetime when the athlete has passed it and send the finish time via bluetooth to RPi #1

Remarks

Version

- Assume both Raspberry Pi's are version 3

Bluetooth

- The distance between RPi#1 and RPi#2 will be no more than 100 metres
- Bluetooth required as net connectivity may not be available on site and would be looking for some instant feedback on the session while it was underway. I understand that having RPi#2 communicate the finish time to RPi#1 over a distance of 100m is beyond the Bluetooth range for RasperryPi. Are there any other options in terms of gathering the data for the session or do all roads lead to net connectivity given I need instant feedback?

Power

- I know on site I'll need to have batteries for both RPi's, a session will be no longer than 1hr.

User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

Re: Track and Field timing system

Mon Sep 25, 2017 7:12 am

Ok here's some food for thought.

Probably a good way for the 2 RPi's to communicate is RF (radio freq), these boast 2km range http://www.robotpark.com/433MHz-RF-Long ... eeedstudio

To track the athlete and reject everything else could be a little more tricky. Having used computer vision myself before I would be able to use this, have the athlete wear a certain color hat or maybe a 2 colour stripped hat (to be very unique) then have a Pi cam watching and the computer vision can just look for the hat but computer vision is not so much of a beginner programmer task.

PiGraham
Posts: 3709
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Track and Field timing system

Mon Sep 25, 2017 8:12 am

Identifying the athlete is the main challenge. Using the camera to read some identifying mark is a good option although there is a chance any mark is not visible at the critical time. Maybe an armband? You could use combinations of colours or patterns. QR code or Datamatrix might be worth a look.

It might be possible to attach an IR LED transmitting a pulsing code of the sort used in TV remotes. A detector that looks down a tube to limit it's view to athletes at the finish line might detect the individual's code at the right time. Sunlight may blind such a system.

A Pi camera plus some feature scanning might give you 10 frames per second (fps) or 0.1 seconds timing resolution. Is that good enough? The camera can run at 90 fps but processing the image to ID the athlete may not keep up with that.

If you need better timing resolution you could use a through-beam optical sensor that potentially could get to 0.001s or so. Because Linux isn't real-time there is a risk that the kernel is busy with something just as the beam is broken and the timing is a bit off. If you want high accuracy you will probably have to use a microcontroller or some hardware to record the timing.

If you have an opto-sensor detecting when the athlete crosses the line you can use that to trigger the camera for a phot at the line and process that image to ID the athlete.

Consider what to do if two or more athletes cross the line together. machine readable markers will probably be obscured and timing will be inaccurate for some athletes.

You can run the camera as a line-scan to get a finish line picture of the sort common in horse racing.

The technique described in this post can be used
https://jp.raspberrypi.org/forums/viewt ... 8&t=188922
Update by time rather than movement.

Someone wrote code to do a photo-finish camera with a Pi but a quick search hasn't turned that up. Try "finish-line", ""photo-finish" and "linescan" as part of your search terms.

To collect data from start and finish you could consider a WiFi network and a MQTT setup. Start and finish Pis publish their ID and time to the broker (server) and a client on a Pi, PC or smartphone could find what IDs are published and get the times.

A router / Access point based stand-alone WiFi network should cover a 400m running track.

User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

Re: Track and Field timing system

Mon Sep 25, 2017 10:42 pm

I have robots using computer vision running on RPi3 and can get 50 FPS processed running a more complex algorithm then just looking for a color combo.

But I do think that the idea of a IR transmitter on the athlete and having a receiver being looking down a black tube to limit its field of vision.

I have created something similar for a robot to find it's charging docking station.

see the pics of the transmitter that I built using a DigiSpark tiny8 board to transmit the code and an IR receiver on the RPi
20170926_083846.jpg
20170926_083846.jpg (114.78 KiB) Viewed 3364 times
20170926_083321.jpg
20170926_083321.jpg (119.01 KiB) Viewed 3364 times

PietroDC
Posts: 9
Joined: Wed Sep 20, 2017 5:25 pm
Contact: Website

Re: Track and Field timing system

Mon Sep 25, 2017 11:02 pm

I don't know your budget but to recognize the athlete(s) you can use RFID bracelet with a good RFID antenna.
The RFID readers start with antennas that can read maximum 3cm to antennas that can read 20 meters so you can find a good solution for your specific scenario..

PiGraham
Posts: 3709
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Track and Field timing system

Tue Sep 26, 2017 6:17 am

PietroDC wrote:
Mon Sep 25, 2017 11:02 pm
I don't know your budget but to recognize the athlete(s) you can use RFID bracelet with a good RFID antenna.
The RFID readers start with antennas that can read maximum 3cm to antennas that can read 20 meters so you can find a good solution for your specific scenario..
20m RFID? Would that have the positional precision time an athlete crossing a line? I imagine a conical detection zone maybe a metre across. If it can be focused in a narrow line or could track tags position along the course it could be ideal. Can it read multiple tags at once?

PietroDC
Posts: 9
Joined: Wed Sep 20, 2017 5:25 pm
Contact: Website

Re: Track and Field timing system

Wed Sep 27, 2017 12:58 pm

PiGraham wrote:
Tue Sep 26, 2017 6:17 am
PietroDC wrote:
Mon Sep 25, 2017 11:02 pm
I don't know your budget but to recognize the athlete(s) you can use RFID bracelet with a good RFID antenna.
The RFID readers start with antennas that can read maximum 3cm to antennas that can read 20 meters so you can find a good solution for your specific scenario..
20m RFID? Would that have the positional precision time an athlete crossing a line? I imagine a conical detection zone maybe a metre across. If it can be focused in a narrow line or could track tags position along the course it could be ideal. Can it read multiple tags at once?
Hi, as i said there are from a distance like NFC TO distance of 20meters, there are many types of antennas with different range, power need and "detection area", when i was starting a project with RFID i found many possible solutions in AliExpress, i was going to buy a 5/8 meters reader with USB or IP connection, don't remember, but then i've not made the project so i can't answer about the multiple tags.
With the 5$ reader you can find on Amazon, the multiple read is not possible but the time to wait for next reading is very low (milliseconds, i never misured how much).
Give a look on Ali, you can ask to sellers about multiple tags and response time by the reader to be able to make the next read.

User avatar
procount
Posts: 1980
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Track and Field timing system

Wed Sep 27, 2017 1:38 pm

I used to work with timing systems for R/C model cars and fullsize Rallycross.
Most of these systems work off an inductive loop that detects a transponder attached to the car (or in this case, athlete) as it crosses the loop.
Early transponders emitted a fixed frequency which was easy to detect but limited the number of transponders that could be used.
Later transponders emitted a digital signal that is decoded to an identifying number for each car/athlete, similar to RFID.

Whatever system you use, you will end up trading off accuracy & reliability against cost.

Some things you need to bear in mind:
1) Accuracy of crossing the line.
For inductive loops, the transponder (RFID tag etc) will be detected for different periods of time depending on signal strength and speed of crossing (slower speeds are detected for longer). So you need to work out what time you will use: the first detection, the last detection, an average of the two? An additional optical beam break sensor is useful for more accurate times, but difficult to distinguish individual athletes if they overlap and to match up with the transponders.

2) Multiple simultaneous crossings
If several athletes cross the line together, can the system detect all of them reliably? How many? If using optical QR codes etc., what happens if one is obscured by another athlete? Should you have multiple detectors?

3) Speed of detection
Can the system quickly detect the athlete's identifier in real time, or would it require offline processing? A smart phone, for example can read QR codes, but typically takes a few seconds to auto-focus even when the object is stationary, let alone moving.

4) Time Synchronisation
When you have different RPis detecting the start and finish time, their times should be accurately synchronised. What technique would you use for this? (Don't forget to account for signal propagation time depending on the accuracy you require. For high accuracy you could consider GPS)

5) Loss of communication between the 2 raspberry Pis.
What happens if you lose communication. Will the 2 timestamps still be in sync? Will you lose any data, or will it buffer the data until comms is re-established?

6) Backup system
If you need to rely on this timing system for accurate times, always consider a backup solution for when the technology fails.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

FuzzyFrog
Posts: 2
Joined: Sun Sep 24, 2017 10:40 pm

Re: Track and Field timing system

Mon Oct 02, 2017 11:47 am

Thank you all for your replies, it's been very interesting noting the suggestions and difficulties raised. As a beginner, the intricacies of this particular project just seem a bit too much to create a system that functions to an acceptable level. Thanks again

User avatar
bensimmo
Posts: 4227
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Track and Field timing system

Mon Oct 02, 2017 3:42 pm

If this is a 100m sprint start to finish.
Then setoff is way, just keep the speakers equal for each person if you need to be that accurate.

First to finish, you use a laser beam system and one it breaks you have you fastest time.
From then you can start recording (you could even have a pre laser beam to start pre-recorded.
I believe Camera and RFID are then the way to go.
If it was the Olympics anyway, something I read/was on TV, can't remember.

If it is just one runner, then a beam break for timing and an RFID tag for identity.

If this is sprint laps and starts are all over the place....

Just thought I'd do the old Google search to see what it comes up with and this one looks interesting.
https://www.quora.com/Usain-Bolt-sprint ... -precision


Though have a go, grab some tags and a laser break and just get them working. Then get so rudementary timings, they'll be no worse then someone with a stop watch.

Then build on that.
2000fps camera detection though..

Stick a Pi ZeroW and not a Pi3 as power usage is lower.
Link via WiFi as you can set one up as an Access Point and it make slide easier.
Consider ZeroW for the sensors and a Pi3 in the middle as the AP and sever.
You can even then access the Pi3 from your phone.

Power is just a matter of large batteries.
USB batteries are quite large now.

Return to “Automation, sensing and robotics”