loading

RetroBand is the second result of Arduino Wearable Project that is supported by open source. I think this shouldn’t be called a ‘smart band’ since it has only simple features. Actually, it’s rather to be called an “Activity Tracker”… But the term ‘smart band’ is more familiar to me, so I just call it a smart band. The important thing of smart bands is they are connected with mobile devices by Bluetooth and track the daily routine of users.

RetroBand that is implemented by Arduino has only one feature, which is collecting data by using accelerometer and sending them to a mobile device. Then the mobile device calculates the calories and steps by using the data. The feature is simple, and that means the structure of this device is way simpler than RetroWatch, so it’s very easy to make it in your own taste.

The android app check steps using collected data provided from RetroBand Arduino. The algorithm of the app is not that complicated. If you have much experience to this area, you can replace it with your own algorithm. The app saves the calorie data, so you can see the progress it in a monthly/daily/hourly graph form. FYI, RetroBand Arduino cannot save the data itself since the shortage of its memory capacity. That is, it only works when it’s connected with a mobile device, which means you cannot collect the data with RetroBand Arduino only. I think this problem will be fixed when Arduino gets improved.

Step 1: Mechanism

RetroBand consists of an Arduino part and an Android app.

The Arduino has 4 main parts – Arduino board, accelerometer(MPU-6050), Bluetooth module(HC-06), lithum-polymer battery(charge board is optional).

The Android app contains of 4 parts – Android UI, Bluetooth manager, Algorithm section, background service.

If Arduino powers on and the pairing process with RetroBand app is done, the board check the accelerometer data 20 times in every 1 second. And it transfer the data to the mobile device once a second. The accelerometer measures x axis / y axis / z axis values, so the band sends 60 values(20 times x 3 axis) of data to the device. The Android app receives the data during two seconds and finds out an interval that user’s movement increase dramatically. The number of user’s movement increase is user’s a step count. The app calculate burned calories based on user’s weight and steps, and accumulates data monthly, daily and hourly.

Step 2: Preparation

If you want to buy parts which I used, refer to below links.

Arduino Pro mini 3.3v - http://www.ebay.com/itm/2PCS-New-Pro-Mini-Atmega32...

Accel+Gyro sensor (MPU-6050) - http://www.ebay.com/itm/MPU-6050-6DOF-3-Axis-Gyros...
Bluetooth (HC-06) - http://www.ebay.com/sch/i.html?_from=R40&_trksid=p...

USB to UART converter (FTDI) - http://www.ebay.com/itm/USB-to-UART-5-Pin-CP2102-M...

For Band(Hardware)

Arduino

I used the same Arduino board as RetroWatch, which is Arduino Pro Mini 3.3v(ATmega328). I chose this board because it works well with 3.7v lithium-polymer battery and its size, but if you don’t mind the size of the module and the battery or you just make the band as a test, you can use Arduino Nano board(it’s easy to implement and test). Arduino Pro Mini runs at 8MHz and a 5v version at 16MHz, but 8MHz is enough. Overall, all you need to prepare are Arduino Pro Mini 3.3v and USB to UART(FTDI) module.

Bluetooth

Most common bluetooth modules that you can get are HC-06 main module and the one with interface base board. The latter one has a reset button, the status LED, and it supports both operation voltage(3,3v/5v), so this one is more convenient but the size is rather big, the LED, which is not quite necessary drains the battery. So I used a HC-06 without the interface board. http://www.aliexpress.com/wholesale?SearchText=hc...

Accelerometer

I used the MPU-6050(6 DOF) accel + gyro sensor module. If you have other accel sensor you can replace it with yours. In this case, some of source code must be modified. http://www.aliexpress.com/wholesale?SearchText=mp...

Battery

I use LiPo(Lithum-Polymer) battery in this project. 1-cell LiPo battery flows out current in 3.7v, which works perfectly with Arduino Pro mini, and there are many kind of batteries in terms of the size and the capacity. The choice is yours. Under 100mAh one is small, but it doesn’t guarantee stable power, and if it’s too low, you can’t even boot the system. I recommend the battery with protection circuit(overcharging, over-discharging safe), and it’s better if it has a removable socket.

For the convenience you can add LiPo charger module in below link. It supports charging with USB and power out pins for Arduino. http://www.aliexpress.com/snapshot/6085015595.htm...

Etc.

You need wires, soldering iron, power on/off switch and a batter jack. It would be helpful for you to prepare the assembly manual.

For Android

The Android app for RetroBand is compatible with over Android 4.0 If you are using under Android 4.0 version or an iPhone…sorry.

Step 3: Assembly

This is a picture that shows every module is assembled except the battery. FTDI will provide the power to the module for now, so the battery is unnecessary.

Connecting Arduino-Bluetooth module

If you want to know how to manage Bluetooth module and test, googling it! You just connect VCC, GND, TXD, RXD pin as the module in the instruction (VCC->3.3v, GND->GND, TX->D2, RX->D3).

Connecting Arduino-Accelerometer(MPU-6050)

An accelerometer module uses I2C interface. (VCC->3.3v, GND->GND, SDA->A4, SCL->A5)

Connecting Arduino – battery

It’s very simple to supply the power. Just connect (+) -> RAW with (-) -> GND. But if you care about recharging, you can use a Li-Po recharging module. In this case, you should connect (+) and (-) connectors on the battery with B+,B- on the recharging module, and out+, out- on the module should be connected with RAW, GND on the Arduino board respectively.

Checking Connection

If you’ve got through all these process, it should be as below. You should connect each part except the battery. The power is supplied from FTDI module, so you shouldn’t connect the battery until source code upload and test are done. Every test finishes, disconnect FTDI module and connect the battery(or with Li-Po recharging module).

Step 4: Arduino source code for band

You can download Sketch(Arduino source code for band) on Github. Go to the link below.

https://github.com/godstale/retroband

Uploading Arduino source

You need to upload Arduino source on Arduino board after the compile is done. Before you upload it, select board type ‘Arduino Pro mini 3.3v(ATmega328)’. And you should press reset button manually when you upload the source on Arduino Pro mini. If the process has failed, you can see this message :

arvdud: stk500_getsync():not in sync: resp=0×00

The reasons why this message appears are usually these:

1. The board type that you choose on Arduino IDE and the actual board is different.

2. The connection between TX, RX pins is wrong

3. Serial pins which are allocated as TX,RX are not used as they should be.

4. Bootloader on the board is malfunctioning

5. User doesn’t reset properly if they use a USB module that doesn’t support the auto reset feature.

Case 1, you should select a proper board type in [tools > board] on Arduino IDE, and case 2, you should check whether TX, RX pins are connected properly. If the connection is the same as case 3, disconnect D0 and D1 pin connection. In case of 5, you should press the reset button. If you press the upload button on Arduino IDE, check the message appeared below the IDE. There’s a moment that it changes ‘Compiling’ to ‘Uploading’. You should press the button at that moment. If you see TX/RX LED on the USB module flickering, then the upload process is in progress. Rarely, you can face the case 4. In that case, you should use an UNO board that is possible to upload the source to burn a bootloader on the malfunctioned board. The solution is way too long to describe and it’s out of our purpose, check the link below if you want to fix the problem.

https://forum.sparkfun.com/viewtopic.php?f=32&t=2... http://arduino.cc/en/Tutorial/ArduinoISP/

Debugging

You need to verify every module connects each other and works okay. First, you should run [Serial Monitor] on Arduino IDE to check if the accelerometer works fine(run the program when LED on the board is on after uploading Arduino sorce). Since the source code has a debug code as below, it should print out the values that are transferred from Arduino board if the connection is okay. If it doesn’t, there’s a problem in the connection with the accelerometer(you can delete the debug code once you finish to check).

// Print the raw acceleration values<br>  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, you should check the Bluetooth. It would be found perfectly if VCC, GCN pins are connected properly when the mobile device starts scanning. If you don’t see HC-06 module on the found device list, check the power pin connection.
If you’ve done up to this part, it’s time to check the app.

# : If there’s nothing wrong with pairing process but the app doesn’t receive the data properly, there might be a problem in the connection of TX / RX pins. That is, the data don’t transfer from Arduino to Bluetooth module well.

Step 5: Installing and Running the app

It’s very huge to explain how to compile Android source code and modify it, so I won’t cover it. But you can easily download the whole source code of the RetroBand Android source code on GitHub, and you may modify and distribute it. Just make sure that you preserve the copyright statement. You can find the source code of the app in [RetroBand_Android\RetroBand] folder

I distributed my app on PlayStore, so you can install it there(search ‘RetroBand’). Over Android v.4.0 : https://play.google.com/store/apps/details?id=com...

If you install the app, run it and pair the mobile device with RetroBand to see the app successfully receives the data. The app has 3 tab menus.

Timeline : It gathers cumulative burned calorie data every hour. You can check how many calories you have burned hourly / daily / monthly.

Graph : It shows the graph that is drawn by the data sent from the accelerometer. You can see how 3-axis values alter.

Settings : You can configure the app setting here, and input your weight here. Some features will be updated soon.

If you successfully test the app, connect Li-Po battery and finish the work.

The specification of RetroBand:

  • Processor : ATmega328-3.3v(8MHz)
  • 32KB Flash(2KB is shared for Bootloader), 2KB RAM, 1KB EEPROM
  • Connected with Android exclusive app(supported over v.4.0).
  • Calculating calories based on step count.
  • Accumulating calorie data and displaying statistics in a monthly/daily/hourly data
  • Real-time check of the change of the 3-axis values measured by accelerometer
  • Open source

You can see the prototype in the picture below. It’s the combination of Arduino + accelerometer + Bluetooth module + recharging module + Li-Po battery + power switch. I plastered glue on it so it looks messy, but it worked pretty well.

Step 6: Packaging

If you have a 3D printer, try to make your own case. What you are seeing in the picture is the case that is made by a 3D printer.

Step 7: Epilog

RetroBand is my second project succeeded to ‘Making your own smart watch(RetroWatch)’. My smart band is too simple to compare other activity tracking products, but a Bluetooth module and an accelerometer are the basic modules that can be used in any other projects. You can make variables by using the source that I used.

I hope this would be helpful to you and thanks to people who helped me for this project.

Arduino, Android source(GitHub) : https://github.com/godstale/retroband

RetroBand Android App(Google Play) : https://play.google.com/store/apps/details?id=com...

Original DIY documents : https://play.google.com/store/apps/details?id=com... (in English)

Homepage :HardCopyWorld.com

Special thanks to : Chang-Han Jeon(Translated docs in English), Wired Factory team(Il-Yong Park, Byung-Gyu Kim, KyungReol Ku, Sang-Won Lee, Kyung-Bu Jeong)

<p>I made it , but not working </p><p>I am getting same values in Serial Monitor , No changes when moving accelerometer.</p><p>I am using ADXL 345 Accelerometer , and connection like this</p><p>(VCC-&gt;3.3v, GND-&gt;GND, SDA-&gt;A4, SCL-&gt;A5)</p><p>Any suggestions? </p><p>---------- Send 20 accel data to remote <br>accel x,y,z: 25856, 259, 2, at 110 <br>Read accel, temp and gyro, error = 2 <br>accel x,y,z: 101, 769, 512, at 116 <br>------------- Send 20 accel data to remote <br>Read accel, temp and gyro, error = 2 <br>accel x,y,z: 25856, 259, 2, at 2 <br>Read accel, temp and gyro, error = 2 <br>accel x,y,z: 101, 769, 512, at 8 <br>Read accel, temp and gyro, error = 2 <br>accel x,y,z: 25856, 259, 2, at 14 <br>Read accel, temp and gyro, error = 2 <br></p><br><p><br>------------- Send 20 accel data to remote </p>
<p>it's a great project!! but something is wrong.<br>such graphics get in a static position. when moving nothing changes.<br>MPU 6050 may be faulty. can you help me with this?</p>
<p>Hi i tried your code but the bluetooth doesnt seem to work :( helpppp. it says not responding. is there anyone with the same problem?</p>
Thank you very much Godstale for the instructables, I was wondering of a way to tweak the device and the app so that it can make the phone alert whenever something else happens let's say like you don't have ur phone with you ,
<p>Hi @GodsTale,</p><p>Nice instructable. Thanks. Very useful. I have a concern. What if I have to store some data in tracker itself temporarily (May be for a day if user don't want to keep smartphone connected). So, that he can sync up tracker with his phone once in a day. How can we achieve this? Any extra hardware component or will it be just a extra code piece? Thanks.</p><p>/perrygarg</p>
<p>You need SD card module because there is only 3KB(2KB RAM + 1KB EEPROM) memory in Arduino. And you have to change all of Arduino code and much of Android code. It's totally different job.</p>
<p>Thanks GodsTale, Yes, EEPROM is all storage Arduino has. (As RAM can't store data even if power switches off). Do professional health bands use SD card module or just another EEPROM chip? For example say Mi band uses which stuff for storage of data bits temporarily? </p>
<p>Based on your Retro-Watch project I wish to integrate it with this project, where shall i connect the MPU-6050 module, its place has been taken by the oled display on the Retro-Watch.</p>
<p>Hi GodsTale, </p><p>Thanks for your efford. I made one it works fine but in order to put it in a shape I need the case. I have my own 3d printer that is not a problem. Would you mind if you send me the drawing files?</p><p>Best wishes.</p>
<p>Unfortunately I dont have 3D modeling files for this. Case in picture above is not mine. :(</p>
<p>Okey, thanks.</p>
<p>Interesting!!</p><p>If you are looking for a nice activity tracker for wholesale business,you can check this website and contact me:www.taiwan-smart-watch-factory.com</p>
<p>Just ordered the Bean. It has the same Arduino chip, and its own accelerometer and BT built it. Will need to add a flash chip though. Will see what happens.</p>
<p>Great stuff GodsTale,</p><p>Would your code work on the LightBlue Bean platform? </p><p>https://punchthrough.com/bean/ I am working on a simple inactivity tracker, where instead of steps and calories, the tracker tracks period of long sitting, or inactivity. </p>
<p>I have no idea about LightBlue. Maybe this project doesn't work with LightBlue.</p>
<p>hi GodsTale,</p><p>great job !..!!!!</p><p>i was jus tryin this DIY fr fun ...i used an UNO instead of the PROMINI....so after i gt this set up ...and paired to app ...i twisted and turned my accelero on my bread board ...bt noticed that im nt getting any real time data ....even the graphs seemed like to take forever to respond to the changes in YPR ....so is this app real time and im making a mistake in my motion of accelero ...................or does this gives steps and calories after a given period of time ? </p><p>eager fr ur reply !</p><p>thankss !!</p>
<p>Firstly check the accelerometer value using serial monitor. And check bt module with below app.</p><p><a href="https://play.google.com/store/apps/details?id=com.hardcopy.btchat" rel="nofollow">https://play.google.com/store/apps/details?id=com....</a></p><p>This app shows bt data sent from remote. Pair with your bt and check accel value is fine.</p>
<p>Instead of the Arduino board pairing with an android app is it possible to pair it with another Arduino? </p>
<p>Yes, but you should use bluetooth master module and bluetooth slave module. And pair each other before sending data.</p>
<p>Hi, looks very good. I also use activity detection for animal trackers.</p><p>1. MCU + Accelerometer + BT to initial reseach</p><p>2. MCU + Acc + GPS + GSM + RF for real application</p><p>3. nRF51822 + Acc for newest research</p><p>You can use ODBA for initial analyzist but better use more complex algo. And activate BT (or BLE) only if need. It increase battery time dramatically.</p><p>Good luck for your project</p>
<p>Hey there, would you be willing to chat about your project work and activity detection for animal tracking? I'd like to work with you on something.</p>
Hi,<br>you can contact via skype (see on top-left corner) http://akb77.com/g<br><br>Mitek
<p>Jeremy, love the project and documentation. Did your project have any on-chip memory to store the data when away from the Bluetooth connection? How much more difficult to store the data on the chip and sync with a Bluetooth device? I'm not an electrical engineer, more of a business guy. Trying to understand all the components and component cost options. I want to make one for a specific activity tracking market. Thanks!</p>
<p>so I just check your code. The arduino does not do anything smart. It fills a buffer then send that to the phone. Then the algorithm in the phone process that data. You have <a href="https://github.com/godstale/retroband/blob/master/Android/RetroBand/src/com/hardcopy/retroband/logic/Analyzer.java" rel="nofollow">Analyzer.java</a> and <a href="https://github.com/godstale/retroband/blob/master/Android/RetroBand/src/com/hardcopy/retroband/logic/PeakDetector.java" rel="nofollow">PeakDetector.java</a> that do the hard work. Analyzer.java get the data from PeakDetector.java and then send the step count to mShakeActionCount that is use by the rest of the app. (ar.mShakeActionCount=nStepCount;)</p><p>I like it! thanks for sharing!</p>
<p>Yes, you're right. It's not smart :) I'm looking for ideas to make it more &quot;smart&quot;</p>
<p>Have you ever considered using WEKA with C4.5 DT (J48) instead of counting steps?</p>
<p>you do that those statistical classification algorithm on the arduino and let us know! HAHA! :)</p>
<p>I wasn't think about doing on the arduino, just sending the files to smart phone as ARFF and then java would handle the rest of them :)</p>
<p>Great Ible! Just wondering what battery life you get out of it :?</p>
<p>thank you for this project, I am going to give it a try :)</p>
<p>When I get time, and my 3d printer working, I will try this out! However, I would probably make it just as a stand alone so you can run then upload the data at the end through bluetooth to the phone. Also why not integrate the accel data to distance instead of doing a step count? </p>
<p>Because I'm a rookie in signal processing, I did it in easy way using open source.</p><p>https://github.com/godstale/retroband/blob/master/Android/RetroBand/src/com/hardcopy/retroband/logic/PeakDetector.java</p>
<p>Interesting.</p>

About This Instructable

55,437views

128favorites

Bio: This, Too, Shall Pass Away
More by GodsTale:Arduino Network Game Social Bug: bluetooth dancing robot Make wireless charging mouse 
Add instructable to: