Showing posts with label Sensors. Show all posts
Showing posts with label Sensors. Show all posts

Saturday, February 23, 2013

Distributed Network Data

My latest book, my first not talking about iOS and writing code for the iPhone and iPad, just went to press. It's called Distributed Network Data and it's hardware hacking for Data Scientists. It's the book of the +Data Sensing Lab and arrives just in time for this year's +O'Reilly Strata in Santa Clara, which starts tomorrow.


This book is intended for data scientists who want to learn how to work with external hardware. It assumes some basic computing and programming knowledge, but no real expert knowledge is assumed. From there the book walks you through build your own distributed sensor network to collect, analyse, and visualise real-time data about our environment.

If you're a data scientist, or a visualisation person, interested in getting started with hardware and collecting your own data, this is the book for you. You can use the code AUTHD to get 40% off print books, 50% on ebooks and videos when you buy the book directly from O'Reilly.

Sunday, November 11, 2012

Teardown of Wireless Sensor Tags

The Wireless Sensor Tag is a smart tag system by CAO Gadgets.

The Wireless Sensor Tag
(Credit: CAO Gadgets)
The system is based around an Ethernet Tag Manager, a small box that connects directly to your home router and manages the all the associated tags. Basically it acts as a bridge between the wireless tags themselves and the Cloud backend which manages the tags.


The Tag Manager
(Credit: CAO Gadgets)
Each tag has motion and temperature sensors and can be configured to notify you via tweet, email, push notification, or via a URL callback (either to an Internet facing host or directly to an internal IP on your home network) when the tag is moved, or when the temperature goes out of a user defined range, or if the tag itself is moved out of range of the tag manager. Each tag also has a piezo electric buzzer and an LED which can be triggered using the same ruleset.

Ordering

I actually ordered my system back in August, only to be told that the sensor tags had not been CE certified, and they weren't quite prepared to do that just yet. I could either cancel my order, or wait until they had enough orders to that it would make "economic sense" for them to obtain CE marking at which point they'd ship me my order.

I have to admit I wasn't that impressed by that. If you're offering something for sale internationally then you should have the items in stock and you should be able to ship it out of the country. If they weren't prepared to ship into the EU, they shouldn't have processed my order, or billed my credit card.

They also seem to be having supply chain problems as their current stock is sold out and their store has a note on the front page saying that the lead time for a new order is currently one to one and half months between order placement to fulfilment.

However it looked like someone had put a lot of thought into this problem space, and despite the number of similar systems that are starting to appear, the system should be a neat solution. So I hung on, and I'm glad I did, as I I'm actually quite impressed with the build quality of the hardware and how it hangs together as a system...

Unboxing

My system arrived in a plain USPS box. Inside was the tag manager, an ethernet cable, a USB power adapter and cable, ten tags with velcro strips, and somewhat oddly, seven spare batteries.

The Wireless Sensor Tag System
Setting up the system is a fairly simple procedure. Plug the tag manager into your router and let it grab a DHCP address and announce itself to the mytaglist.com server. Theoretically the tags included in the tag manager in your shipment should come pre-associated, but at least for me this didn't seem to be the case, but that said associating them is no big deal. Pull the battery tab, and if you have a flashing LED that means the tag is unassociated, go to the web app and click on the button to add a new tag. The tag then shows up in the list on the web backend and you can go ahead and configure the triggers for that tag.

The Software

Unfortunately despite initial promise, I'm not finding the system amazingly reliable as yet. Tags that are within a few feet of the tag manager are being periodically being reported as "Out of Range" by the web interface. However it's possible that the hardware is fine and I'm just not understanding the software.

Update (12 Nov): Just got an email from the manufacturer saying that they've "fixed some bugs on the server" and these spurious "Out of Range" notifications shouldn't happen any more. It's a bit soon to tell one way or the other, but certainly I'm not seeing them at this point, so this might well be fixed now.

The web application used to manage the tags on your system
The web application is confusing, the interface basically looks like someone has exposed the backend database schema in software without much thought as to how the user is going to interact with it. At the moment the interesting hardware is being let down badly by the back end software, there should be preset options, e.g. "this tag is attached to a door", "this tag is attached to a moveable object", that would auto-configure the tag to common presets.

As it is there are numerous settings to go through for each and every tag, and most of these aren't well explained, and the buttons to set the options are not self explanatory or just flat out confusing. 

I'm sure it makes sense to the programmer that built it, as they understand exactly how the system works and how the components interact, to the rest of us, at least initially, it's confusing. 

I've been playing with the system for about an hour now and I still can't figure out how to get a tag to start bleeping when moved, and then keep on bleeping until manually reset. It's something you'd commonly want to do for a tag that's attached to something that might be stolen, and the system should be able to do it, but I can't figure it out. It's probably obvious once you know how, but...

They need to get a good UX person in, along with a designer, to overhaul the backend. That could make a big difference to the software and its usability for the average person. The system itself is really elegant, and easy to get up and working, the software to configure the tags is letting it down. 

Another frustration for me is that the iOS app that allows you to monitor the tags, and receive push notifications to your phone when one of your triggers is tripped, is only available in the US App Store. The ability to get push notifications was one of the major reasons for me to buy this system, so I'm hoping this is going to be resolved quickly. Again, if you're going to ship outside the US you need to make sure your system is ready to go there.

Update (12 Nov): The iOS app is now available in the UK store, which resolves one of my main problems with the system. Although unfortunately the software UX problems extend to the iOS application. It's comprehensive, but not easy to use.

The iOS Tag Manager application running on my iPhone 5
The Hardware

There is actually very little information about how the system hardware works, and I'm not in favour of "just magic", so I wanted to take a closer look at the board to try and figure out what's going on under the hood.

The rubberised enclosures are more-or-less indestructible and amazingly stretchy so they're fairly easy to take off, which is a good thing as you'll need to do that before pulling out the battery tab to activate the tag as they tend to break off if you try and do this with the enclosure still on...

Wireless Sensor Tag
The tag is powered by a single CR2032 button cell Lithium battery which they're claiming will last anywhere between two months and seven years depending on the sensitivity and polling interval you choose for the tag.

The onboard processor is a Microchip PIC16LF720 micro-controller, an interesting choice that draws about a fifth of the current than the Amtel ATmega micro-controllers used in the familiar Arduino boards. Wireless operations for the tags is provided by the Microchip MRF 49XA radio, which operates in the sub-GHz MHz ISM bands. While this can be changed, the tags ship and by default operate at 436 MHz. Unlike the US this is not an ISM band here in the UK, and although it is part of the amateur band, a license to operate is required and the primary user of the band is the MOD.

The choice of the sub-GHz ISM band is an interesting one, most competing products on the market use the 13MHz RFID bands, or more commonly the 2.4GZ band used by both Wi-Fi, Zigbee and Bluetooth LE devices. I'm guessing that they went with the sub-GHz bands to keep power usage to a minimum and extend the battery life of the tags themselves and provide a good range.

Motion sensing is provided by an Honeywell HMC5883L sensor, a three-axis magnetometer, again an interesting choice as most of the competitors are using linear accelerometers. I'm presuming they used a magnetometer to get good angular measurements, which is a perfect fit for one of the main uses cases for the tags; checking whether doors are open or closed. 

Finally I'm guessing temperature measurements are provided by a fairly anonymous chip marked with "AXWB." While that's just a guess, the word "TEMP" is the silkscreen legend next to it, so it's probably a decent one. I haven't been able to track down the data sheet for this chip or the manufacturer, although the specifications page gives an operating range of -40°C  to 85°C with an typical accuracy of ±1°C and a -2 to +4°C maximum deviation, with a sensor quantisation of around 1°C. 

Developer SDK

The system isn't "open hardware" but that's just fine, not everything has to be open, people have to eat and keep a roof over their head and that takes money. However I was pleased to see that there is some developer documentation available for the web service API of the mytaglist.com backend server, along with the the source code for the management software I was complaining about earlier. The source code for the iOS and Android applications is also available if you email the company.

Update (12 Nov): I emailed the manufacturer and they want to know why I want the source code, and for me to sign an NDA before they release it to me, which wasn't exactly what I was expecting from the API documentation. I'm not sure what to think about that...

The system does crucially rely on a back end server provided by the manufacturer, but the FAQ tells us that if the tag manager can be flashed to point at a different server, and it's at least theoretically possible to run your own. The vendor then talks about licensing their own server side software, and promises that if their mytaglist.com server gets shut down that they'll release the code and allow you to update the tag manager to point at your own server. So I'm happy enough at that point.

Summary

Just as I thought when I initially placed my order, someone has thought long and hard about this problem space, and it really shows in the quality and flexibility of the hardware if not the software. 

I'm fairly sure the software issues are going to get ironed out eventually, at least for me the existence of some sort of documentation would probably solve most of the problems I'm having. Although I do think that for the average user the interface needs a good UX expert and a redesign. 

I also hope to have my hands on the iOS app so I can use the tags as I originally intended, and enable push messaging to my phone, as that'll vastly increase the utility of the system for me.

From poking around on the manufacturer's website it seems that there are probably more tag types coming, including current (for home energy monitoring?) and moisture (for detecting water leaks) sensor tags. I'll certainly go ahead and purchase those when they arrive.

Despite some of the criticism above, I am impressed with this system and would recommend it.

Update (23 Nov): My tags were suffering from spurious "out of range" and "reconnected" messages. So I have just sent all my tags back to CAO Gadgets for a firmware update.

Thursday, August 30, 2012

Hardware Hacking for iOS Programmers

This post was originally published on Josetteorama.

The arrival of the iPhone changed the whole direction of software development for mobile platforms, and has had a profound impact on the hardware design of the smart phones that have followed it.

Not only do these devices know where they are, they can tell you how they're being held, they are sufficiently powerful to overlay data layers on the camera view, and record and interpret audio data, and they can do all this in real time. These are not just smart phones, these are computers that just happen to be able to make phone calls.

Alasdair Allan demonstrating an Augmented Reality application
The arrival of the External Accessory Framework was seen, initially at least, as having the potential to open the iOS platform up to a host of external accessories and additional sensors. Sadly, little of the innovation people were expecting actually occurred, and while there are finally starting to be some interesting products arriving on the market, for the most part the External Accessory Framework is being used to support a fairly predictable range of audio and video accessories from big-name manufacturers.

The reason for this lack of innovation is usually laid at the feet of Apple's Made for iPod (MFi) licensing program. To develop hardware accessories that connect to the iPod, iPhone, or iPad, you must be an MFi licensee.
Unfortunately, becoming a member of the MFi program is not as simple as signing up as an Apple Developer, and it is a fairly lengthy process. From personal experience I can confirm that the process of becoming an MFi licensee is not for the faint-hearted. And once you’re a member of the program, getting your hardware out of prototype stage and approved by Apple for distribution and sale is not necessarily a simple process.


However all that started to change with the arrival of Redpark's serial cable. As it's MFi approved for the hobbyist market it allows you to connect your iPhone to external hardware very simply, it also allows you to easily prototype new external accessories, bypassing a lot of the hurt you experience trying to do that wholly within the confines of the MFi program.


Another important part of that change was the Arduino. The Arduino, and the open hardware movement that has grown up with it and to a certain extent around it, is enabling a generation of high-tech tinkers to prototype new ideas with fairly minimal hardware knowledge.

Every so often a piece of technology can become a lever that lets people move the world, just a little bit. The Arduino is one of those levers. While it started off as a project to give artists access to embedded microprocessors for interactive design projects, I think it’s going to end up in a museum as one of the building blocks of the modern world. It allows rapid, cheap prototyping for embedded systems. It turns what used to be fairly tough hardware problems into simpler software problems.

Turning things into software problems makes things more scalable, it drastically reduces development time scales, and up front investment, and as the whole dot com revolution has shown, it leads to innovation. Every interesting hardware prototype to come along seems to boast that it is Arduino-compatible, or just plain built on top of an Arduino.

Controlling an Arduino directly from the iPad
I think the next round of innovation is going to take Silicon Valley, and the rest of us, back to its roots, and that's hardware. If you're a software person the things that are open and the things that are closed are changing. The skills needed to work with the technology are changing as well.

Alasdair demonstrating an Augmented Reality application
At the start of October I'll be running a workshop on iOS Sensors and External Hardware. It's going to be hardware hacking for iOS programmers, and an opportunity for people to get their hands dirty both the internal sensors in the phone, and with external hardware.

The workshop is intended to guide you through the start of that change, and get you hands-on with the hardware in your iPhone you've probably been ignoring until now. How to make use of the on-board sensors and combine them to build sophisticated location aware applications. But also how to extend the reach of these sensors by connecting your iOS device to external hardware.

Blinking the heartbeat LED of a BeagleBone from the iPhone
We'll look at three micro-controller platforms, the Arduino and the BeagleBone and Raspberry Pi, and get our hands dirty building simple applications to control the boards and gather measurements from sensors connected to it, directly from the iPhone. The course should give you the background to build your own applications independently, using the hottest location-aware technology yet for any mobile platform.

The workshop will be on Monday the 8th of October at the Hoxton Hotel in London at the heart of  Tech City, and right next to Silicon Roundabout. I'm extending a discount to readers; 10% off the ticket price with discount code OREILLY10. That makes the early bird ticket price just £449.10 (was £499), or if you miss the early bird deadline (the 1st of September) a full priced ticket still only £629.10 (£699).

Register
Monday 8th October 2012
Hoxton Hotel, London
Early Bird Price: £499 (until 1st Sept.)
Normal Price: £699
Save 10% with code OREILLY10

Sunday, August 26, 2012

Now with added Beagle Bone

After the last couple of days my workshop in London on the 8th of October, at the Hoxton Hotel, now has added BeagleBone and Raspberry Pi.

Blinking the BeagleBone's heartbeat LED using the iPhone

We're going top go hands on in a small class setting, deep diving into the iOS internal sensors and how to connect your iPhone or iPad to external hardware. Everyone will get their hands dirty, and everyone will come away knowing more about both the iPhone hardware and how to work with external accessories. So come along and get your hands dirty playing with iPhone, Arduino and now the BeagleBone and Raspberry Pi and get 10% off the Early Bird ticket price today only with code BEAGLE10.


Register
Monday 8th October 2012
Hoxton Hotel, London
Early Bird Price: £499 (until 1st Sept.)
Normal Price: £699
Save 10% with code BEAGLE10

Thursday, August 16, 2012

iOS Sensors and External Hardware Masterclass

I'm going to be down in London for O'Reilly's Strata conference in October, key-noting on the Tuesday morning, talking about the hidden data that follows us around and how I've leveraged that for my own advantage. I'll also be talking, along with my colleague Zena Wood from Exeter, about People Watching with Machine Learning and using modern smart phones, like the iPhone, to do interesting sociology. It should be good.

However I'll be kicking around town for most of the following week afterwards, talking to various people. But I had a gap, a big gap, at the beginning of that week. So I've decided to try and interesting experiment...

I've often argued that both the increasingly rich sensor suite and the ability to easily connect today's smart phones to external hardware, and sensors, make them an amazing lever on the world. It's something I've focused on a lot over the last year or so.

A conversation with Dale Dougherty and Alasdair Allan

While I've run a lot of conferences and workshops over the years, it's always been on someone else's dime. Time to put my money where my mouth is, I'm going to run a workshop.

In fact I'm going to run a master-class on iOS Sensors and External Hardware. This is going to be hardware hacking for iOS programmers. It's going to be hands on, bring your Mac, bring your iPhone and make sure you've got Xcode set up so that you can deploy apps onto your device. It'll be a small group, no more than twenty, and I'll be doing a bunch of live coding.

We'll start the day talking about the internal sensors: the accelerometer, magnetometer, gyroscope and how to combine these into sophisticated applications. Here you'll really get the benefit of my physics background, because I can take you under the user friendly skin Apple have put on top of these sensors as part of the iOS SDK and hopefully give you a decent idea of what their limitations are and how they work.

Then we'll move on to talk about how to extend the reach of the on-board sensors by connecting your iPhone to external hardware. We'll look at how to connect the Arduino micro-controller platform to your iOS device, and build simple applications to control the board and gather measurements from sensors connected to it, directly from iOS. This course will give you the background to build your own applications independently, using the hottest location-aware technology yet for any mobile platform.

iPad controlling an Arduino board via the Redpark cable
You'll take away with you an Arduino Uno board, a Redpark TTL Serial Cable for iOS, and everything you need to connect your iPhone to your new micro-controller. You'll also receive a copy of my books Basic Sensors in iOS and iOS Sensor Apps with Arduino.

The workshop will be on Monday the 8th of October at the Hoxton Hotel right next to London's Silicon Roundabout. I've opened registration and I'm offering 30% off the ticket price until the 1st of September. Sign up early, and sign up often.

More about exactly what I'm going to be talking about on the workshop's own website. I've done similar things on smaller scales in the past, but this should be a lot of fun. Hope to see at least some of you there...

Register
Monday 8th October 2012
Hoxton Hotel, London
Early Bird Price: £499 (until 1st Sept.)
Normal Price: £699

Tuesday, May 15, 2012

Location Enabled Sensors at Øredev

Back in November last year I spoke at Øredev in Malmö, Sweden, about location enabled sensors, and the video of the talk has just been put up onto the web by the organisers.

Øredev - Location Enabled Sensors for iOS from Øredev 2011.

If you're interested in the topics discussed at Øredev, all the talks will eventually make it onto the website including another talk I did at the conference on visualisation which hasn't made it online quite yet.

Tuesday, March 22, 2011

Sunday, November 15, 2009

Where 2.0 Online


At the start of December I'll be kicking off the Where 2.0 Online Conference talking about iPhone sensors. My introductory session is intended to be the foundation for the rest of the event and is based on the sensors chapter of my upcoming O'Reilly book Learning iPhone Programming. I'll be going over the sensors available and talking about how to access them, then I'll deep dive into the accelerometer and attempt to build an accelerometer based application, live on camera. I'm not sure how they talked me into that...

I'll be followed by four app developers who will each focus on the sensors they used in their respective apps. They will cover their tools, their process and their mistakes. Andreas Alfare will be talking about augmented reality, Ian Peters-Campbell will be talking about location sensors, Martin Roth about working with audio and Jeffrey Powers about computer vision.

Admittance is US$149, and participants will receive an advance copy of Chapter 10 of my book, the chapter talking about sensors, as a part of the conference fee. If you'd like to register, but you're thinking that's a bit steep, I can offer you 25% off as a "friend of the speaker", use the discount code whrfall09fsp when you register. It's should be a lot of fun, if you only to see me attempting to code on camera...