One Minute Wonder

Lightlog was kindly asked to feature in a “One Minute Wonder” short film for Tech for Good TV, a Nesta supported project documenting people, communities, industries and institutions using technology to create social and civic change.

We arranged for Filmmaker Scott Willis to come along to the Edinburgh Hack Lab where we had a busy afternoon setting up and shooting many of the stages of Lightlog development and assembly. Thanks to the folks at the lab for not minding the disruption while we were filming. A day or two later Scott had edited together the final cut you see below. Thanks Scott! And thanks all who helped make this happen. Hope you enjoy it!

Two Steps Forward, One Step Back

Lightlog circular boards

A gorgeous batch of one hundred boards, fresh from fabrication! Unfortunately, pretty as they all are, they’re not ready for real-world use :( This batch includes a design oversight on my behalf that prevents them from fully powering down the Bluetooth device while not in use, this significantly eats into the target minimum battery life (usually over four months) leaving between one and three weeks before the battery is drained. Ouch! Luckily I can still build and use a number of these for testing the planned board fix, and move forward with the Bluetooth software implementation and testing.

Batch of 100 Lightlog boards

Lightlog with Bluetooth LE

Lightlog with BLE

With the latest circular Lightlog board fully populated with components you can see almost all parts are now on the top side of the board, making it easier to solder them in one go using solder paste (applied using a solder mask stencil). The solder is then heated using a hot air gun from above, or a hot plate from below. Placing components on the solder paste is now the slowest manual step, taking perhaps 10 to 15min, it’s a little fiddly if you don’t have patience and a steady, tweezer hand!

Lightlog with BLE

In the image above, the chip at the top is the 64Kbytes of EEPROM memory. On the left of the board is the PICAXE-14M2 micro-controller. The centre and right of the board hold the HM-11 Bluetooth LE 4.0 module (the antenna is on the right edge). Along bottom edge are five white LEDs for indicating the current light goal and ambient brightness. Near the bottom, just above the central LED, is the TAOS TCS34725FN digital colour sensor used for tracking the ambient light and colour conditions.

Lightlog with BLE

The components on the back of the board need to be soldered by hand, after the components on the front are soldered, but as there are only two large components it is a quick step to complete. In the image above, the 3V CR2032 battery holder is in the centre, and tactile press switch at the bottom. Pressing and holding the switch down for 2 seconds triggers the LEDs to display your current daily light goal achieved so far, and will attempt to synchronise data via Bluetooth if you’ve linked it to your smart phone, tablet, or computer – the code for this is still a little rough still, but will go up into the git repository (again under an Open Source license as per other parts of this project) once the more obvious kinks are ironed out.

Lightlog with BLE

Circling the Square

Board with Bluetooth LE 4

With the version of Lightlog supporting Bluetooth LE 4.0 (BLE), I took on the challenge of laying out the board to fit inside a circle. From the very early prototypes I’ve wanted Lightlog to be circular, but at that stage it was just not practical. Fewer sharp corners is always helpful when it is on something you need to wear, the round shape is also amenable to a wider range of enclosure designs.

The circular board ‘almost’ fits within the rectangle of the previous SMT layout size, but it feels noticeably smaller as its area is much less without the corners. Below is an image of the current circular board layout, a full set of Gerber files can be found over on the Lightlog git repository. There are some power management related changes needed for the next board revision – I’ll try to write a separate blog post on this – but this board is getting close…

LightLog_SMD_0.7_Rev_A

Adding Bluetooth LE

Bluetooth LE 4.0 module test rig

Bluetooth 4.0 LE (BLE) is a low energy, wireless protocol allowing communicating between devices. It only works well over a short distances, but that’s just great for a wearable device to be able to connect and synchronise with its wearers smart phone, tablet, laptop, or BLE enabled desktop computer (USB to BLE dongles are very cheap, just a few UK pounds).

When Lightlog project was first started BLE technology was too expensive to include, but after 6 months or so, lower cost modules started to appear on the market. Prices have now fallen past the point where it’s cheaper to include BLE than it is to use a USB solution (e.g. a USB cable and USB support circuitry needed on the device). There are some drawbacks with BLE as it complicates the software needed for both the Lightlog firmware, and the client app/application. BLE modules are also more power-hungry than using a physical USB connection, so extra attention is needed to make sure the battery life is not unduly affected.

Below is a close-up of the test setup for the HM-11 Bluetooth 4.0 LE part. The module is designed to be connected to a custom PCB board with surface mount pads, but here you see it manually soldered to individual breakout wires for testing on a breadboard. The connection pads on the module are tricky to solder to, any physical strain on the wires will easily rip a pad off. I managed to rip a pad off the first one I tried to test; not an auspicious start as back then they were about £10 each and I’d only managed to source 5 for early testing (now they are close to £5 each).

DSC_8199

If you’re interested in some quick technical details… Apart from the usual power (2.5-3.7V) and ground, you only need two other pins to get it working, transmit and receive (RX and TX). The other two wires in the photo are only for testing and debug; one is a to a pull-up resistor to the reset pin (if you pull the pin down to ground for 100ms you can force a reset); the other connects to a small status LED that indicates if the BLE is in discovery mode (slow blink), or connected (solid on) – very handy while testing!

Digital Colour Light Sensor

With the earlier efforts in halving the size of Lightlog also came a need to change the components used for sampling light. The previous designs using four light dependent resistors (LDRs) behind coloured filters, one for each red, green, blue, and a clear filter for white, takes up a large amount of the board space. The LDRs tolerances are also usually not all that close, perhaps up to 10% variation, so they each required calibration in software at testing at different levels of light intensity. Quite a manually intensive process when trying to build more than a handful of devices!

The solution to all this is to switch to an integrated digital light sensor that combines all colour sensors into a single chip, pre-calibrated, and in a tiny surface mounted package. After much searching and testing, the TAOS TCS34725FN seemed to be the best choice. It has a wide light dynamic range, and uses a built in infra-red (IR) filter to block IR from the sensors – preventing erroneous colour signals in some lighting situations as sunlight has lots of IR component. The sensor also connects directly to the existing I2C interface used by the 64Kbyte EEPROM memory already in Lightlog, this has the pleasant side effect of freeing up four pins on the micro-controller that can now be used for extra features.

The new sensor does need a fair amount of extra code to configure correctly, take readings, and then process the data, but it does give more consistent data that’s, at lest theoretically, much finer in resolution.