tinker2much
Posts: 127
Joined: Wed Jun 20, 2018 12:38 am

A home-brew lap counter/recorder/calculator

Wed Feb 05, 2020 2:27 am

I've been walking a lot around an indoor track this winter. I want a device that will note the end of a lap every time I press of a button, calculate the elapsed time since last press and display that as most recent lap time, plus - at the press of another button - cycle through lap count/min/max/avg/median, plus total session time. Lap times are no more than two digits worth of seconds with perhaps a tenth for spurious accuracy. Total session times can be two digits worth of minutes, with tenths of minutes, ditto. I would like a way to easy offload the day's times to another device.

So I imagine I don't need a lot of parts here:
  • a pi Zero (maybe even an Arduinio, but I know nothing about those)
    a couple of buttons
    a modest NN.NM multi-segment display, where N is a number and M indicates mode (somehow)
    a custom case
    some kind of shim that allows:
    a battery pack for portability
I'm very familiar with the PI, totally unfamiliar with an Arduino, although I gather the Arduino could be fine for simpler use cases and also lower power.

This seems like a matter of ordering a few parts, hacking it together with some very simple software, and figuring out the case after I have the size and shape settled. Unless some electrical tape suffices.

Thoughts?

deepo
Posts: 394
Joined: Sun Dec 30, 2018 8:36 pm

Re: A home-brew lap counter/recorder/calculator

Wed Feb 05, 2020 9:54 pm

Why not go for a small OLED screen instead of those multi segment displays?
Like the Adafruit 128x64 OLED bonnet https://www.adafruit.com/product/3531
You even get buttons and a joystick on that bonnet.

/Mogens

tinker2much
Posts: 127
Joined: Wed Jun 20, 2018 12:38 am

Re: A home-brew lap counter/recorder/calculator

Fri Feb 07, 2020 12:56 am

deepo wrote:
Wed Feb 05, 2020 9:54 pm
Why not go for a small OLED screen instead of those multi segment displays?
Like the Adafruit 128x64 OLED bonnet https://www.adafruit.com/product/3531
You even get buttons and a joystick on that bonnet
Am I right that I would have to make up my own graphics for the numerals, coding in pygame? There are probably primitives that I could combine. I could also make up symbols and/or text for which mode I was in. This is very interesting.

PhatFil
Posts: 1556
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: A home-brew lap counter/recorder/calculator

Fri Feb 07, 2020 1:14 am

or pick up a cheap coin cell powered 433mhz button controller, and use your pi to receive the button code and host a web page with all the metrics/data/forcasts you want to display and use your phone or puter to view..

button ideas
https://www.aliexpress.com/wholesale?ca ... mhz+button


diy rf reciever h/w
https://www.googleadservices.com/pagead ... BBb&adurl=

alternative 433mhz receiver option
https://tasmota.github.io/docs/#/device ... Bridge-433

tinker2much
Posts: 127
Joined: Wed Jun 20, 2018 12:38 am

Re: A home-brew lap counter/recorder/calculator

Tue Feb 11, 2020 9:12 pm

Like the Adafruit 128x64 OLED bonnet https://www.adafruit.com/product/3531
You even get buttons and a joystick on that bonnet.
That seems like a good choice just for the display, PLUS I could use the buttons to click for each lap or for starting and stopping, AND the joystick to scroll through previous lap times, or previous days' results.

For power, I'm wondering about one of these two adafruit boards https://www.adafruit.com/product/1944 or https://www.adafruit.com/product/2465 which allow attaching (and boosting the voltage from) LiPo batteries. This article details how to attach it to the bottom of a zero[w], : https://github.com/NeonHorizon/lipopi. I was especially interested in that method of BOTTOM attachment, because it would leave the gpio header free on top to attach the display.

I need to figure out whether, bottom and top attachment aside, these two items would conflict over specific gpio pins.

deepo
Posts: 394
Joined: Sun Dec 30, 2018 8:36 pm

Re: A home-brew lap counter/recorder/calculator

Wed Feb 12, 2020 9:59 pm

Go for it.
Worst case would be that you can't connect any communication wires from the power supply.
But do you really need that, or is it nice to have?

/Mogens

tinker2much
Posts: 127
Joined: Wed Jun 20, 2018 12:38 am

Re: A home-brew lap counter/recorder/calculator

Wed Feb 12, 2020 11:40 pm

I need battery power somehow, to make it portable. I've never tried to power a pi via battery before, and this is the first solution I've looked into. What other types of battery-based solutions are there?

deepo
Posts: 394
Joined: Sun Dec 30, 2018 8:36 pm

Re: A home-brew lap counter/recorder/calculator

Thu Feb 13, 2020 8:13 pm

tinker2much wrote:
Wed Feb 12, 2020 11:40 pm
I need battery power somehow, to make it portable. I've never tried to power a pi via battery before, and this is the first solution I've looked into. What other types of battery-based solutions are there?
I didn't write you couldn't connect the power leads, only that you might not be able to add the communication wires.

/Mogens

Ramblin Wreck
Posts: 1
Joined: Thu Feb 20, 2020 3:33 pm

Re: A home-brew lap counter/recorder/calculator

Thu Feb 20, 2020 3:40 pm

Regarding a battery: I ran my Rasberry Pi Zero Wireless on a random cell phone power bank I had laying around...mainly just out of curiosity to see how long it would last. It ran for a few days before dying, during which it was just running a Python program to send an update to Twitter every 5 minutes to report that it was still alive. Seems like some sort of solution like that would be sufficient for daily usage.

Return to “Other projects”