Virtually any fitness tracker has MEMS accelerometer and Bluetooth BLE. The idea was to rewrite the firmware in such a device to turn it into something equally useful. For example, in the security and monitoring system or sensor for Internet-of-Things.
In many control systems, traditional sensors such as switches, volume sensors, or motion sensors may well be replaced with a vibration sensor. In addition, the accelerometer determines the angles of inclination, which can also be useful.
The basis was taken as Misfit Link or Misfit Flash. This is the same device and differs only in the presence of a strap (strap and clip (Flash) versus just clip (Link)). Inside it is the popular NRF51822AA (MCU + BLE) from Nordic Semiconductors and the equally well-known MEMS accelerometer LIS2DH (STMicroelectronics). Battery - CR2032. ')
Knowing the pinout of the NRF51822, it was not at all difficult to detect the 2-pin SWD interface, erase the old (and protected) one and fill in your own. To do this, you need to solder only 2 wires and have a programmer with SWD support (for example, J-Link). In our new firmware there is the possibility of updates via BLE (over-the-air dfu). So you can continue to create a new even without soldering wires.
Well, then - the only question is what kind of functionality you want to have. I wanted to have almost everything possible. Therefore, the firmware was developed - Android application with the following functionality:
1. View the current orientation of the device as a graphic or 3D model. 2. Set the trigger defined by the threshold, axes and logic. When a trigger is triggered, the device sends a signal to the smartphone. The smartphone beeps and, if desired, takes a photo. And it can do this in the background and the screen off. 3. Mode 2 in the case of rare events can be used offline, when the only source of information for a smartphone are advertising packets (1 sec interval), which encode information about the angles, battery charge, number of records. This saves the device battery and makes it very quick to view the current position. Just turned on the phone and on the 3d model I saw on which side the cat was sleeping, or in what position the package was in the warehouse. 4. The NRF51822 has 256kB flash memory. After all the components of the code are placed (SoftDevice (RTOS, part of the SDK), our program and bootloader) there is no less than 100kB of free battery-independent memory. There we write the trigger trigger if the recording mode is on. Each entry includes the time (RTC with quartz 32768 on board), the maximum total acceleration and the static orientation of the device. Then it can be considered, analyzed or even viewed as a film.
I will not go into technical details here, they can be viewed on my website www.msh-tools.com/misfit . (in English). In the same place the code of firmware and bootloader (Keil), and Android Apk (ionic framework) is published. For those who just want it to have it all available already in compiled form.
Video. **Turn on the sound!**
The device is very sensitive. It can be configured to work by simply tapping an item to which it is attached.
For example. 1) You need to secretly capture something. The phone is closed and turned off. Tap gently on the device or just raise your hand and the picture is ready. 2) Someone periodically climbs up to your desk or just walks at odd hours in the room. Take a picture, and in addition in the next room (up to 10m) the alarm will ring. 3) I put it on the electric charger. When charging ends, the fan stops working in the charger. This event generates a signal on the phone. 4) Look at how your package went, what the accelerations were, how it was turned over. 5) Attach to the pipe (air conditioner, etc.) and learn the statistics of work. 6) About the cat you will learn everything that he does when he sleeps. 7) In the video there is an example of how I sleep, how I toss and turn, also interesting. You can attach to the bed, see how and when (by whom) it was used. Okay, stop, you can continue for a long time.