Skip to main content

Design a Bench Press Analyzer

The bench press analyzer can be perfectly fixed on the barbell, detect the balance and motion range of bench press and feedback via LCD screen, LED blinking and buzzer beeping.

1. Motivation:

I am an amateur bodybuilder and I notice that quite a lot of people have their barbell leaning to one side when doing bench press. This widespread problem even occurs on experienced bodybuilders and is unfortunately hardly noticed by themselves.

A bench press analyzer can tell people whether they have unbalanced strength development when doing bench press. Also, it can provide rotation information about the bar caused by failure of trainer's wrists which should not happen in a proper movement. And it’s able to not only count repetition, but monitor and analyze whether the rep is too quick or too slow. By fixing the equipment at the middle of the barbell, it can remind the trainer about their movements by beep sound and clear information on LCD.

2. Components:

  • Arduino UNO

uno2_1a478b1db803a30de9b30cc30f46bf5502c43a7d.jpg

 

  • ADXL335 Accelerometer Board

ADXL3352_0250ceb5a76db590125554785ee11923bf444488.jpg

 

  • VL6180X Distance Board

VL6180x1_87d82681597ebae5c0e7fde6cbef7d964d8ee59e.jpg

 

  • Nokia 5110 (LCD-10168)
  • Battery and Battery Holder Case with w/DC Jack for Arduino
  • Buzzer
  • LEDs, Resistors, Triode, Buttons

3. Detailed System Diagram

1_d7dd557abe56ceb65d46bec67499d06d00a5f1a8.jpg

 

4. Design Process

1). Pin Mapping

Because of some pins with special functions, it’s better to arrange pins from ones with complex function to normal GPIO. According to sensors and components I choose, the 3-axis accelerometer needs 3 pins with ADC input function. The distance sensor needs a pair of pins with I2C protocol. LCD screen needs a set of pins with SPI protocol. (It’s also possible to apply any pin for software SPI with relatively slow transmission speed.) Last but not the least, the buzzer needs a pin with PWM function.

The following table is the final pin mapping.

Master Pin

Slave Pin

Pin (Digital)

Pin (AVR)

Function

0

PD0

RX

NC

1

PD1

TX

NC

2

PD2

GPIO

LED LEFT

3

PD3

PWM

BUZZER

4

PD4

GPIO

LED RIGHT

5

PD5

GPIO

LDC DC

6

PD6

GPIO

LDC RESET

7

PD7

GPIO

LCD SELECT

8

PB0

GPIO

NC

9

PB1

GPIO

LCD BACKLIGHT

10

PB2

SPI SS*

RESET BUTTON

11

PB3

SPI MOIS

LCD DATA IN

12

PB4

SPI MISO*

BACKLIGHT BUTTON

13

PB5

SPI SLK

LCD SLK

14

PC0

ADC0

ADXL335 X

15

PC1

ADC1

ADXL335 Y

16

PC2

ADC2

ADXL335 Z

17

PC3

ADC3

NC

18

PC4

I2C SDA

VL6180 SDA

19

PC5

I2C SCL

VL6180 SCL

* Although Nokia 5110 only requires MOSI and SLK in a set of SPI pins, it’s better to keep corresponding MISO and SS pin unused. However, on account of running out of pins, I use these two pins as GPIO. As a result, I have to use software SPI for LCD screen.

2). Initialize ADXL335 and VL6180 on Arduino UNO

For ADXL335, I connect X-axis to Arduino A0. It’ s easy to print ADC input data on serial monitor. Check the ADC data when ADXL board is placed horizontally and vertically from 2 sides and do linear calibration with 0°, 90° and -90° to get the calibration expression which can convert any data we get into leaning degree. Because trainers are not able to focus on reading accurate degree change and doing heavy bench press simultaneously, it’ s better to adjust the data’s precision to 1° or 2°.

For VL6180x, I call the ‘Adafruit_VL6180X.h’ library and get the range data on serial monitor.

3). Initialize LCD screen and other components

Connect LCD with Arduino UNO and call ‘Adafruit_GFX.h’ and ‘Adafruit_PCD8544.h’ library. Try to use its function print strings on LCD screen and print the data you get from sensors on screen.

For buzzer, I use tone() and noTone() functions to control it. Whenever the device moves into a position which is less than 50mm from trainer’s body, the buzzer beeps with parameter ‘count’ plus 1 on LCD screen meaning a rep of full-range motion done. Otherwise, the buzzer stays quiet. The figure below is the buzzer control circuit.

Buzzer1_a75f532d1bdbe5563ce345ea9998d1f1e96d03ae.jpg

 

For reset button, whenever trainers want to start a new set of bench press, pressing that button will reset the ‘count’ on LCD to 0 without restart the device. Also, to prevent balance initialization error, reset button can also be used to reset the degree before training.

LCD backlight control button is used to turn on and off LCD backlight.

The figure below is the button circuit.

Button2_3b44ad463b6f1585d8e227e980504c089e631c85.jpg

 

For the two LED, when the leaning degree is less than 15°, both LED are off. When the degree is from 15° to 40°, the LED on the leaning side is blinking. When the degree is larger than 40°, the LED on the leaning side is on.

4). Soldering components on a board.

Considering simplifying the circuit and stabilize the connection. I solder two sensors, buzzer, buttons and related control circuit on a board. And I also solder headers on it to connect with Arduino.

The figure below is the board.

_201907291157221_868be31d18cbf7edf9f57048effee4a4b883ac81.jpg

 

5). Design device case

The device case is mainly used to contain 4 parts: Arduino UNO, the board with sensors and buttons, LCD screen and battery case. Thus, there are several requirements when design the case.

a). The board with sensors should face down so that it can test the range from trainer to the device.

b). LCD screen should face toward the front with LEDs so that the trainer can check the information on screen.

c). The structure of the case under the bar should be as thin as possible. Otherwise, it may effect full range motion of the bar.

d). The whole case should be fixed on a bar with 28mm diameter. Also, it should be easy to assemble and disassemble.

e). The battery case is relatively heavy, so it’s better to keep its center right above the bar to prevent unexpectable rotation of the case.

The figures below is the structure I design with DesignSpark Mechanical.

axis1_467351a82decf5e0553d24d0c76fb4817353ff65.jpg

 

First, fix two axes on the bar.

Main37_6bb34362657273068cfb5d9a7162c2ead000801d.jpg

 

Then, fix the main case on the axis and fix the battery on the main case.

all_5ea06caf0ce18c919e27b9c064886d6321eaa382.jpg

 

The DSM file of the whole case is attached below for those interested. 

6. Design the PCB board

Here I assemble all the components except Arduino and LCD screen on a PCB board. It’s an Arduino hat board with header directly fit into Arduino UNO. It also has header out to connect LCD screen. The step below is the what I design in DesignSpark PCB.

First, check ADXL335’s datasheet and create its circuit schematic.

ADXL335_S1_3460d0a09491c4f040868ad1619b2afc6e89976a.jpg

 

Then check VL6180’s datasheet and create its circuit schematic. Here I use a LDO to convert Arduino’s 5v to 2.8V which the chip requires.

VL6180X_S1_331e419d8e40e523c197773ddb6b36873afe4415.jpg

 

I assemble all the other components on this main schematic below. When placing all these headers on PCB board, make sure you check the position of corresponding headers on Arduino so that two boards can fit each other. And there is no main and sub schematics in DSPCB, so you need to use same net name to build connections between schematics.

Main_S1_406aa987c2df6f73902a90acf51ffe1af299b3e6.jpg

 

The figure below is what I route on PCB.

PCB4_a2736424dc11a9af4d7cebf6c8cb6b4207cbf692.jpg

 

And the 3D view.

3D_PCB2_7dcdf37df50f2e10cfa90879e63fab9a5dc5e302.jpg

 

For timing reasons, I haven't fabricated PCB board in this project. The DS PCB project file I built is attached below for someone interested in building PCB version of this project. 

Attention: It's better to turn off the device after using. Low battery power will cause self restart of the device. 

Qingwei has not written a bio yet…