H.W.T.S - Home Workout Trainer System - IoT Device

by Yoachben in Circuits > Arduino

27 Views, 0 Favorites, 0 Comments

H.W.T.S - Home Workout Trainer System - IoT Device

IoT Final - H.W.T.S - Home Workout Trainer System

Introducing HWTS (Home Workout Trainer System) — your smart, at-home fitness assistant built for workout enthusiasts who want real-time feedback, enhanced form tracking, and intelligent workout support.

Whether you're fine-tuning your plank technique, monitoring breathing during recovery, or working out in a warm environment, HWTS has your back. It’s designed to help you stay accountable, optimize your form, and bring smart automation to your home workouts.

Powered by an ESP32 microcontroller, integrated with a variety of sensors, and connected to the Blynk mobile app, this system blends physical activity with intelligent features for a smarter and safer training experience.

No need for bulky gym equipment or expensive subscriptions — HWTS puts smart coaching and motivation in your own space.

Supplies

IMG_2429.JPG
IMG_2430.JPG
IMG_2431.JPG
IMG_2432.JPG
IMG_2433.JPG
IMG_2434.JPG
IMG_2436.JPG
IMG_2437.JPG
IMG_2438.JPG
IMG_2439.JPG

Hardware:

- ESP32 Microcontroller

- Microphone

- LED Strip

- Speaker

- Servo-motor

- IR blaster

- Ultrasonic Proximity Sensor

- IR Receiver

- Accelerometer

- Wires and Connectors

- Thin Rope (or Lace)

- Candy Box


Software:

- Blynk App and Account

- Arduino IDE (for programming the ESP32)

Environment Configuration

1. Arduino IDE Installation:Download and install the Arduino IDE from the official website.

2. ESP32 Configuration:Follow instructions to add ESP32 board support to Arduino IDE.

3. Blynk Setup:Create a Blynk account, then download and log into the Blynk app on your smartphone.

Setting Up IR Frequency for AC Control

1.⁠ ⁠Connect the IR Receiver to pin 15

2.⁠ ⁠Upload the "SimpleIRReceiver" sketch provided below to the ESP32 using Arduino.

3.⁠ ⁠Open the Serial Monitor and point the AC remote at the IR receiver.

4.⁠ ⁠Press the power button to turn on the AC.

5.⁠ ⁠Note the decoded signal details printed to the Serial Monitor.

In our case what was printed from the remote was:

//Protocol=NEC Address=0x4 Command=0x8 Raw-Data=0xF708FB04 32 bits LSB first
//Send with: IrSender.sendNEC(0x4, 0x8, <numberOfRepeats>);
//
//Protocol=NEC Address=0x4 Command=0x8 Repeat gap=40050us
//
//Protocol=NEC Address=0x4 Command=0x8 Repeat gap=96600us
//
//Protocol=NEC Address=0x4 Command=0x8 Repeat gap=96550us


so in our example we should input in the command

IrSender.sendNEC(0x4, 0x8, 3);

in the following code block in our main file's loop:

if (lastIRSendTime == 0 || currentTime - lastIRSendTime >= irInterval) {
IrSender.sendNEC(0x4, 0x8, 3); // replace with your appropriate values
Serial.print("Sent IR signal ");
Serial.println(irSendCount + 1);
irSendCount++;
lastIRSendTime = currentTime;
}


which means:

o Protocol: NEC

o Address: 0x4

o Command: 0x8

and send three times for reliability

Hardware Connections Setup

IMG_2442.JPG

1. Connect your ESP32 to your computer using a compatible cable.

2. Attach the Ultrasonic Proximity Sensor:

- Echo pin to pin 17

- Trigger pin to pin 16

- VCC pin to one of the 5V VCC pins

- Ground to pin 5

2.5. Feel free to extend the connectors using the extension wires to reach the correct placement for the sensor.

3. Connect the Servo to pin 23.

4. Connect the microphone to pin 32.

5. Connect the LED Strip to pin 18.

6. Plug the Speaker into pin 14.

7. Plug the Accelerometer:

a. Plug the SDA to pin 21.

b. Plug the SCL+GND+VCC to pin 22.

8. Finally, attach the IR Blaster to pin 15.

Blynk Configuration

Screenshot 2025-03-29 at 21.06.06.png
Screenshot 2025-03-29 at 21.59.43.png
Screenshot 2025-03-29 at 21.59.54.png
Screenshot 2025-03-29 at 22.00.09.png
Screenshot 2025-03-29 at 22.00.17.png
Screenshot 2025-03-29 at 22.00.23.png
Screenshot 2025-03-29 at 22.21.13.png

Follow these steps to configure Blynk. Don't worry, every step includes Blynk screenshots:

1. Go to the Developer Zone.

2. Access New Templates.

3. Choose Virtual Pin.

4. Create a Virtual Pin: Assign 6 virtual pins as shown in the screenshots.

5. Choose Events and Notifications.

6. Create Events: Create 2 events named form_check and breathing_event.

  1. Add proper description to each one.
  2. Under Notifications, enable notifications, choose push notifications to device owner, and turn on both sliders below.
  3. under Settings, for form_check, set 1 message and 1 second, and enable both sliders in "Show in notification and event section".
  4. under Settings, for breathing_event, set 1 message and 1 minute, and enable both sliders in "Show in notification and event section".

8. Navigate to Devices and create a New Device (select from template options).

Blynk App Setup

IMG_9306.PNG
IMG_9307.PNG
IMG_9308.PNG

Follow these steps to configure Blynk App on your phone:

  1. Download the Blynk app from your device's app store.
  2. Log in to your existing Blynk account.
  3. Your pre-created template will automatically load upon login. (step 1)
  4. Use the settings button to customize the buttons on your dashboard according to your preferences. – screenshot for example (step 2)
  5. Explore different design options to enhance user interaction.
  6. Your customized dashboard is now ready for use!


ESP32 Programming

  1. Download the provided code files.
  2. Update the code in the appropriate places in hwts.ino:
  3. Update the Virtual PIN numbers to correspond to your blynk datastream setup.
  4. Update the IrSender line as instructed in Step 3.
  5. Update the WiFi name and password in the code.
  6. Update the Blynk templateID, authToken and TemplateName, according to your Blynk device.
  7. Upload your code to the ESP32.

Setup Your Workout Environment

  1. Set the Proximity sensor at your exercise end of range of motion.
  2. Put the Led strip in a visible place.
  3. Tie your post-workout treat to the servo and place in its reserved spot.
  4. Start your workout on the Blynk app.
  5. Exercise, exercise, exercise!
  6. You can setup plank timers using the Blynk app!
  7. Make sure your form is proper, otherwise the app will let you know you're doing something wrong!
  8. If you're breathing hard, the app will let you know it's time for a break...
  9. When you finish the exercise don't forget to finish it on the Blynk app and collect your treat!

Have Fun With It!

Thank you for using H.W.T.S! We value your engagement and would love to hear about your experience, any unique modifications, or creative adaptations you made. Share your success stories and tips in the comments to inspire and support our community. Together, we can get fitter and healthier!

Enjoy your building journey, and a big thank you from the entire team!