Pushup Counter

by coltonajanovec in Circuits > Arduino

10 Views, 0 Favorites, 0 Comments

Pushup Counter

IMG_0093.jpg

I made a push up counter that attaches to my push up board. I made this because I thought it would be challenging and also a cool addition to my workout routine.

Supplies

f9f19959-a72c-48cf-9198-6518354c3f8e.jpg
  1. LCD display
  2. Long breadboard
  3. 26 jumper wires
  4. Spark fun kit
  5. Arduino blueprint
  6. Pushup board
  7. 3d printer
  8. 2.85mm filament

Make Arduino Blueprint

FN8963QMAB3C2A0.jpg

Make wire connections with LCD display and ultrasonic distance sensor along with the arduino itself with ground wires etc. Also, make sure resistors have correct ohms. This depends on the different screens you use and brands of materials. A challenge that comes with this step can be mixed up wiring or needing to add a potentiometer to see the values on the screen.

Make Arduino Enclosure With Holes for Battery and Screen

FQ6UFJRMAB3C28B.jpg

A two level enclosure in order to enclose breadboard, arduino, and has holes for batteries and screen display. This was mostly cut out on the bandsaw and hot glued together. Optionally you can paint the enclosure for aesthetic value. Measurements based on breadboard, batteries, and arduino that one uses.

Make Mount for Distance Sensor

IMG_0074.jpg
Screenshot 2025-05-06 171352.png

3d printed mount perfectly measured for Ultrasonic distance sensor. To make this was pretty simple. I measured the dimensions of the sensor and created a fusion design as a slot that it could fit inside.

Debugged Code

/* PUSH UP COUNTER



An ultrasonic sensor measures the distance between you and your head, if the distance is larger than 20 cm a rgb-led will shine red,

if the distance is between 10 and 20 cm, it turns magenta

and if it is less than 10 cm it turns blue, and a point appears on a lcd screen.

Every ten pushups it makes a sound.

You can reset the score with the push of a button.

*/


#include <LiquidCrystal.h> // include LCD library


#define BLUE 12 // define RGB-led pins

#define RED 10


const int trigPin = 8; //set pins for the ultrasonic sensor, button and buzzer

const int echoPin = 9;

const int buttonPin = A0;

const int b = 13;


long duration; // set integers

int distance;

int i;

int buttonState = 0;

int x = 1;

int y = 1;


LiquidCrystal lcd(6, 7, 2, 3, 4, 5); // set lcd pins


void setup() {

Serial.begin(9600); // begin in 9600 baud


pinMode(trigPin, OUTPUT); //set pin modes

pinMode(echoPin, INPUT);

pinMode(buttonPin, INPUT);

pinMode(b, OUTPUT);

pinMode(RED, OUTPUT);

pinMode(BLUE, OUTPUT);


lcd.begin(16, 2); // begin lcd, define scale of lcd (16 places in a row, 2 rows)

lcd.print("Push Ups:");




}


void loop() {

digitalWrite(trigPin, HIGH); // send out an ultra sonic sound for 10 microseconds and measure the time it took for the sound to go from the trigpin to the echo pin

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance = duration * 0.034/2; //convert the time the signal took to travel to distance in cm


if (distance >= 20) {digitalWrite(RED, HIGH); //configure RGB-led to burn red, magenta or blue depending on distance

digitalWrite(BLUE, LOW);}

if (distance <= 20) {digitalWrite(BLUE, HIGH);}

if (distance <= 10) {digitalWrite(RED, LOW);}


if (i == (10 * y) && x == (1 * y)) { //this if statement plays a sound every ten pushups

tone(b, 146.8);

delay(50);

noTone(b);

delay(100);

tone(b, 146.8);

delay(50);

noTone(b);

delay(50);

tone(b, 293.7);

delay(100);

noTone(b);

x ++;

y ++;

}

else if (distance <= 10) {delay(350);} //this if else statement makes sure that the time between pushup-readings always stay the same


buttonState = digitalRead(buttonPin); //these lines of code resets every integer and the lcd to the original state by the press of a button

if (buttonState == HIGH) {

i = 0;

x = 1;

y = 1;

lcd.setCursor(0,1);

lcd.print("0 "); }


lcd.setCursor(0, 1); // set cursor on the second row


if (distance <= 10 ) {i ++;} //print a point if a pushup has been done

lcd.print(i,DEC);


while (distance <= 10) { //if the distance stays smaller then ten for a while, this piece of code makes sure that only one point is given for one pushup

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance = duration * 0.034/2;

delay(100);}

}

Attach to Push Up Board, Plug In, and Workout

IMG_0072.jpg

I made a mount for the distance sensor on the push up board, once it is all plugged in, you do your pushups and watch the screen count.

Assembly Report

  1. Component Description: Briefly describe the components you are assembling

Arduino screen mount, ultrasonic distance mount, arduino enclosure

  1. Which components of your assembly did you manufacture that need to be assembled? The arduino enclosure



  1. Which components of your assembly were purchased? How did these integrate with the manufactured components?

The pushup board was purchased by me and it is the whole purpose of the parts because the screen shows the pushups counting and the sensor senses how close my chest is to the ground.

  1. What were the biggest challenges you faced in assembling these parts?

Definitely keeping stability and getting the right measurements for the screen and the sensor mounts.

  1. Were any changes made to improve fitment during fabrication? How were they improved?

Yes I made tighter side pieces each time for the sensor mounts so it wouldn’t move.

  1. How could the assembly process be improved if you or another student were to replicate this process?

I would make sure to measure twice before entering the dimensions into the cad model and doing tons of final prints.

  1. Include step-by-step photos of the assembly process below. Include a different photo for each step or process used to assemble your parts.


Manufacturing Report

  1. Component Description: Briefly describe the pieces you have fabricated and what function they serve in your project

I’ve created a mount to sit my arduino sensor on so it doesn’t move and another one for the screen. I have made a little enclosure for the arduino to sit in once the coding and arduino schematic are working properly.

I am creating an enclosure for the arduino and all the wires so that it doesn’t look messy.

I also sautered connections for the lcd screen and the sensor so they wouldn’t have to be directly connected to the bread board.



  1. Did you complete the manufacturing of all individual components required for your project?

Yes except for the pushup board itself.

  1. What manufacturing processes were used for each component?

For the mounts I had to make cad models and do countless prints to make sure they fit perfectly and I would have to change certain thickness and length dimensions.

For the enclosure I am just going to manually cut out wood and connect them together to make a good looking enclosure.

  1. What new skills were required for you to manufacture these parts? Where did you learn about these skills and what resources would you share with another student learning these skills? I learned how to properly use 3d print software, filament, etc. without breaking the machine or messing up my prototypes. I would share the google classroom instructions with another student because they are very helpful.



  1. What materials were used for which component? (Size and type)

All I used was regular 3d print filament and hot glue to attach to my board.

For the enclosure just typical wood.

  1. Describe step by step, the processes for manufacturing each component

For the sensor mount I

1.Used calipers to measure sensor

2. Made a rough cad model

3.See if It fits

4Repeat with screen

For enclosure

1.Get a general layout of arduino components

2. Measure for an enclosure

3.Cut out wood

4.Connect Parts

5.test

6.repeat

  1. What were the biggest challenges you faced in manufacturing these parts?

Getting the sizing right and also making the code and arduino schematic to make the screen and the sensor correlate with each other.

  1. Were any jigs or fixtures required to make these parts?

No

  1. Were any components tested or measured to check fitment during fabrication? How were they tested and which components?

As above the two mounts had to be fixed and fitted multiple times to be functional.

The enclosure was also measured

  1. How could the manufacturing process be improved if you or another student were to replicate this process?

If another person were to do this they could make more careful measurements and study coding beforehand to be more prominent in it.

  1. Include step by step photos of fabrication process below. Include a different photo for each step or process used to fabricate/manufacture your parts.