Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Hexiwear: Teardown of the Hackable ‘Do-Anything’ Device

DZone's Guide to

Hexiwear: Teardown of the Hackable ‘Do-Anything’ Device

Erich Styger orders a Hexiwear, a hackable open source device, tears it down (literally takes it apart physically), then works with Github and the smartphone app.

· IoT Zone
Free Resource

Smartwatches have been around for awhile now. To me, it is still questionable how useful the "big" ones for iOS and Android are. But there are definitely the crowd funded smartwatch projects, which caught my attention. Maybe it is about the ‘do-anything’ with connectivity? One of these gadgets is Hexiwear: A hackable open source device

Hexiwear Device

Hexiwear Device

While it could be a kind of smartwatch, the value of this thing is more because it includes a plethora of sensors with two microcontrollers, and I can use Eclipse with GNU tools to build my firmware.

The company behind the crowd funded project is MikroEletronika (http://www.mikroe.com/). This company is doing development tools and hardware boards and their Hexiwear Kickstarter campaign was aiming for $20,000 and reached $46,150. They showed solid prototypes and the concept of a true hackable small device with lots of sensors was attractive for me, so I pledged the project. Later this year, I saw the hardware and software in action at FTF 2016 in Austin/TX, and finally two weeks ago my package arrived:

Hexiwear Package

Hexiwear Package

I pledged the project for a "Power User Pack" with a "Color Pack," and this was what I have received:

Hexiwear Power User Pack and Color Pack

Hexiwear Power User Pack and Color Pack

The "Color Pack" includes a bracelet and a soft cover:

Hexiwear Color Pack

Hexiwear Color Pack

Hexiwear Device

Hexiwear Device

For a ‘real’ smartwatch the Hexiwear is bit too large, and the color OLED display is not a touch display. What MikroElektronika has put into the device is an impressive number of components:

With all these sensors, the Hexiwear can pretty much sense anything and can communicate with the Internet over a gateway.

On the back, there is a high density connector:

Hexiewar Back Side

Hexiewar Back Side

Below shows how it compares to a 38mm Apple iWatch:

iWatch Size comparison

Hexiwear and iWatch Size Comparison

The Power User Pack has another color pack, plus the docking station with the micro-USB cable:

Hexiwear Docking Station

Hexiwear Docking Station

The docking station provides the OpenSDA debug interface, a SWD debug connection, 3 Click Board sockets and acts as a charging and breakout PCB.

So with this, I have two Hexiwear with bracelets and soft covers plus the docking station:

Color Pack and Power User Pack

Color Pack and Power User Pack

The covers are soft materials that to enclose the Hexiwear:

Soft Cover

Soft Cover

Hexiwear Braclet

Hexiwear bracelet

The soft cover is nice and useful. But the Hexiwear holder of the bracelet is too soft and the Hexiwear can drop out easily.

Hexiwear Tear Down

So let’s see what’s inside. The plastic top cover is easily removed without any tools. It shows the LCD with the six capacitive touch pads.

Hexiwear Cover Removed

Hexiwear Cover Removed

The PCB(s) is easily pulled out of the base enclosure:

Hexiwear out of the case

Hexiwear out of the case

The top PCB with the touch pads is connected with the base PCB by using a connector:

Hexwear with Capacitve Touch PCB

Hexiwear with Capacitive Touch PCB

The display (PSP27801, controller SSD1315) has 96×96 OLED pixels, and seems to cost around $6.5-7.5 (1000 piece minimum order, see this link).

There is no OFF switch, and removing the capacitive pads while powered is not an issue. I pulled out the battery connector first:

Pulled Battery Connector

Pulled Battery Connector

The battery is taped with a double-sided scotch tape to the PCB. I carefully separated the PCB from the battery. It is important not to put too much pressure so as to not break the glass of the LCD or  damage the LCD cable:

Removed Battery

Removed Battery

There are schematics available here.

Hexiwear PCB Bottom

Hexiwear PCB Bottom

To me, it is much easier to press that reset button with the Hexiwear removed than by using that tiny hole on the back.

Hexiwear PCB Top

Hexiwear PCB Top

Docking Station

The docking station is basically a breakout board for the Hexiwear, plus it includes a OpenSDA debug interface. It features several push buttons, LEDs, a micro-SD card socket plus three slots for MicroElectronica Click Modules:

Hexiwear Docking Station

Hexiwear Docking Station

I have not used the OpenSDA circuit yet, as a standard SWD debug connector is provided too, so I use my standard debugging tools like Segger J-Link or P&E Multilink. Switches on the board allow me to select which device to debug: Either the K64F or the KW40 microcontroller.

The used micro-connector between the docking station and the Hexiwear probably will not last long (not sure about the number of cycles, but probably not too many). I have put a small cardboard piece between the Hexiwear and the docking station to have more aligned connection. Otherwise, pressing any of the touch buttons might disconnect the two boards:

Cardboard on Docking Station PCB

Cardboard on Docking Station PCB

I faced several debugging issues, and it seems they were all related to bad connections between the docking station and the Hexiwear. So make sure that the connection is working properly.

OpenDAP

The backside of the docking station board includes a debug circuit based on the NXP Kinetis K20, similar to the OpenSDA:

DAPLink Circuit

DAPLink Circuit

The debug interface enumerates as DAPLink:

# DAPLink Firmware - see https://mbed.com/daplink
Unique ID: 0214000024404e45003d3017ffff0021ffffffff97969900
HIC ID: 97969900
Auto Reset: 0
Automation allowed: 0
Daplink Mode: Interface
Interface Version: 0241
Bootloader Version: 0241
Git SHA: d5a63b6e15d61714f164b823f7367f97620f3dad
Local Mods: 1
USB Interfaces: MSD, CDC, HID
Bootloader CRC: 0xe21e1718
Interface CRC: 0x886a40bf

Interestingly, pressing the RESET button while powering the circuit, it points to a web page dedicated to the KL26Z on the micro:bit. I have not used the debug circuit as I was happy to use the P&E Multilink and Segger J-Link. The Hexiwear documentation suggests to use OpenOCD or pyOCD (recommended).

Smartphone Apps

Both an Android and a iOS smart phone application is available to connect through BLE (Bluetooth Low Energy) to the Hexiwear. The app is used to set the RTC of the Hexiwear and to read out multiple sensor values:

Sensor Data Reading

Sensor Data Reading

Configuration

Configuration

The app has the feature to send the data periodically to the wolksense cloud:

wolksense

wolksense cloud web page

Using wolksense requires an account. The Hexiwear uses the smart phone as a gateway to publish the data to the cloud.

GitHub Project

The real advantage of the Hexiwear is that the firmware is open source and hackable. The Hexiwear firmware is available on a GitHub site: https://github.com/MikroElektronika/HEXIWEAR

Hexiwear on GitHub

Hexiwear on GitHub

The Kinetis Design Studio V3.x project used at FTF is located here: https://github.com/MikroElektronika/HEXIWEAR/tree/master/SW/FTF/HEXIWEAR_OLED_sensors_RTOS and is an easy start into changing the firmware. There is a PPT with the instructions used at FTF here: https://github.com/MikroElektronika/HEXIWEAR/tree/master/documentation/FTF

Debugging worked fine for me both with Segger J-Link and P&E Multilink over the docking station SWD debug port:

Debugging Hexiwear Firmware

Debugging Hexiwear Firmware

I still need to make my way through the sources. The project is using the older Kinetis SDK v1.3 and not the latest v2.0. What is really cool is that it is using FreeRTOS as operating system.

BLE for the KW40?

What makes this project really interesting is that it includes the NXP KW40 BLE enabled microcontroller. The GitHub repository only has binaries, object files, and files to patch the NXP Connectivity Software. There are project files for IAR, but not for GNU and Eclipse. I have downloaded the Connectivity stack from the KW40 web page, but this only has IAR support and the BLE stack is provided with libraries only. It looks like I would have to use a commercial IDE to use the BLE stack and there is no full source code for it available.

Summary

Hexiwear is a cool gadget. While all the other parts of Hexiwear (schematics, hardware, software on the K64) is open source, the BLE stack on the KW40 is not open:

“Complete software solution with open source embedded software, cell phone apps and cloud connectivity.”  (Hexiwear overview, page 2)

I think the important word in the above statement is ‘with’: It comes with (most) open source embedded software. It would have been great to have the BLE stack open too.

Other than that, the Hexiwear is very versatile and useful: A battery operated device with lots of sensors, wireless connectivity, open source tools, software support for the K64F microcontroller, a lot of functionality, and cool demos and applications at a very reasonable price (Mouser is selling it for around $50). And it comes with a lot of software and tools. The tutorials and documentation is well-written. With this, the Hexiwear is really a ‘Do-Anything’ device. And a great platform for NXP Kinetis and all the sensors on the Hexiwear. As for myself, I’m exploring ways how I can use it next semester in my university course.

Happy Hexiwearing!

Topics:
iot

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}