Wednesday Jul 17, 2013

Trying to build the Internet of Things

Internet of Very Small Things For quite a long time I've been interested in the idea of wireless sensor networks.  I remember reading about "Smart Dust" and even went to visit a company called Crossbow, who were developing "motes"about 10 years ago.  This then led on to working with Sun SPOTs and finding out about things like 802.15.4, ZigBee and personal area networks (PANs).  More recently, here at Oracle, we've been looking at all sorts of ways we can promote the many great advantages of Java in such environments (cross-platform support, ease of development, etc), and feeding all the data created by these devices into the data centre (thus our new Device to Datacentre initiatives).

More recently I came across an article about a startup called Wimoto, who are developing wireless sensors to measure temperature, soil conditions and water levels each for less than $40.  What interested me about this was that using Bluetooth LE technology the sensors could be powered for up to a year using a single coin cell power source.  Clearly Moore's law has finally bought us to a point where meaningful sensor networks are a commercial reality.

This got me thinking about how I could build a demo using this type of sensor technology combined with something like the Raspberry Pi to act as a concentrator using Java and the Oracle Event Processing software.

The first part was to figure out how to get some small low cost sensors for my network.  Doing some research I found what I thought was an ideal component, the BL600-SA from Laird Technologies, a low power bluetooth module with built in antenna.  Here's the basic feature set:
This is an incredible piece of technology when you realise that the price is less than £10!  This looked ideal, so I ordered two along with some coin cell battery holders.  Time to build my own mote.

Here's a picture of the module:
BL600 module top

and here's the other side with the solder pads (ignore the fact, for now, that some of them look a bit used).

BL600 solder pads

You will notice that the solder pads for the 44 possible connections are very, very small, literally about 0.5mm across with a gap of about 0.2mm.  Surface mount soldering is used in almost everything electronic these days, but sadly I am not equipped for flow soldering, either at home or in the office (Oracle heath and safety people actually get very upset if you start soldering in an open plan office).

For once I was glad that I am really short sited.  By using uncorrected vision I can get really close to the module and hopefully not burn myself while soldering.  Looking at the pin configuration it seemed that I needed 10 connections to the module:
  1. GND
  2. Vcc (3V)
  3. UART TX
  4. UART RX
  7. I2C SCL
  8. I2C SDA
  9. Analog input 1
  10. Analog input 2
I figured this would give me the ability to program the module and connect a number of different sensors.  Not too bad, as most of the connections are well spaced out.  Unfortunately, the UART ones are all grouped together.  My first attempt wasn't bad, but I was a bit concerned that I had a very small short between two of the UART connections.  In my attempt to use a scalpel to cut the solder I managed to remove the entire solder pad for the UART RX connection, which was the end of that module (good job they're cheap).

Having learnt some lessons from the first attempt my second attempt seemed better.  Here's a picture taken with a microscope of the four UART connections.


It's not exactly pretty, but I'm reasonably certain there's no short.  Having made the necessary connections I mounted the module using some blu tack (this is, after all, a hi-tech project) on a piece of veroboard, thus:


In theory, at this point I should be able to put a cell in the holder, connect the UART via something like a MAX3232 and use PuTTY to talk to the module.  Unfortunately, this is not the case.  I put a cell in and started by measuring the voltage from Vcc to GND, which should have been 3V (or a little over with a new cell).  What I get is 1V.  I assumed this meant I had a short somewhere, but when I checked the resistance between Vcc and GND it was somewhere in the region of 2 Megohms, which does not seem like a short to me.

At this point I need to have a bit of a think to see if I can figure out where the problem is.  It seems my internet of things is still some way off...


A blog covering aspects of Java SE, JavaFX and embedded Java that I find fun and interesting and want to share with other developers. As part of the Developer Outreach team at Oracle I write a lot of demo code and I use this blog to highlight useful tips and techniques I learn along the way.


« July 2013 »