Introduction: DIY Smart Ankle Weights
You may have used ankle weights in your life. They make your legs stronger, boost your running speed and even make you more active. However, you can never collect data from your ankle weights. You cannot set your own goals for exercise and don't get motivated to do more. Well, with the help of some tools, you can make your very own smart weights! This project is very easy and will have a positive impact on your lifestyle.
Supplies
- 1x Arduino Uno
- 1x ADXL335 Accelerometer
- 1x HC-05 Bluetooth Module
- 7x Jumper Wires
- 1x 9 Volt Battery Clip
- 1x DC Power Plug
- 1x 9 Volt Battery
- 1x Ankle Weight
Step 1: Building the Connections
Connect the HC-05 Bluetooth Module and ADXL335 Accelerometer to your Arduino using some jumper wires. Solder the battery clip to the DC power plug and add a switch in between.The overall connections are:
- ADXL335 Y-OUT pin to Arduino A3 pin
- ADXL335 VCC pin to Arduino 3.3V pin
- ADXL335 GND pin to Arduino GND pin
- HC-05 TXD pin to Arduino D5 pin
- HC-05 RXD pin to Arduino D6 pin
- HC-05 VCC pin to Arduino 5V pin
- HC-05 GND pin to Arduino GND pin
Step 2: Uploading the Code
The code for the Arduino is pretty simple and uses a variety of formulas. Every time you lift your leg, the ADXL335 adds a step. Then, the program calculates your vitals from your steps along with your height and weight. Finally, the Arduino sends the data to your phone via Bluetooth. Here is the code:
#include <SoftwareSerial.h> SoftwareSerial Bluetooth(5,6); // (TXD, RXD) of HC-05 char BT_input; int height=135; // enter your height(in cm) int weight=35; // enter your weight(kg) float cals1; float cals2; int steps=0; float cals3; float distance; float stride; float cals0; void setup() { Bluetooth.begin(9600); // Begins communication with HC-05 Serial.begin(9600); // Begins communication with Serial Monitor pinMode(A3,INPUT); // Defines ADXL335 Y-OUT pin } void loop() { int raw_result = analogRead(A3); //Reads data from ADXL335 int mapped_result = map(raw_result, 0, 1023, 0, 255); //Maps the received data if(mapped_result<=75&&mapped_result>=60){steps+=2; delay(500);} //Adds 2 steps as we need to count steps taken by both legs stride=height*0.43; distance=stride*steps; distance=distance/100000; // Formula to find distance in KM cals0=weight*0.57; cals1=steps/distance; cals2=cals0/cals1*10; cals3=(cals2/10)*steps; //Formula to find calories Serial.print(mapped_result); //Prints the calculated data to Serial Monitor Serial.print(" steps: "); Serial.print(steps); Serial.print(" "); Serial.print(distance); Serial.print(" "); Serial.print(" "); Serial.println(cals3); if (Bluetooth.available()) {BT_input=Bluetooth.read(); if (BT_input=='1') {Bluetooth.print("Calories: ");// Sends the data to Arduino via Bluetooth Bluetooth.print(cals3); Bluetooth.print(" cals Steps: "); Bluetooth.print(steps); Bluetooth.print("steps Distance: "); Bluetooth.print(distance); Bluetooth.print(" km");} } }
Step 3: Creating the App
The app receives the data from the HC-05 chip to the Smartphone via bluetooth.You use the listpicker to choose which Bluetooth device you want to send your data to. Then your app receives the data from your HC-05. The blocks for the app are shown above. (App created using MIT App Inventor 2)
Step 4: Taping the Connections
The final step is to tape all the connections. You can do it like the way I have, or use your own creativity. However, do place the accelerometer like I have done in the image.
Step 5: Enjoy!
Use this gadget while going for walks, jogs, workout sessions etc. You can collect data from this gadget and use it to set new goals.
I hope that you enjoyed this instructable and will use my gadget for a healthier lifestyle.