Introduction: Arduino, Gimnasio Interactivo (FITTERACTIVO)

Picture of Arduino, Gimnasio Interactivo (FITTERACTIVO)

This project seeks to incorporate the PaviGym system by sensors and lights, including simple exercises, for example deadlifts with dumbell, physical endurance exercises and coordination with a ball, but with a high enough intensity to enhance the physical qualities.


Step 1: MATERIALS (ELECTRICAL DESING)

Picture of MATERIALS (ELECTRICAL DESING)

DEADLIFTS

  • 1 Protoboard: It is a board with holes that are electrically connected together internally.
  • 3 ReedSwitch: It is an electrical Switch activated by a magnetic field.
  • 3 Resistances: Theyare electronic components that have the property of objecting to the passage of electric current.
  • 3 Capacitors: It is an electrical component that stores electrical charge, to release later.
  • Jumper: They are cables connected to the Protoboard.
  • 3 Universal Plate: Electronic component that serves to form circuits by welding.
  • 3 Led: It is a two-lead semiconductor light source.
  • 1 Arduino: It is a platform of electronic prototyping with open source.
  • Multimeter: It is a tool for measuring electrical quantities.
  • Electric Welder: It is a simple electrical tool that has a set of elements that when properly connected generate welds electrical and electronic circuits.

BALL - RESISTANCE

  • 6 Piezoelectrico: It is a phenomenon that occurs in certain crystals, when subjected to mechanical stresses, in mass acquires an electric polarization.
  • 12 Resistences: Theyare electronic components that have the property of objecting to the passage of electric current.
  • Jumper: They are cables connected to the Protoboard.
  • 6 Universal Plate: Electronic component that serves to form circuits by welding.
  • 6 Led: It is a two-lead semiconductor light source.
  • 1 Arduino: It is a platform of electronic prototyping with open source.
  • Multimeter: It is a tool for measuring electrical quantities.
  • Electric Welder: It is a simple electrical tool that has a set of elements that when properly connected generate welds electrical and electronic circuits.

Step 2: PROCESS (ELECTRICAL DESING)

Picture of PROCESS (ELECTRICAL DESING)

DEADLIFTS

  1. Connect the capacitor to the Reed Switch: Reed Switch has two legs, one is connected to earth and the other at 5V, the negative side is connected to the Arduino pin and debounce connects to the Reed Switch to control jumps, the negative part of debounce is connected to the negative part of Reed Switch and the positive part respectively.
  2. On the negative side of the LED is connected the resistance ( which is connected to the earth “GND”).
  3. Connect the Arduino pin on the positive side of the LED.
  4. Connect two Reed Switch and two LED with the same operation of the first.
  5. Enter the exercise code and check the operation.
  6. After checking the operation of the code, breadboards were purchased (5cm x 7cm) and they were welded differently.
NOTE: Debounce was placed through hardware to avoid sudden jumps of Reed Switch sensor ( this as a case of prevention).

BALL - RESISTANCE

  1. To conduct the tests, one Protoboard and a piezoelectric was used to check the operation of the code.
  2. Other piezos were placing each with its respective LED (330ohms) and resistances (220ohms). None of the piezos was connected to 5V, but it was necessary to connect the Protoboard to a source at 5V at Arduino without need that piezo and the LED have the same connection.
  3. After checking the operation and to see that the test result positive, breadboards (5cm x 7cm) was purchased, here the piezos were installed with their respective LED to a different distribution for the hererogeneity of the breadboards.
  4. Finally the code was introduced

Step 3: MATERIALS (INDUSTRIAL DESING)

Picture of MATERIALS (INDUSTRIAL DESING)

DEADLIFTS

The materials for aesthetic design were as follow:

  • 1 table of MDF.
  • 3 acetate.
  • 3 paperboard craft and 1 paperboard Stone.
  • 3 silk paper.
  • Gluer
  • Scissors
  • Duct tape
  • Laser cutter
  • Paint and brushes
  • Liquid silicone
  • Polystyrene square

BALL - RESISTANCE

The materials for aesthetic design were as follow:

  • 1 Table of MDF
  • Screws
  • Triplex wood
  • 6 silk paper
  • Gluer
  • Scissors
  • Duct tape
  • Laser cutter
  • Paint and bruses
  • Polystryrene square
  • Liquid silicone
  • Balsa sticks

Step 4: PROCESS (INDUSTRIAL DESING)

Picture of PROCESS (INDUSTRIAL DESING)

DEADLIFTS

To design the prototype was made the following:

  1. MDF Wood was purchased, it was cut with a diameter of 8cm and the same Wood was cut circles with a diameter of 20cm.
  2. Acetate was placed with paperboard in the circles for him to take resistance and not see below the White silk paper that was used.
  3. Paperboard Stone was used as basis, in this base, the circuits were tied with duct tape to achieve firmness in the gluer.
  4. Circuits (each breadboard) were distributed in the form of triangle.
  5. Polystyrene pieces were used as support.
  6. The polystyrene was stuck to the paperboard stone and MDF.

BALL - RESISTANCE

To design the prototype was made the following:

  1. MDF wood (100cm x 70cm) was purchased, it was cut with six circles of 19cm diameter in the laser cutting machine.
  2. Triplex Wood was cut in the laser cutting machine, with a measure of 21cmx21cm , 8 small circles of 3cm diameter were cut and in the middle 16 holes were opened (to give way to light).
  3. In this wood silk paper was installed, each of these cut with the same measure as the circles.
  4. To install each square on the MDF, screws were used.
  5. Triplex wood was purchased for to be the basis of the entire circuit.
  6. 16 polystyrene were placed in support of the table MDF (were distributed so that is organized and without interrupting the passage of other circuits).
  7. The circuit stuck in the base with duct tape so that it had more firmly.
  8. For the base holding each sensor, balsa sticks was placed, three for each sensor, each balsa sticks opened a hole to make it easier to hold the sensor, after hitting the sticks, the three sticks were place in a paperboard.
  9. When was installed the base of sensors, the top was placed on the basis of polystyrene.
  10. After, each sensor was stuck to the circle (the sensors were stuck to the back of the square).
  11. Finally, the name of the Project was stuck on top. These were cut buy laser cutting machine with an optimal measure for will not affect the operation thereof.

Step 5: DEVELOPMENT OF ROMANA DUMBBELL

Picture of DEVELOPMENT OF ROMANA DUMBBELL
  • A bafle was achieved, it was disarmed and the part that containing a magnet was used.
  • Paperboard craft adn pasteboard were purchased to cover the romana dumbbell.
  • Polystyrene half round was purchased and it placed on the top, in the same polystyrene, an arch was installed and it was stuck with liquid silicone.
  • The romana dumbbell was Painted.

Step 6: CODE

DEADLIFTS

#include <softwareserial.h>
SoftwareSerial BT1(4, 2); // RX, TX they cross
#define Sensor1 8
#define Sensor2 10
#define Sensor3 12
#define Led1 9
#define Led2 11
#define Led3 13
boolean s1, l1;
boolean s2, l2;
boolean s3, l3;
int accountant;
int numSeries;
void setup() {
  pinMode(Sensor1, INPUT);
  pinMode(Sensor2, INPUT);
  pinMode(Sensor3, INPUT);
  pinMode(Led1, OUTPUT);
  pinMode(Led2, OUTPUT);
  pinMode(Led3, OUTPUT);
  l1 = true;  l2 = false;  l3 = false;
  accountant = 0;
numSeries = 1;
Serial.begin(9600); BT1.begin(9600); }
void loop() {
  inputReadings ();
process ();
if ( numSeries < 3) {
delay(100); } else if ( numSeries == 4) {
l1 = l2 = l3 = false; numSeries ++;
Serial.println("end exercise");
BT1.println("end exercise");
} else if ( numSeries > 4) {
delay(15000); Serial.println("starts new excerise");
BT1.println("starts new excerise");
numSeries = 1;
l1 = true; } writeOutputs ();
}
void inputReadings() {
s1 = digitalRead(Sensor1); s2 = digitalRead(Sensor2); s3 = digitalRead(Sensor3); }
void writeOutputs() {
digitalWrite(Led1, l1); digitalWrite(Led2, l2); digitalWrite(Led3, l3); }
void process() {
checkSquat1 ();
checkSquat2 ();
checkSquat3 ();
nextSeries ();
}
void checkSquat1 () {
if ( s1 == true && l1 == true) { accountant++;
l1 = false; int r = random(100); if ( r > 50) { l2 = true; } else { l3 = true; } } }
void checkSquat2 () {
if ( s2 == true && l2 == true) { accountant++;
l2 = false; int r = random(100); if ( r > 50) { l1 = true; } else { l3 = true; } } }
void checkSquat3 () {
if ( s3 == true && l3 == true) { accountant++;
l3 = false; int r = random(100); if ( r > 50) { l2 = true; } else { l1 = true; } } }
void nextSeries () {
if ( accountant > 6) {
accountant = 0;
numSeries++;
Serial.print("changing series: ");
Serial.println(numSeries);
BT1.print(numSeries- 1);
BT1.println("finished");
} }

BALL - RESISTANCE

#include <softwareSerial.h>
SoftwareSerial BT1(4, 2); // RX, TX they cross
#define piezo1 A0
#define piezo2 A1
#define piezo3 A2
#define piezo4 A3
#define piezo5 A4
#define piezo6 A5
#define Led1 7
#define Led2 6
#define Led3 5
#define Led4 4
#define Led5 3
#define Led6 2
#define umbral 50
boolean s1, l1;
boolean s2, l2;
boolean s3, l3;
boolean s4, l4;
boolean s5, l5;
boolean s6, l6;
int accountant;
int numSerie;
void setup() {
  pinMode(Led1, OUTPUT);
  pinMode(Led2, OUTPUT);
  pinMode(Led3, OUTPUT);
  pinMode(Led4, OUTPUT);
  pinMode(Led5, OUTPUT);
  pinMode(Led6, OUTPUT);
  l1 = true;   l2 = false;  l3 = false;  l4 = false;  l5 = false; l6 = false;
  accountant = 0;
numSeries = 1;
Serial.begin(9600); BT2.begin(9600); }
void loop() {
  inputReadings();
process (); if ( numSeries < 3) {
delay(100); } else if ( numSeries == 4) {
l1 = l2 = l3 = l4 = l5 = l6 = false; numSeries ++;
Serial.println("end exercise");
BT2.println("end exercise");
} else if ( numSeries > 4) {
delay(15000); Serial.println("starts new excerise");
BT2.println("starts new excerise");
numSeries = 1;
l1 = true; } writeOutputs ();
}
void inputReadings() {
s1 = analogRead(piezo1) > umbral; s2 = analogRead(piezo2) > umbral; s3 = analogRead(piezo3) > umbral; s4 = analogRead(piezo4) > umbral; s5 = analogRead(piezo5) > umbral; s6 = analogRead(piezo6) > umbral; }
void writeOutputs() {
digitalWrite(Led1, l1); digitalWrite(Led2, l2); digitalWrite(Led3, l3); digitalWrite(Led4, l4); digitalWrite(Led5, l5); digitalWrite(Led6, l6); }
void process () {
  checkPiezo1 ();
checkPiezo2 ();
checkPiezo3 ();
checkPiezo4 ();
checkPiezo5 ();
checkPiezo6 ();
nextSeries ();
}
void checkPiezo1 () {
if ( s1 == true && l1 == true) { accountant++;
l1 = false; int r = random(100); if ( r < 20) { l2 = true; } else if (r < 40) { l3 = true; } else if (r < 60) { l4 = true; } else if (r < 80) { l5 = true; } else { l6 = true; } } }
void checkPiezo2 () {
if ( s2 == true && l2 == true) { accountant++;
l2 = false; int r = random(100); if ( r < 20) { l1 = true; } else if (r < 40) { l3 = true; } else if (r < 60) { l4 = true; } else if (r < 80) { l5 = true; } else { l6 = true; } } }
void checkPiezo3 () {
if ( s3 == true && l3 == true) { accountant++;
l3 = false; int r = random(100); if ( r < 20) { l2 = true; } else if (r < 40) { l1 = true; } else if (r < 60) { l4 = true; } else if (r < 80) { l5 = true; } else { l6 = true; } } }
void checkPiezo4 () {
if ( s4 == true && l4 == true) { accountant++;
l4 = false; int r = random(100); if ( r < 20) { l3 = true; } else if (r < 40) { l2 = true; } else if (r < 60) { l1 = true; } else if (r < 80) { l5 = true; } else { l6 = true; } } }
void checkPiezo5 () {
if ( s5 == true && l5 == true) { accountant++;
l5 = false; int r = random(100); if ( r < 20) { l4 = true; } else if (r < 40) { l3 = true; } else if (r < 60) { l2 = true; } else if (r < 80) { l1 = true; } else { l6 = true; } } }
void checkPiezo6 () {
if ( s6 == true && l6 == true) { accountant++;
l6 = false; int r = random(100); if ( r < 20) { l5 = true; } else if (r < 40) { l4 = true; } else if (r < 60) { l3 = true; } else if (r < 80) { l2 = true; } else { l1 = true; } } }
void nextSeries () {
if ( accountant > 10) {
accountant = 0;
numSeries++;
Serial.print("changing series: ");
Serial.println(numSeries);
BT2.print(numSeries- 1);
BT2.println("finished");
} }

Step 7: APP (BLUETOOTH AND ARDUINO)

Picture of APP (BLUETOOTH AND ARDUINO)

To transfer data to the Application Arduino a Bluetooth module was used, and a protoboard.

* Bluetooth HC 05

* Bluetooth HC 06

Each of the modules handles a different connection.

Step 8: APP (INTERFAZ)

Picture of APP (INTERFAZ)

Screen 1:

Three buttons were placed and a listapiker.

  • Connect: Searches for bluetooh that are connected.
  • Registration: It is a button that gives Access to another screen for user registration.
  • Enter: It gives Access to the screen exercises.
  • Close: It closed the App

The logo of Fitteractivo was placed , two label (username and password) and two texbox ( to enter de username and password)

Screen 2:

Two buttons were placed.

  • Register myself: It gives access to screen 1 to enter directly to the exercises.
  • Back: It gives Access to the home screen.

Three label were placed (username , password and repeat password), the texbox (type the username , password and repeat password) and the logo of Fitteractivo.

Screen 3:

A button was placed

  • Sign off: It gives access to the first screen.

Two label were placed ( deadlifts and ball resintance) and the logo was placed.

Step 9: APP (CODE)

Picture of  APP (CODE)

Screen 1:

  • When click in registration, you will go to the “registration” screen.
  • When you click in enter, a condition is placed, if “compare texts digitarclave,text = get valueFromWebDB” and if “bluetoothClient1.isConnected” , so it will call BluetoothClient1 and disconnect it, therefore, the exercise screen 3 will open, if that doesn´t happen, will get a warning “ invalid usaer or password”.
  • Before looking in the listapicker “buscarBT” , address and name of the same will be obtained.
  • After looking “buscarBT” , the “buletoothClient1” is selected and called, it is connects to the selected address in “buscarBT” with “star 1” and “length 17”.
  • When click in close he app, immediately closes.
  • When click in the disconnect button, the bluetooth disconnects.

Screen 2:

  • When click in “register myself” a condition is placed, if “compare text digitarClave.text = digitarClave2.text” so it is called the database “TinyWebDB1” where is evaluated and “tag digitarUsuario.Text” and “ValueToStore digitarClave.Text” , then the screen 1 is open, if that doesn´t happen, will get a warning “ passwords don´t match”.
  • When click in “back” automatically returns to screen 1.

Screen 3:

  • When the screen “exercise” starts, a condition is placed, if the “bluetoothClient1” is called with the address “20:16:04:26:53:92 CF2” or the “bluetoothClient2” with the address “98:D3:31:90:32:34 HC-06” so sends a text “1” to the bluetoothClient1 and bluetoothClient2 , in the notification a message appears “ it´s already connected?” and “connection” as a title , and finally “cancelable true”.
  • A clock1 was placed with two conditions, if “bluetoothClient2.isConnected” and if “call bluetoothClient2.BytesAvailableToReceive>=0” , so in the texbox1 the data transfer is done from the Arduino.
  • A clock2 was placed with two conditions, if “bluetoothClient1.IsConnected” and if “call bluetoothClient1.BytesAvailableToReceive>=0”, so in the texbox2 the data transfer is done from the Arduino.
  • When click in close session, automatically returns to screen 1.

Step 10: SOFTWARE

Picture of SOFTWARE
  • Arduino.
  • Adobe Illustrator.
  • App inventor.

Step 11: IMAGES AND VIDEOS OF THE PROCESS FINISHED

Picture of IMAGES AND VIDEOS OF THE PROCESS FINISHED

This are some images of the process finished for each of the exercises.

Step 12: Video

Comments

Juan VicenteP1 (author)2016-11-02

Muy buena explicación. Solo tres anotaciones: (i) hace falta un vídeo del Ball/Resistence, (ii) seria ideal ver a una persona utilizando los desarrollos para hacer ejercicio y (iii) presentar código e imágenes en ingles

DIY Hacks and How Tos (author)2016-11-01

This is a great idea. You could use sensors like this to monitor your workout intensity and even your form. It would be like having a personal trainer to help you get in shape.

About This Instructable

542views

5favorites

License:

More by Ana MariaT1:Arduino, Gimnasio Interactivo (FITTERACTIVO)
Add instructable to: