Difference between revisions of "Exercise Recorder"
From Microduino Wiki
(Created page with "Excercise recorder") |
|||
Line 1: | Line 1: | ||
− | Excercise recorder | + | {{Language| Excercise Recorder}} |
+ | {| style="width: 800px;" | ||
+ | |- | ||
+ | | | ||
+ | ==Objective== | ||
+ | DIY an electronic device to remind movement time and count all kinds of exercises. | ||
+ | [[File:exercise recorder.jpg|600px|center|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== | ||
+ | {|class="wikitable" | ||
+ | |- | ||
+ | |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 | ||
+ | |||
+ | [[File: Exercise_record.jpg|600px|center|thumb]] | ||
+ | |||
+ | ==Hardware Buildup== | ||
+ | *Setup 1:Connect CoreUSB to PC, open example program, select the right board and download program. | ||
+ | [https://github.com/Microduino/Microduino_Tutorials/blob/master/MCookie_Tutorial/sport_10dof/sport_10dof.ino sport_motion] | ||
+ | *Setup2:Stack all modules. Connect OLED and Sensorhub to Duo-V. | ||
+ | [[File: Exercise_record_setup_1.jpg|600px|center|thumb]] | ||
+ | *Setup3:Connect two Buzzer modules to D6 pin of Sensorhub. | ||
+ | [[file:Microduino-sensorhub_rule.JPG|thumb|800px|center]] | ||
+ | [[file: Exercise_record_6.JPG|thumb|800px|center]] | ||
+ | *Setup4:Connect battery to BM. | ||
+ | [[file: music_boxz _bm.JPG|thumb|800px|center]] | ||
+ | |||
+ | ==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 | ||
+ | <source lang="cpp"> | ||
+ | #include <SoftwareSerial.h> | ||
+ | SoftwareSerial mySerial(4, 5); // RX, TX | ||
+ | |||
+ | //#define my_Serial mySerial | ||
+ | #define my_Serial Serial1 | ||
+ | </source> | ||
+ | |||
+ | *Movement counting | ||
+ | <source lang="cpp"> | ||
+ | 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; | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | ==Result== | ||
+ | You can count the sit-ups, dumbbell and other exercises. | ||
+ | |||
+ | ==Video== | ||
+ | |||
+ | |} |
Revision as of 07:05, 23 September 2015
Language: | English • 中文 |
---|
ContentsObjectiveDIY an electronic device to remind movement time and count all kinds of exercises. SchematicMicroduino-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
Hardware Buildup
Software Debugging
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4, 5); // RX, TX
//#define my_Serial mySerial
#define my_Serial Serial1
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;
} ResultYou can count the sit-ups, dumbbell and other exercises. Video |