“Retro Band” is the second version of an open source Arduino wearable device. For me, it shouldn’t be called a “smart band”; it only has basic functions. In fact, it might be better to call it an activity tracker… but the term “smart band” feels more familiar to me. The important feature of smart bands is that they can connect to mobile devices via Bluetooth, recording users’ work schedules.
The Arduino-based Retro Band has a single function: it collects data via an accelerometer and sends it to a mobile device, which calculates the calories burned and steps taken based on the data. The function is simple, which means this device is structurally simpler than the previous “Retro Watch,” making it easier to create based on your personal taste.
The Android application uses the Arduino Retro Band to feedback information and calculate the number of steps walked, and the algorithm used is not complicated. If you have expertise in algorithms, you can replace it with your own. The mobile application stores calorie consumption data, so you can get monthly/daily/hourly chart reports. However, it is important to note that the Arduino Retro Band has a very small memory and cannot store information on its own; it can only work when connected to a mobile device, meaning you cannot collect data solely with the Arduino Retro Band. I believe this issue will be well resolved in future improvements to Arduino.
Step 1: Working Mechanism
The Retro Band consists of an Arduino part and an Android application.
The Arduino part is divided into four main components: the Arduino board, the accelerometer (MPU-6050), the Bluetooth module (HC-06), and a polymer lithium battery (charging board optional).
The Android application also includes four parts: the Android interface, Bluetooth management, algorithm part, and background service.
If the Arduino power is turned on and paired with the Retro Band application, the main board will read the accelerometer data 20 times per second. It then sends the data to the mobile device once per second. The accelerometer measures x-axis, y-axis, and z-axis data (20 times for each of the three axes) and sends them to the mobile device. The Android application receives data from two seconds apart for comparison to find the user’s acceleration patterns in their steps. When the user accelerates their steps, it counts as one step taken. The Android application then calculates calories burned based on the user’s weight and step count, aggregating the data by month, day, and hour.
Step 2: Preparation
Here are the components used to create it: – Arduino Pro Mini 3.3V – Accelerometer/Gyroscope sensor (MPU-6050) – Bluetooth module (HC-06) – USB asynchronous transceiver adapter (FTDI)
Band Part (Hardware)
Arduino
I used the same Arduino board as the “Retro Watch,” the Arduino Pro Mini 3.3V (ATmega328). The reason for choosing it is that it can operate at a voltage of 3.7 volts from a lithium polymer battery and its size. If you don’t mind the size of the module and battery and just want to test, you could also use the Arduino Nano board (which is easier to implement and test). The Arduino Pro Mini operates at 8 MHz frequency, while at 5V it is 16 MHz, but 8 MHz is sufficient. Overall, you only need to prepare the Arduino Pro Mini 3.3V board and the USB asynchronous transceiver adapter module.
Bluetooth
Most Bluetooth modules available are HC-06 modules with control interface panels. These panels have a reset button, working status LED, and support 3.3V or 5V working voltage, which is quite convenient, but they are larger. The LED is not necessary and consumes power. So I directly used the HC-06 module, ignoring the interface panel.
Accelerometer
The MPU-6050 accelerometer/gyroscope sensor module is used. If you have other similar accelerometers, you can use them as well. However, this would require changes to the source code.
Battery
I used a lithium polymer battery here. A single-cell lithium battery outputs 3.7 volts, allowing the Arduino Pro Mini to work normally. Of course, there are different sizes and capacities of batteries available on the market. Batteries under 100 mAh are small but cannot guarantee continuous power supply, and if the power is too low, starting the system can be an issue. I recommend using a battery with overcharge and discharge protection, and if it has a removable socket, that’s even better.
For convenience, you can also add a lithium battery charging module with a USB charging port to output power to the Arduino from the pins.
Other Materials
You will need wires, a soldering iron, a switch, and a battery holder. This assembly tutorial will also be helpful to you.
Android Part
The Retro Band’s Android program runs in an Android 4.0 environment. If your Android version is below 4.0 or you’re using an iPhone, well…
Step 3: Assembly
The images show the assembly results of each module except for the battery. Now FTDI powers the entire module, so no battery is required.
Connecting Arduino – Bluetooth Module
If you want to know how to pair and test the Bluetooth module, just search for it! Just follow the tutorial to connect the VCC, GND, TXD, RXD pins. (VCC connects to 3.3V, GND to ground, TX to D2, RX to D3)
Connecting Arduino – Accelerometer (MPU-6050)
The accelerometer module uses an I2C interface. (VCC connects to 3.3V, GND to ground, SDA to A4, SCL to A5)
Connecting Arduino – Battery
Powering is quite simple; just connect the positive terminal to the input (RAW) and the negative terminal to ground (GND). If you want charging functionality, then use a lithium battery charging module. In this case, you should connect the battery’s B+ and B- to the positive and negative outputs of the charging module, respectively, and connect the output’s positive and negative terminals to the RAW and GND of the Arduino board.
Check Connections
After completing all processes, it’s time for the next step. Except for the battery, connect each part, and power is supplied by the FTDI module. Do not connect the battery until the source code is uploaded and tested. Once all tests are complete, disconnect the FTDI module and connect the battery (or add the charging module).
Step 4: Arduino Source Code for the Band
You can download the framework for the band from GitHub.
Upload Arduino Source Code
After compiling the code, you need to upload it to the Arduino board. Before uploading, select the board type “Arduino Pro Mini 3.3V (ATmega328)” and press the reset button on the board before uploading. If the process fails, you will receive the following feedback:
arvdud: stk500_getsync(): not in sync: resp=0×00
The reasons for displaying this message are usually:
1. The board type selected in the Arduino development environment is different from the actual one. 2. TX and RX pins are connected incorrectly. 3. The serial pins used for connecting TX and RX are incorrect. 4. The bootloader on the board has failed. 5. The user is using a USB module that does not support auto-reset functionality.
For the first case, you need to select the correct board type in the Arduino development environment under [tools > board]; for the second case, check if the TX and RX pins are connected correctly; if it still behaves as in the third case, disconnect the D0 and D1 pins; for the fifth case, simply press the reset button. When you press the upload button in the Arduino development environment, watch for the messages; at one point, it will switch from “Compiling” to “Uploading.” If you see the TX/RX LED on the USB module flashing, it indicates that the upload process is normal. A rare case is the fourth one, where you would need to rewrite the faulty bootloader using an UNO board.
Debugging
You need to ensure that each module is connected correctly and functioning. First, run the serial monitor in the Arduino development environment to see if the accelerometer is working properly. (After uploading the program code, the LED on the board should light up, and the program should run for testing.) Since the following source code has error-checking code, when the connection is normal, it should display the values sent back by the Arduino board. If not, it indicates a problem with the accelerometer connection. (After completing all debugging work, you can delete the error-checking code.)
// Print the raw acceleration values
Serial.print(F(“accel x, y, z: “)); Serial.print(accel_t_gyro.value.x_accel, DEC); Serial.print(F(“, “)); Serial.print(accel_t_gyro.value.y_accel, DEC); Serial.print(F(“, “)); Serial.print(accel_t_gyro.value.z_accel, DEC); Serial.print(F(” at “)); Serial.print(iAccelIndex); Serial.println(F(“”);
Now it’s time to check the Bluetooth module. After accurately connecting the VCC and GND pins, the mobile device should be able to scan and find the module. If the HC-06 module does not appear on the device list, check the power pins. After completing this step, it’s time to check the program application part.
Assuming the pairing process is normal, but the application does not receive data, then there is a problem with the TX/RX pin connections. In other words, there is an issue with data transmission from the Arduino to the Bluetooth module.
Step 5: Install and Run the Application
Explaining how to compile and modify the Android source code would take a long time, so I’ll skip it here. However, you can download the entire Retro Band Android source code from GitHub and modify it as you wish, as long as you retain the copyright information. You can find the Android application’s source code in the [RetroBand_Android\RetroBand] folder.
I have placed the application on the Google Play Store, and you can find it by searching for “RetroBand” and then install it. It runs on Android 4.0 and above.
Install the application, run the program, and use the Retro Band to calibrate the mobile device program to see if the application can successfully receive information. The Android application has three list menus.
Timeline: Here, calorie consumption data is collected hourly, and you can check the calorie consumption data for each hour, day, and month.
Charts: Displays the data received from the accelerometer and plots it as a chart, allowing you to see how the three-axis data changes.
Settings: Here, you can configure the program settings and input your weight. Other features will be opened gradually.
If you successfully test the Android application, connect the lithium battery and complete the subsequent work.
Technical specifications of the Retro Band:
Processor: ATmega328-3.3v (8MHz), 32KB flash memory (2KB bootloader shared), 2KB RAM, 1KB EEPROM.
Dedicated Android application for Android 4.0 or above.
Calorie consumption calculation function based on step count.
Aggregated calorie consumption data displayed monthly, daily, and hourly.
Real-time monitoring of changes in the three-axis data of the accelerometer.
Open source.
In the image below, you can see the product prototype – a combination of Arduino, accelerometer, Bluetooth module, charging module, lithium battery, and power switch. I intentionally smeared it with some glue to make it look dirty, but it still works normally.
Step 6: Packaging
If you have a 3D printer, try designing a case yourself. The case seen here was printed using a 3D printer.
Step 7: Postscript
The Retro Band is my second work, a sequel to the “DIY Smart Watch (Retro Watch).” My smart band has simpler functions compared to other activity tracking products, but the Bluetooth module and accelerometer are basic modules needed for other works. Based on my program source code, you can create different modifications.
I hope this tutorial is helpful to you. Thanks to the following individuals who helped me complete this work.
Chang-Han Jeon, Il-Yong Park, Byung-Gyu Kim, KyungReol Ku, Sang-Won Lee, Kyung-Bu Jeong.
Reference personal homepage: HardCopyWorld.com