Exercise Recorder

来自Microduino Wikipedia
1304410487@qq.com讨论 | 贡献2015年9月23日 (三) 07:08的版本 Equipment
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索
Language English

Objective

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

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

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