Last time I was up in Rhode Island my good friend Brian Jepson pushed a small red box into my hands with the words, “…try this, you’ll love it.” I immediately started looking for the blue pill. However I needn’t have worried, because it turned out to be a SensorTag from Texas Instruments.
The SensorTag is an interesting product, and you get the sense that this is very much a product made by TI to demonstrate their new Bluetooth Low Energy system-on-chip the TI CC2541. It’s marketed directly to smart phone app developers rather than at hardware developers. Either for them to develop an app to directly support the SensorTag, or as a reference hardware design to develop more sophisticated Bluetooth Low Energy accessories.
The CC2541 chip comes in a QFN-40 package and not only implements Bluetooth Low Energy, but has a internal MCS 8051 micro-controller, general purpose timers, accurate RSSI support to allow range determination, two USARTs, 23 general purpose digital IO pins, 12-bit ADC with eight channels, I²C and the kitchen sink. This is a nice chip that means you should be able to develop a compact board layout with few external components, except the sensors or actuators you’re actually interested in controlling.
Stripping off the somewhat oddly shaped and garish red cover, the SensorTag board is a lot more compact than its casing suggests. It’s also a lot more powerful. It has six onboard sensors, all of which are connected to the CC2541’s I²C interface bus with separate enable signals.
To minimize current consumption, all the onboard sensors are by default disabled and they are kept in sleep mode between measurements and each sensor can be enabled and read individually. Which is why the entire board runs off a single CR2032 coin cell.
The front of the board exposes five of the six onboard sensors; the TMP006 temperature sensor allows us to measure the temperature of on object without any contact by using a thermopile to absorb IR energy emitted from it. Just point the SensorTag at the object and it’ll tell you the temperature, which explains the strange hole in the front of the case. It’s needed to expose the TMP006.
Also on the front of the board are the C953H barometric pressure sensor, along with the KXTJ9 accelerometer, MAG3110 magnetometer and the IMU-3000 MEMS gyroscope. Finally, toward the left hand side of the board (in the picture below) are two small contact switches whose status is also available via Bluetooth to a remote connected device.
The rear of the board is where the CC2541 chip itself is mounted, which gains us a couple of extra sensors for free, as amongst the kitchen sink collection available is an onboard temperature sensor which will report the ambient, as opposed to the “at a distance” temperature, and a battery monitoring sensor. The rear of the board also houses the SHT21 digital humidity sensor and the side button (top of frame) is used to put the board into discovery mode.
The SensorTag is a Bluetooth Low Energy device, which means that it can talk to any platform that supports Bluetooth Low Energy. Right now that means recent iPhone and iPad models, natively from newer Macbook Pros and from any Windows or Linux PC with an appropriate Bluetooth 4 dongle.
Unfortunately while Bluetooth Low Energy is supported on some Android devices, it’s not yet in the core SDK and there isn’t a standard way to talk to Bluetooth Low Energy hardware. In fact some “SMART Ready” devices, such as the Samsung Galaxy S3, will need a firmware upgrade to fully support the standard. However with Google I/O coming up next month, that situation might well change fairly quickly.
The easiest way to get started with the SensorTag is probably to download TI’s SensorTag application from the iOS App Store. It’s free to download, and is a Universal application for both iPhone and iPad.
Open up the app, put the SensorTag into discoverable mode by pushing the side button and you should see the tag pop up on the list of available devices almost instantly. Interestingly, other devices based on the CC2541 chip might also probably appear on the list.
That said, if you don’t own an iPhone or an iPad the SensorTag is still pretty easy to work with, and TI has some fairly extensive documentation on how to talk to the SensorTag, including a full list of the GATT services the device offers enabling the state of all of its sensors to be read. Even if you’re not working on iOS where TI has helpfully provided code examples, it shouldn’t be too hard to develop an application to talk to the tag.
The iOS SDK
If you’re not that keen on developing native applications for iOS to support the SensorTag, there is also Bluetooth Low Energy support in techBASIC. The techBASIC environment is a full implementation of the BASIC programming language which allows you to develop and run apps on the iPad (and the iPhone) that look just like native applications. However, it also supports taking external data, both using the HiJack board and via Bluetooth Low Energy if your hardware supports it, and it lets you do some impressive things like collecting and analysing data from a model rocket flight.
There is a lot of information on controlling the SensorTag with techBASIC and if you’re not keen on developing native iOS applications this is a solid alternative.
Mike Westerfield, the maker behind that rocket flight, is currently writing a book called “Building iPhone and iPad Electronic Projects.” Right now it’s available in early release, but it should go to press later this month.
About half the book discusses Bluetooth Low Energy, and two entire chapters are dedicated to the TI SensorTag. The first walking you through talking to it from techBASIC, the second walking you through building your own Bluetooth enabled model rocket.
I’m acting as a tech reviewer on this book and it’s a really interesting read, and not just for the Bluetooth Low Energy section, as it’s the first time I’ve seen the HiJack board talked about in any detail.
Other Development Kits
While the SensorTag is perhaps the most interesting development kit for the CC2541, TI also offers other developer kits including the DK-MINI which includes a reference design for a Bluetooth Low Energy “key fob” board.
Interestingly, if you have a Hone key fob, you’ll see that it shows up in the TI SensorTag app. It’s based around a CC2541 chip and is sufficiently similar to the reference design in the DK-MINI developer kit that you can trigger the alarm on the fob from the TI SensorTag app.
You’ve probably guessed by now that I’m a fan of the TI SensorTag. It’s an interesting bit of hardware aimed squarely at simplifying smart phone developers lives when prototyping Bluetooth accessories. But it’s generally more useful than that and as Mike’s model rocket flights showed it can add a lot of data collection capability to your maker project quickly and cheaply.