Exercise Recorder

From Microduino Wiki
Revision as of 07:05, 23 September 2015 by 1304410487@qq.com (talk)
Jump to: navigation, search
Language: English  • 中文

Objective

DIY an electronic device to remind movement time and count all kinds of exercises.

xyz

Schematic

Microduino-motion can detect motion change. The buzzer will make sound along with movement counting. Timing each exercise by RTC module, it can record four times of exercise. The current date and time will be displayed on OLED, which can be adjusted via Bluetooth on your phone.

Equipment

Module Number Function
Microduino-CoreUSB 1 Core board
Microduino-Sensorhub 1 Sensor pin board
Microduino-Motion 1 Altitude detection modules
Microduino-BT 1 Bluetooth module
Microduino-OLED 1 Display module
Microduino-RTC 1 Clock module
Microduino-BM 1 Battery management
Microduino-Duo-V 1 Extensive board
Microduino-Buzzer 1 Buzzer
  • Other Equipment :
    • One battery
    • Lego
Exercise record.jpg

Hardware Buildup

  • Setup 1:Connect CoreUSB to PC, open example program, select the right board and download program.

sport_motion

  • Setup2:Stack all modules. Connect OLED and Sensorhub to Duo-V.
  • Setup3:Connect two Buzzer modules to D6 pin of Sensorhub.
Microduino-sensorhub rule.JPG
  • Setup4:Connect battery to BM.

Software Debugging

  • Function Description
    • “bluetooth()” Receive Bluetooth data on the phone for time adjustment.
    • “time_long()” Calculate exercise time.
    • “large_time()” Exercise time is sorted by exercise regimen.
    • “lagre()”Exercise regimen is sorted from large to small.
    • “draw()” OLED displays function values.
    • “setRtcTime” Clock setting function.
  • Bluetooth serial port usage
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4, 5); // RX, TX

//#define my_Serial mySerial
#define my_Serial Serial1
  • Movement counting
  if (gy > 80 && ax > -50)
    sport_en = true;
  else if (gy < -80 && ax < -50)
    sport_en = false;

  if (sport_change != sport_en)
  {
    if (sport_en)
    {
      num += 1;
      tone(buzzer_pin, 300);
      Serial.println(num);
    }
    else
      noTone(buzzer_pin);

    sport_change = sport_en;
  }

Result

You can count the sit-ups, dumbbell and other exercises.

Video