I had the chance to play around with the tinyTILE prior to its launch at Embedded World last week and found it to be quite an exciting little tool!
This incredibly tiny board measures only approx. 26 x 35mm and has components mounted on one side only, so it can easily lay flat to maximize its implementation. It also has wireless capabilities (Bluetooth LE to be specific) so you can easily create wearable designs with parameters that can be adjusted using inputs from mobile devices, even tweets!? Great idea when you’re all dressed up and want to make last minute changes to your look.
So what do you do with such a small innovating board? My ideas were endless, but based on time constraints I wanted to focus my attention on getting started with the tinyTILE and creating a very simple demo that would utilise its on-board 6-axis combo sensor with accelerometer and gyroscope. My initial idea was to create a simple lanyard device that had LEDs to illustrate step count, a basic pedometer really. Working with Intel they were able to provide the Curie Module libraries, as well as some code for a similar demo that had been developed using the Arduino 101 board. Because of this I decided to use Arduino IDE, but the tinyTILE can also easily be programmed using the Intel Curie Open Developer Kit (ODK) and Anaren Atmosphere. In tweaking the code slightly and utilising the Curie Module libraries, I was able to get the lanyard demo up and running in no time at all.
I was able to easily implement a step counting mode as well as two other modes, including a motion sensing mode and a sound detection mode each with their own LED displays. For the sound detection mode I did have to add in microphone hardware.
Mode 1 - Step Count
This mode is enabled as default and will display an array of Neopixels in green, descending down the left side of the lanyard and then up the right side, illustrating the wearer’s progress towards the step count target. As you walk the lanyard reflects the number of steps taken by lighting up additional Neopixels in green. Once the step count target has been reached, the lanyard displays a celebration of random colours acknowledging your success.
Mode 2 - Sound Detection
This mode displays an array of Neopixels on the lanyard with random colouring, illuminating down the left side and then up the right side and back with a single Neopixel chaser effect according to the ambient noise level.
Mode 3 - Motion Detection
This Mode will display an array of blue coloured Neopixels according to your current movement. Smaller movements will be illustrated with less Neopixels lit along the left side, where as large movements will light the Neopixels all the way from the left side to the right side of the lanyard.
To change between modes, tap the tinyTILE rapidly twice on its side. You will know what mode you're in depending on the colour the first LED initially flashes when entering the mode. For Step Count Mode this will be green, for Sound Detection - red, and for Motion Detection - blue.
The only challenge I ran into occurred when I first tried to implement Bluetooth LE. I hadn't required this for my demo initially, but thought it could be fun to connect to a mobile device and control the modes from remotely. I found support in the Curie Module libraries provided to me by Intel and eventually got it working, although, for this demo I decided not to spend time developing a mobile app as was more focussed on utilising the accelerometer and gyroscope sensors and getting some flashing LED action. I do recommend having a play with it though, as linking your tinyTILE to a mobile app is a very exciting feature, especially for wearable projects!
The LED strip I decided to use for the lanyard demo was Adafruit’s Neopixel Digital RGB LED Strip. Each of the LEDs is digitally-addressable, so you can set individual red, green and blue colour levels for each one separately using 8-bit PWM precision. The LEDs use single-wire control and the protocol is very timing-specific. Fortunately, Adafruit provide the NeoPixel library for Arduino and have example code for Arduino Uno which was easily adaptable for the tinyTILE.
The only thing about using these LEDs was that they require 5V and as I had a 3.7V battery I needed to add a voltage booster to my design.
To get the LEDs to light up in relation to the step count for my lanyard demo I implemented the following pseudo code:
Step Counting StepCountLoop { If Target Steps Number < Number of LED Return; If Step Count >= Target Step Number //target reached { Congratulatory LED Celebration; Start counting from the beginning again; } Else { Calculate Steps per LED = Target Steps Number / Number of LED; Calculate Maximum Length = Step Count / Steps per LED; LOOP { While Counter (start at 0) < Maximum Length and Counter < Number of LEDs, add one to Counter; Set LED colour to Green with medium brightness; } Send updated strip colour to hardware; } Delay a short time; }
Once the targeted number of steps is reached a congratulatory celebration of coloured LEDs is displayed.
Congratulatory LED Celebration Void Loop { For Counter A (starting at 0) < 256, Add 4 to Counter A //cycle every 4th 256 colours in the wheel { For Counter B (starting at 0) < 3, Increase Counter A by 1 { For Counter C (starting at 0) < 0 , Add 3 to Counter C { Turn every third LED on } Strip.show(); Delay (wait); For Counter (starting at 0) < Number of LEDs add 3 to Counter { Turn every third LED off } } } }
That’s it! A simple demo completed in no time. I'm so excited for this product, and am looking forward to hearing about other tinyTILE projects and it's implementation into the wearables and IoT industries. The ideas are endless!
Top Comments