Introduction: Runners' Arrival Registration With QR Codes
I created this project for a non-profit organisation. They have a yearly running competition. The runners participate without paying anything, so the project had to be done as cheap as possible.
Please don't make money of this information. I provide this information for stimulating sports competitions and allowing people in third world countries to have a cheap way of organising competitions.
Step 1: What You'll Need
The list for making this project work is fairly short.
- A smartphone running Android with a version that supports MIT's appinventor
- A data connection on the smartphone
- A spreadsheet program to work with the collected data. Just remember there are free alternatives available. The program only needs to be able to import a CSV file
Step 2: Preparing Your Android Device
Follow these steps if you want to edit the app
Subscribe to MIT's appinventor site. Subscription is free.
You can download the .aia file I have added and upload it to your account, so that you can edit it.The entire code is added as an image as well and shown above this step.
Don't forget to install the MIT AI2 companion on your phone if you want to test out the application. How to edit the app and test it can be found on the MIT site.
Just install the app if it suits you "as is" or if you want to give it a try before editing it
If you don't want to modify the app, just dowload the .apk copy I provided here onto your phone and install it with a file browser app or an installer app. Don't forget to allow apps which are regarded unsafe.
Basically, what the app does; is the following:
- Show a button you can press to start scanning QR-codes (I didn't find a way to do this without a button)
- Wait for a QR-code to be scanned
- Give a confirmation message when a QR-code was scanned and write out the information read together with a timestamp to a file called lopers.csv on your SD-card. Sorry for the file naming and the date format used, but this is the way it is done in Europe when you speak Dutch ;-). If you're not pleased with this format and naming, please modify the app as described above
- Return to step 2
Step 3: Generate Some QR-codes
Each runner will have to get his unique QR-code, so that you can scan it and keep track of his arrival time.
The Bulk QR Code Generator allows you to generate up to 100 codes at a time. If you are any good with a spreadsheet program you can easily generate a sequence of 100 numbers and have them generated. The site allows you to download it as a ZIP file so you can print them out.
If you want to reuse the QR-codes, you might consider laminating them. If you still have to print runner numbers, you can incorporate the codes. Anyhow, make sure it is easy for the runner to present his QR-code and for the official at the finish line to scan the QR-code. A keycord might do the trick.
Step 4: Work With the Collected Data
This is where the data connection on your smartphone kicks in.
The app stores its data on the SD-card of your smartphone. However, when you connect it to your computer to read the data you might not find the file or read an old version of the file. I guess this is due to the fact that the data is not pushed to the SD-card directly. The problem occurs with the builtin file manager on my phone. You can install the File Explorer app which allows visualisation of your data and which does not seem to have this problem.
So, after you have closed the registration app, you should use some kind of e-mail app to send the data to your e-mail account.
From there you can import it into your spreadsheet program and do your magic with it. If you need some help with working on the collected data, you can contact me, but I'm quite confident that there are hundreds of sites which explain how to import a CSV file in your spreadsheet program and how to do calculations with date and time.
If you want to start a new competition, just remove the file on your SD-card. A new file will automatically be generated when you scan a new QR-code.
Step 5: Give Thumbs Up!
Hey, I have a passion for ICT and would love to hear from you if you like my projects
So, drop me a message or send me some improvements to implement. Together we can build a better world.
Step 6: UPDATE
OK, you asked for it ...
What is this updated version about?
- New version of the Android APP ( .apk and .aia files)
- Full support application in PHP
The new version of the Android APP is fully translated in English, so it should be easier for everybody to understand what the app is doing. Also, I incorporated a new Options screen.
On the options screen you have the following items, all related to the new features:
- Checkbox "Send to website". Check it to send data to the website
- Textbox with the ability to enter the URL where the website can be found. Enter the URL where you installed the PHP application from the ZIP file.
- A green button "Start competition"
- A red button "Clear database"
What's in the ZIP file?
The ZIP file contains a complete application allowing up to SIX groups of runners to participate. The first group of runners has numbers between 100 and 199. The second has numbers between 200 and 299 and so on.
In the folder "db" you'll find a file called "createtables.sql". Use it to create the tables on your PHP/MySQL site. Three tables are created:
- wf_participants for runners competing now
- wf_old_participants holding names of runners participating in previous editions, allowing the application to use autocomplete when entering new participants. You are responsible for filling this table if you want to use this feature.
- wf_runners for registering the arrival time of runners
Install the application in a folder on your server. Remember this name as it has to be used in the Android app on the options page.
After creating the tables and installing the PHP application, open it on your server. You will have to enter the minimal information for operation:
- database host: usually this has to be localhost
- database name: is provided by your site's provider
- database user: is provided by your site's provider
- database password: is provided by your site's provider
- admin user name: a user name for protecting the entry of runners in the competition
- admin user password: a password for protecting the entry of runners in the competition
Once you have entered this information correctly, your application should give you a results page where you can monitor the registered and arrived runners.
You can subscribe runners by going to the admin part of the website (<your-sites-url>/admin). You should enter the name and password you entered while installing the site. After you validate, you'll see a page on which you can enter the name, first name and number of the participant. The number has to contain 3 digits. Depending on the value it will fall into a category:
- numbers between 100 and 199 are attributed to the 4KM ladies category
- numbers between 200 and 299 are attributed to the 4KM men category
- numbers between 300 and 399 are attributed to the 8KM ladies category
- numbers between 400 and 499 are attributed to the 8KM men category
- numbers between 500 and 599 are attributed to the 12KM ladies category
- numbers between 600 and 699 are attributed to the 12KM men category
Of course, you are free to modify this, but you'll have to modify a few files to do this for your own categories.
OK, so now you are ready to start the competition
- Start up the Android app and on the options page hit the "Start competition" button. This will insert a reference time in the database and in the file on your android device.
- From this point on, you can start scanning QR codes with the runner numbers.
As an additional feature, a PDF file with the results can be downloaded. Go the <your-sites-url>/pdf page to automatically create this file which automatically downloads;
OK, I tried to explain as clearly as possible what my brain produced. Let me know if I have to update again.
We have a be nice policy.
Please be positive and constructive.