AccuRep: a Push-up Counting Device

by Arpan Mondal in Circuits > Electronics

1496 Views, 12 Favorites, 0 Comments

AccuRep: a Push-up Counting Device

20200709_212115_0000-01.jpeg
IMG_20200709_143701-01.jpeg
IMG_20200709_143752-01.jpeg

I know many people who have started working out this quarantine. The problem with home workouts is lack of gym equipment.
My workouts mostly contain push-ups. To really push myself, I listen to rock music during my workouts. The problem is rep count. Most of the time, I forget my reps in between, due to the music. That is when I got this idea. This is AccuRep, an accurate rep counter.

This simple device can count your push-ups, jump rope, squats and more. There are four LEDs. Each one is set to light up after you complete a specific number of reps. You just need to be creative and find a way to use this to count your reps in any exercise. For push ups, keep this on the floor right under were your chin comes when you're pushing down. For jump ropes, the point on the floor right before the rope touches the ground (in front of your legs). For squats.. well.. you got it.

Why do I say it is accurate? Because you can tune it to match your rep speed so that it never misses or registers a false rep. And this is very simple to make and code. All you need is a microcontroller (like Arduino nano), LEDs and an IR proximity sensor.

Supplies

NodeMcu/Arduino nano: Amazon

IR Proximity sensor: Amazon

LEDs

Female - Female jumper wires (optional) Amazon

5v power supply/rechargeable battery: Amazon

Making the Enclosure

sketch.PNG
Capture.PNG
basev2.PNG

I designed the enclosure in Autodesk Fusion 360. It's an overkill, I could just use tinkercad since it's a simple design. I have been learning Fusion 360, so I thought this would be a practice.
The base is a simple cylinder 80mm in diameter and 20mm high. The rectangular hole in the side is to pass the power supply to the microcontroller. You can use a rechargeable battery to make it more portable. But to keep things simple, I'll be using an external power supply.

Downloads

The Top Plate

sketch2.PNG
top.PNG

The top is simply a disc with four 1mm holes for the LEDs and a cut out for the proximity sensor. This was also designes in Fusion 360. You can find the 3D files.

Downloads

Circuit Connections

IMG_20200702_102355-01.jpeg
IMG_20200702_102445-01-01.jpeg
IMG_20200702_112620-01.jpeg
IMG_20200702_113422-01.jpeg
IMG_20200702_113550-01.jpeg

While an Arduino nano would be the best option due to its small size, I didn't have one handy. So I'll be using a Nodemcu instead. It doesn't matter because the code remains the same in either case.

Connect the proximity sensor's D0 (digital output) pin to gpio pin 5 of your microcontroller. The LEDs need to be connected in order as follows:

LED1 goes to pin 0

LED2 goes to pin 2

LED3 goes to pin 4

LED4 goes to pin 12

LED Configuration

IMG_20200702_102728-01-01.jpeg

Note that LED1 is set to light up after you complete 10 reps. LED2 lights up after 25 reps, LED3 lights after 50 and LED4 at 100. You can change these values in the code which I am going to explain in the next step.

Code and Tweaking

code.PNG
IMG_20200707_114100-01.jpeg

The code is pretty simple. There are if conditions for every LED based on the number of reps you should complete to light them up. You can change this based on your preference.

One important line is the first if block. You can see there is a 500ms delay inside it. This is the delay that is based on how long you're spending in the maximum position of each rep. For example, during a push up, when you're in the lowermost position, you need to have an approximate idea of how long you take to push yourself back up. In other words, how long you spend touching your chest to the floor. For me it is around 500 ms which I've set in the delay. If your reps are slower, you'll have to increase it to around 1s (1000ms).

You don't have to be super accurate about it. I would suggest you to keep a watch in front of yourself and perform a few push ups to find out. For jump ropes, this delay will be much lower. Once you've finished tweaking the code, you can upload it to your board.

Downloads

Assemble the LEDs

IMG_20200707_122348-01.jpeg
IMG_20200709_142846-01.jpeg
IMG_20200707_124244-01.jpeg

Stick the LEDs to each of the holes on the top plate. You can use super glue or hot glue.
To fit everything inside the small enclosure, I placed the Nodemcu upside down making sure the power connector passes through the hole made for it on the side wall.

Assemble the Other Electronics

IMG_20200707_124535-01.jpeg
IMG_20200709_122714-01.jpeg

I then stuck the proximity sensor on top of it with double sided tape and bent the sensor bulbs up. You can cover the indication LEDs of the proximity sensor with black insulation tape so that there's no light source other than our 4 LEDs.

Then I stuck the top plate onto the base making sure the sensor bulbs pass through the cut out made for them.

Ready to Work-out

IMG_20200709_143614-01.jpeg
IMG_20200709_143752-01.jpeg

So now all that is left is to warm up and get working out. This device not only counts your reps but in a way, it motivates you to do more. As you progress, you can increase the cutoff rep count for each LED. You can add an LCD screen instead of the LEDs, but it would make things complicated.

Tip: If you're using this to count your squats, be careful not to sit down on it when you're tired :p