Android Wear - A Makers View of the Samsung Gear Live

Sunday, July 13 2014 @ 01:01 PM

This post is a little bit different from the normal content I have here - I recently bought myself a Samsung Gear Live running Android Wear. Now that I've had it for a few days I thought it would be worthwhile doing a review from the point of few of someone who likes to tinker with their devices.

In this review I'm more interested in what I can do with the watch so I'm not going to go into a lot of details about the hardware and software that make it up. If you would like more details about those aspects I recommend the series of reviews at Ars Technica:

In my review I'll give an overview of the device itself and the Android Wear software that runs on it and then show you some ways you can start using it as an accessory for your own projects. I'd like to apologise in advance for the quality of the photos - it turns out to be very difficult to take good quality photos of an LCD screen that wants to turn off very quickly. Where possible I've used images from other sources instead.

Overview

Samsung have released a number of smart watches over the past few years, from the original Galaxy Gear (running Android) to the Gear 2 (running Tizen) and the Gear Fit. The Gear Live, despite being one of the first devices running Android Wear at launch seems to be almost a side project for them (it's not mentioned on their wearables site for example).

Unlike the version of Android for phone and tablets Android Wear seems to be far more tightly controlled by Google so the hardware vendor has much less influence on the behaviour of the device - just about everything I describe here (at least in terms of the software) will behave exactly the same way on the LG G Watch (the other launch device) as well as the upcoming Motorola Moto 360. The biggest differences involve form factor, battery life and what embedded sensors are included.

It's worth making clear that Google Wear devices are not standalone devices, they are an accessory for your phone - a bluetooth screen instead of a bluetooth headset if you like. Take away the phone (or even go out of range) and there is very little you can do with them (apart from tell the time of course).

To use the watch you need an Android phone running Android 4.3 or later - there is no support for iOS or Windows Phone and I doubt there ever will be. Choosing a wearable will lock you into the ecosystem - with Android Wear it is Google, the rumoured iWatch will be Apple. Migrating from one to the other will most likely be a difficult process.

Physical Appearance and Performance

Digital vs Real

Neither the Samsung or LG device could be called stylish - they are more solid, functional devices designed for use rather than looks. They are quite large and clunky for a watch, but not overly so (see the image to the right for a comparison). A nice feature of the Samsung over the LG is the curved back - this lets it fit comfortably on the curve of your wrist where a flat back may feel awkward given the size.

The display is nice and large, it's easy to read indoors but can be difficult to see in bright sunlight. The screen on the Samsung has a slightly higher resolution (320 x 320 pixels) and uses an OLED display rather than LCD.

The watch responds quickly and animations are smooth. The CPU embedded in the device is a quad-core ARM processor running at 1.2GHz with 512Mb of RAM so it has plenty of processing power available. Interestingly the LG and the Samsung both use exactly the same chipset in their watches - I'm assuming it's some sort of Google reference design that the manufacturers have then extended slightly.

An aside: I am forever surprised by the amount of computing power that we routinely carry around with us without thinking much about it. In the late 90s I worked with high end (at the time) Unix workstations worth many thousands of dollars that had less processing power and memory than this watch.

The battery life is more than acceptable - you do have to charge it every night much like a mobile phone but you easily get a full day worth of charge out of it. I've been using mine fairly heavily through the day from about 7:00 AM onwards and still have a 65% charge left by 6:00 PM when I get home - you could probably, at a stretch, get a charge to last two full days if needed.

Communications between the watch and the phone is done over Bluetooth and seems to have a range somewhere between 20 and 50 meters. This varies a lot though, it depends on a lot of external factors including radio interference. I can safely go to the next room without losing the connection but further than that is a bit random - at home it seems to work fine from anywhere in the house, at work more than a room away and it will drop out.

I've found the easiest way is to simply carry my phone in my pocket all the time, which a lot of people do anyway so it's not a big change in behaviour. There are a number of apps available already that will cause the watch to notify you when it is out of range (normally you just get a small icon in the top right of the screen). Currently I'm using the Find My Phone application for this and it has the added benefit of helping you to find your misplaced phone with an audio alert.

Overall there are not a lot of behavioural changes to make to start using the device - it simply replaces your existing watch. Rather than adding a new device to your collection you are simply substituting an existing one - unlike Google Glass the watches are far more subtle and quickly feel comfortable.

Setup

The setup process is driven through the phone - simply download the Android Wear application and follow the instructions it give you. This will find the device, synchronise it with your phone and then manage the communications for you. Once set up there is very little you need to do in terms of managing the device.

When you set it up out of the box it will download a firmware update (it has done this twice for me now, new features seem to be appearing on a regular basis). Over a Bluetooth connection this is a fairly slow process so be prepared to wait for a while.

One issue I had during setup was that it didn't recognise all the Android Wear compatible apps I already had on my phone - I had to power cycle the phone and use the 'Resync Apps' setting in the Android Wear application to get everything up to date.

Notifications

The primary purpose of the watch (apart from telling you the time) is to display notifications. Basically any notification that would normally appear on your phone will now appear on the watch as well. Cards from Google Now will be added as well which means you get all those predictive notifications (traffic reports, where you parked your car, etc) that make Google Now so useful. The interface uses the same card metaphor that Google Now and Google Glass use as well which makes it very easy to navigate on a small screen.

Main Screen

Initially notifications are shown on the main screen as small cards, swiping up will allow you to scroll through the current notifications. For each notification you can tap on it to get more information (the full text of an email for example) and then swipe left to display more detail or display the actions available for that notification. Swiping right will discard the notification altogether. It is a very simple set of operations that gives you a lot of flexibility and makes it extremely easy to deal with incoming notifications.

It seems like overkill to have a device that simply shows you notifications but it is really very useful. For a start, Google did a lot of work with the 4.3 version of Android to provide a richer interface to the notification system which means they are no longer limited to simple strings of text - they can be associated with images and linked back to the original application (or a smaller 'Wear' version of the app) so you can do a lot more things with them. The older, plain notifications will still show up as well so you don't have to wait for an upgrade to the application to see events from it on your watch.

You can filter the notifications you see as well - the Android Wear application on the phone has a settings dialog that lets you block notifications from specific apps. They will still appear on your phone but won't be sent to the watch itself.

It is difficult to describe how much of a difference this actually makes. After a few days of using the watch I am so used to it that it has become integral to how I work on a day to day basis. You often hear the term 'information overload' bandied around to describe how we are bombarded with small snippets of information on a daily basis - there is only so much you can do to reduce the amount of incoming information so the obvious next step is to simplify the management of that information, sorting the useful and important bits from the flow in the current context. Google Wear, if not solving the problem, certainly goes a long way in the right direction. The video below gives you a good overview of how you interact with it:

Now that I have the watch on I tend to keep my phone on silent all the time and inspect notifications on the watch to determine if it's something I need to deal with immediately, later or not at all. It's unobtrusive and avoids the 'always playing with his phone' perception (especially good in meetings). Of course you are just swapping 'playing with your phone' to 'playing with your watch' but the process is a lot quicker and far less distracting.

Wearable Applications

Google Wear is more of a reactive device - it's designed to let you quickly react to incoming events. That doesn't mean you can't instigate events on it though - this is where the applications come in.

Unlike the Android interface where you are presented with a collection of applications to chose from to launch most are started through a voice based interface. First you attract the devices attention with the 'OK Google' key phrase and then state what you want to do.

The speech recognition on the device is really well done (still not perfect, but good enough that you can use it every day without getting frustrate) and makes good use of natural sounding phrases such as 'send a text to contact name', 'take a note' and 'remind me to action tomorrow afternoon'.

I had to devote some time to clean up my contact list so the primary name for all contacts was something I would generally call them, instead of 'Tesla, N' for Nikola Telsa I might put 'Nick' or 'Nick Tesla'. This makes it more likely that the voice recognition will match the right contact. Of course I have 'Mum' and 'Dad' in the list :)

One complaint I have is that there is a very small window of opportunity to cancel the action if the voice recognition makes a mistake and it's not really obvious that you can cancel it (a button appears that looks more like a progress indicator than a button - tapping on it will actually cancel the operation). A text message I tried to send to my sister saying 'Are you at Shawns?' got interpreted as 'Are you trans?' and sent before I could cancel it (the response was 'WTF?'). As I said, the voice recognition is good, but not perfect.

Because, of course.

There are custom applications available (as in applications that get installed on the watch itself rather than 'Wear Aware' apps) and the number is growing on a daily basis. You don't really download an Android Wear application though, they are an add-on to a normal Android application - you install the primary application on your phone and (if it has one) the 'sidekick' application will be pushed to your watch. Naturally one of the first games to appear that plays directly on the watch is a Flappy Bird clone.

Like Glassware these apps can attach themselves to their own keyphrase or you can launch them by name by saying 'start application name' or navigating to them by touch. The touch option is a bit annoying - you can either say the 'OK Google' keyphrase or tap the screen to get into action mode, swipe up to get to a menu, scroll all the way to the bottom to see the 'Start ..' option, tap that and then select your application. I get the feeling Google really don't want to see a lot of applications that need to be 'started' - as I said it is more of a 'reactive' device and applications should really just allow you to do things with notifications sent to it by the host application running on the phone.

Your Own Apps

Now, as makers we would really like it to show our own notifications and trigger our own actions. It would be easy enough to simply send text messages or emails (they will show up as notifications) but it would be nice to have a an interface that is a bit less general than that. Here are some of the options that are available to you for that.

The Android SDK

Obviously you could write your own custom application, the Android SDK is available for free, supports Google Wear as well as 'standard' Android, runs on Linux, Windows and OS/X and you can deploy applications to your own device without going through the Play Store. If all you are interested in is sending notifications to the watch you don't even have to write a Google Wear device - just sending a normal phone notification (preferably through the new notification API) will do the trick.

If you already have experience developing Android applications this might be a good solution for you, if not it is a pretty steep learning curve to climb before you get the results that you want. You probably don't want to install a separate application for every device or set of events you want to see either.

If This Then That

If you haven't already played with IFTTT you probably should. Essentially it allows you to set up simple rules with a 'this' (event) side and a 'that' (action) side. Both 'this' and 'that' are selected from a fixed set of 'channels' (as I'm writing this there are 116 available channels) which include some popular hardware device interfaces and web services.

IFTTT has had an 'Android Device' channel for a while and has recently introduced an 'Android Wear' channel as well. On the 'this' side the channel allows you to trigger an event by pushing a button in the custom IFTTT application that gets pushed to your watch, on the 'that' side you can send notifications to your watch (with text and an appropriate image).

Unfortunately IFTTT isn't a very open service, if you want to interact with something that isn't already implemented as a channel you only have a few options available to you:

  1. Use the RSS channel to read an RSS or Atom feed from a server you control and use that to provide detail to IFTTT. You can use filters on the data in the RSS entry to trigger an appropriate action. The delay between you adding a new entry in the RSS file and it being processed by IFTTT can be very long though (measured in hours, or even days).
  2. Implement the WordPress API on a server you control and point the IFTTT 'WordPress' channel at it. The timing is a bit better than RSS (but not much) and it allows you to use it for the 'that' (action) side of the recipe as well.

Another downside is that activating a trigger requires you to either navigate to the IFTTT application by touch using the awkward process I described above or saying the phrase 'start I F T T T' which is not exactly intuitive. Despite this, if the services you want to integrate are already supported by IFTTT and you can accept a delay between the event occurring and the action being triggered this may be all you need.

InstaPush

One of the channels available on IFTTT is Instapush and you can use this directly through a very simple REST API as well as through IFTTT. Basically, this service allows you to send a notification to any iOS or Android device. On Android these notifications will automatically appear on your watch. At the moment in only supports basic text notifications, hopefully support for richer notifications will appear in a future release.

There is a little bit of set up required (read the Instapush Getting Started page for more details) but the API itself is very straight forward. Essentially you need an APPID and an APPSECRET string to identify yourself, an event type to identify the event being sent and a dictionary of trackers which are values to be inserted into the notification text.

Where I work we have a number of build processes that can take a very long time to complete - I wrote a small Python script to notify me when they start, succeed and fail so I don't have to keep checking the output log. The notification I get sent has the text 'Project '{project}' build has {status}' where project and status are variables passed to the event. To invoke it I simply use the command line like the following ...

buildevent.py test-project failed

... which will send a notification to my phone (and to my watch) with the text "Project test-project build has failed". The source for this utility looks like this:

#!/usr/bin/env python
#----------------------------------------------------------------------------
# Send build events via InstaPush (http://instapush.im)
#----------------------------------------------------------------------------
import sys
import json
import requests

#--- Instapush validation
APP_URL    = "http://api.instapush.im/post"
APP_ID     = "enter_appid_here"
APP_SECRET = "enter_app_secret_here"

#--- Usage information
USAGE = """
%s project status

  The 'project' parameter specifies the project name, the status describes
  the build status."
"""

def pushEvent(activity, trackers):
  global APP_URL, APP_ID, APP_SECRET
  headers = {"X-INSTAPUSH-APPID": APP_ID, 'X-INSTAPUSH-APPSECRET': APP_SECRET, 'Content-Type': 'application/json'}
  data = {"event": activity, "trackers": trackers}
  return requests.post(APP_URL, headers=headers, data=json.dumps(data))

if __name__ == "__main__":
  # Check command line arguments
  if len(sys.argv) <> 3:
    print (USAGE % sys.argv[0]).strip()
    exit(1)
  # Send out the event
  pushEvent('status', { 'project': sys.argv[1], 'status': sys.argv[2] })

The code to send an event is in the 'pushEvent()' function - only a few lines. I do cheat a bit and use the requests module to simplify making the REST request.

It would be very easy to integrate this into your application to send events from any source you like. I'm going to integrate this into the code driving my Bluebell device to send notifications to my phone (and watch) as well.

Conclusion

I certainly don't regret buying the watch - I came very close to getting the original Galaxy Gear when it came out but was put off by the lack of an SDK or any other way to customise what it displayed. The same went for the Pebble, although it did provide an SDK it seemed like a lot of work to get what I wanted displayed on the watch face.

Your mileage may very though, I had an advantage in that I was already deeply invested in the Google ecosystem so everything would integrate well without having to migrate email accounts, cloud services and the rest of my digital life to get the most out of it. For me this device was a natural extension of the services I already use and had the added benefit of being easy to talk to with existing services and some simple code. Given that it is based on an operating system I am already very familiar with means that I can do some more detailed development on it if I need to.

Although I'm hesitant to recommend that you should go out and buy one (everyones requirements are different) I can certainly recommend that you give it a serious look. Wearables are not going to go away anytime soon and replacing existing technology that we wear on our wrist every day with something that has a lot more functionality is not a huge leap.


Fun With Lasers: Part 3 - Burning Things

Sunday, July 06 2014 @ 08:50 PM

The first two parts of this small series concentrated on acquiring and then powering a laser diode from a DVD/RW drive. In this post we get to the fun stuff - using the laser to cut and burn.

I tried the laser jig I described in the previous post on a range of different materials to see what effect it had on them. If you are going to try this for yourself make sure you adhere to the safety guidelines I outlined in the first post. As we are using the lasers heat to burn through materials there is going to smoke and (depending on the material) some of it can be toxic so make sure that any experiments you do are in a well ventilated area.

Foam and Plastic

This type of material is perfect for this laser - plastic has a low melting point and (as long as it's not reflective and doesn't contain any red pigment) the laser goes through it very rapidly. This is the only material I've tried that I could achieve a complete cut at any reasonable depth.

2mm Foam

The image to the left shows the result after applying the laser to 2mm thick craft foam. I had some thin strips of various colours as well as rainbow coloured sheets - perfect for seeing what difference the colour of the material has. With foam the laser has an almost immediate effect and can be moved fairly rapidly (2 or 3 mm/sec) to continue the cut.

The foam does need to be a dark colour though and not reflect a lot of red light. If you look at the bottom of the image you will see that the cut comes to a dead stop at the boundary of the yellow section - this was not done on purpose. I was moving the laser at the same rate past that boundary but it was not providing enough energy to cut through the foam.

Any black plastic is another good candidate for use with the laser. It is easy to scour designs into thicker plastic and thinner plastic (like duct tape) can be cut through directly. I haven't provided any photos of these though - the duct tape is the most interesting but the cuts are very thin and I was unable to capture a good photograph that showed it clearly.

Wood and Paper

I didn't have a lot of samples of paper to test with apart from the normal white photocopier paper - it turns out that matte black paper is very difficult to find. Everything I could find had a glossy finish which simply reflected too much of the laser light to allow enough heat to develop to mark or cut.

White Paper

Although I could not start a cut on plain white paper I found that if I started at an already darkened area (a pencil mark or a printed character) I could initiate a cut and then continue it into the lighter coloured areas. The image to the right shows a cut started on a laser printed character and continued into the main part of the page (again at 2 to 3 mm/sec). Once the cut started the surrounding area becomes dark enough to absorb enough energy to continue the cut as you move the beam.

Balsa Wood

This turned out to be a common theme with lighter coloured materials, my experiments with wood had very similar results. I collected a range of different woods from around the lab - I wound up with some balsa, some pine, paddle pop sticks and MDF. Obviously you will not be able to cut through wood but you can make a deep enough burn to permanently mark it.

With lighter coloured woods it was very difficult (if not impossible) to start the burning process, as with the white paper I had to darken an area of the wood first (I just used a pencil) and, once initiated, the burn would continue without interruption.

Paddle Pops

The denser the wood the slower the laser can advance to continue the burn and the longer it takes to initiate it. Even though MDF is far darker than pine or balsa it still need assistance to get started and the movement rate of the laser was reduced to less than 1mm/sec in order to reliably continue it. This was the rate I used by hand and was just enough to continue a surface mark, if you want to make deep burns the rate would need to be even slower.

PCB Etching

You cannot cut through even the thin layer of copper on a PCB with a 400mW laser, using it to facilitate PCB etching is a multi-step process:

  1. We need to coat the copper side of the PCB with a material that can be burnt away with the the laser.
  2. Burn away the coating to expose the copper that we want to get rid of.
  3. Etch the board as normal and then remove the excess coating.

The results (when using a commercial laser etcher) can be very impressive (as seen in the image to the left). What I wanted to find out was how well I could replicate that with a lower powered laser.

The original post I came across described using a thin layer of spray paint to provide the protective surface that will be burnt away. I tried that with a matte black enamel spray paint and was unable to make any mark in the surface at all.

Sample Paints

On the assumption that a general use paint would contain heat resistant material I decided to experiment with some different types of paint and ink (as shown in the image to the right). Unfortunately I made no progress with any of these either, I was not able to even leave a mark in the coating let alone burn it away to expose the surface beneath. My current working theory is that the heat dissipates too quickly (copper is a good conductor after all) before the covering material can heat up enough to ablate.

Summary

Given that my original goal for these experiments was to be able to use the laser to help create PCBs the results are a bit disappointing. It was certainly fun to play with (lasers!) but in terms of utility it is a bit limiting - at the power levels available at least.

As an alternative tool head for a CNC machine or a 3D printer it would be useful, adding the ability to cut foam and paper or permanently mark wood and plastic. There is a reasonable investment of time and effort required to get it working though so you would have to justify that against how often you would use it.

As a tool for preparing PCBs a 300mW or 400mW laser is simply not going to do the job unfortunately.


Fun With Lasers: Part 2 - Powering a DVD/RW Laser Diode

Sunday, July 06 2014 @ 03:35 PM

This is the second post about my experiments with laser diodes, you can read the first one here. In this post I cover adding a lens to focus the beam and protect the diode, building a suitable power supply to drive the laser without destroying it, and finally putting the whole assembly in a safe to use mounting frame.

Adding a Lens

The easiest, and safest way, to mount your diode is to use a pre-made laser diode assembly. These can be purchased on eBay for a reasonable price (just search for "laser diode housing") and include a heatsink, a mount for the TO-18 diode case and an adjustable lens to focus the beam.

I was a little unsure how to assemble everything at first, the image to the left shows how all the various parts fit together. For the most part there are no tools required to assemble everything, you do need to fit the laser diode into the mount provided which does require some force.

Make sure that you solder the power leads to the diode before mounting it. You will need a reasonable length on the cables (about 15cm to 20cm should be fine) so you have a bit of freedom of movement.

To avoid damaging the diode I used a file to enlarge the hole for it but I overdid it a bit and made the hole a bit too large. To compensate for that I used some wax to ensure the diode wouldn't move - it's probably not the best solution but it seems to be working fine.

Normally you would need to apply enough pressure to force the diode into place without damaging. Most advice I have seen on this is to use a small vice to do the task.

Building a Power Supply

If you have extracted a diode from a DVD/RW drive as described in the previous post you should have a 650nm RED laser with a power rating between 300mW and 400mW (a 16X DVD/RW drive should have a 300mW diode, a 32X will generally have a 400mW).

It can be difficult to determine the exact specifications of the laser diode you have (on all the devices I've pulled apart the diodes have no part numbers or any other markings on them) so getting the power supply right requires a little bit of trial and error.

The best place to start is with a 200mA constant current supply. These can be built around an LM317 voltage regulator.

Constant Current

In this case we need a power supply that regulates the current, rather than the voltage. The LM317 is perfect for this task - it can provide an output current of up to 1.5A and requires minimal external circuitry. The schematic to the right shows the design I used.

The output current is controlled by the resistor network between the output and adjust pins on the regulator chip using the formula:

I = 1.25 / R

The network I use has two 10 Ohm resistors in parallel (giving a 5 Ohm total resistance) and a trimpot in series for fine tuning. This allows for a minimum resistance of 5 Ohms and a maximum output current of 250mA. The laser diode has a forward voltage drop of 2.5V so the total power passing through the circuit will be over 500mW - standard 1/2W or 1/4W resistors are not good enough so I used 10W wire-wound resistors instead.

This is jumping ahead a little bit but I found that a 200mA supply is not to generate the full 300mW output the laser is capable of due to the diodes conversion efficiency. We need around 350mA output instead. I added another 10 Ohm resistor to the parallel network reducing the base resistance to 3.3 Ohm and allowing for over 600 mA if needed.

An alternative solution would be to reduce the resistance of the two existing resistors - if you swap the 10 Ohm resistors with 5.6 Ohm ones you will get a similar boost in the output current range.

Tuning the Current

To start with we want the regulator to output a steady 200mA before we attach the laser diode so we need to tune the power supply first. You will need an input power of 9V to 12V, 3 1N4001 diodes and a multimeter capable of measuring up to 500mA of current.

Connect the 3 diodes in series (this will simulate the 2.5V forward voltage drop of the laser diode) and connect this to the output of the power supply with the multimeter in series. Apply the input voltage and adjust the trimpot until you get a steady 200mA reading on the multimeter.

Tuning the Power

I recommend starting with the 200mA current for your initial work. This is not driving the laser at it's full capacity though (the output will actually be about 180mW).

I haven't been able to find detailed datasheets for the laser diodes so ensuring maximum power output mostly done through guesswork and experimentation. The biggest issue is the conversion efficiency of the diode and this is effected by heat as well (you don't want the diode to get much above 60 degrees Celsius).

As a general rule of thumb I've found the output is about 86% of the input current - so at 200mA you are getting around 170mW, at 350mA you are getting around 300mW. If you have a 400mW laser (out of a 32X DVD writer for example) you will need to be driving it at 460mA. Please note that these are guesstimates and have worked with the lasers I have - pushing the current too high (or running the laser for extended periods at high current) will damage it.

Building a Frame

At this stage we have a powered laser with a focusing lens and protective casing and that's probably all that's needed for basic experimentation. I was a bit concerned about the cylindrical lens casing however - I didn't want to have it slip out of my hands and accidentally beam light directly into my (or any other hapless bystanders) eyes. I also wanted to a way to keep the laser a constant distance away from the target surface so I could replicate experiments with some consistency.

To help with this I designed a simple square frame that I could mount the lens assembly in. The design is pretty straight forward (see the image to the right) so I won't cover it in too much detail. You can download the OpenSCAD and STL files for it here.

Once the frame is put together it's a simple matter of inserting the lens assembly and positioning it so the focal point for the laser light is in the centre of the bottom part of the frame. Now I can simply place the frame on the material I want to test against and move it around to test the time it takes to burn or etch that surface.

Next Steps

Now that we have everything in place it's time to find out what a laser of this power can and can't burn. Ideally I would like to be able to burn a thin layer of black paint from a copper surface (and thus expose the copper for later acid etching) but there are other interesting applications as well (cutting stencils out of thin material or slicing up foam for simple constructions for example). In the next post I'll detail the results of those experiments.


Fun With Lasers: Part 1 - Extracting a DVD/RW Laser Diode

Friday, July 04 2014 @ 06:44 PM

This post is the first of a series about building a tool to simplify the production of PCB boards at home. I was inspired by this post about using diode lasers to prepare PCBs for etching - it seemed far quicker than the toner transfer method I'm currently using (in terms of active 'hands on' time at least) and the results seem to have a much higher precision. I already have a 3D printer so I was hoping to make an attachment to the print head that would hold a laser diode and use it to prepare the boards for me.

The trouble with things like this that you find on the internet is that they cannot always be replicated - so the first step was to see if I could access a laser diode and use it to burn paint from a PCB. This post is all about that process.

Safety First!

I must point out that playing with lasers is inherently dangerous and you MUST take all precautions before doing so - even reflected laser light can permanently damage your eyes.

Here are some simple precautions you need to take before trying this for yourself:

  • Make sure you have a pair of laser safety glasses suitable for the wavelength of laser you are going to be using. These are relatively cheap and easily available. Wear them every time you use the laser.
  • Do not point the laser directly at yourself - reflected laser light (even at the relatively low powers being used here) can permanently damage your eyes, direct light can cause permanent blindness.
  • Lasers generate a lot of heat in a very small area - this is a fire hazard and you need to take it into account.

Generally you should treat a laser as if it were a power tool - it's useful but if used without due caution you could easily lose a limb or a major organ.

Getting a Laser Diode

Laser Diode

The easiest way to acquire a laser diode with reasonable amount of power is to extract one from an old DVD/RW drive. These drives will generally contain two diodes, a 300mW to 400mW red (650nm) diode and an infrared one - we are only interested in the red diode. The diodes are in a TO-18 package, it looks like a small tin can with the diode lens at the top and three legs out the bottom.

There are plenty of tutorials on the internet showing how to extract the diode but I found that not all DVD drives are the same (the images in this post are from my third diode extraction - each of the drives was different). What is shown here is repeated elsewhere on the internet but I'm trying to be as generic as possible - rather than a specific set of instruction this is more of a guide of what to look for.

NOTE: This is a time consuming process which requires some patience and care. If you are applying excessive force at any step you are probably doing it wrong, step back - take a breath - and think it through. It is very easy to damage the diode so you do need to be careful to get the optimum results.

Tools and Parts Required

Before you begin make sure you have everything you need handy. I wound up using the following tools:

  1. Jewellers Screwdrivers - the standard set of phillips and flat headed drivers you can buy from most hardware stores will do the trick.
  2. Needle nose pliers - something with a good grip and small gripping area at the tip.
  3. Small Wire Cutters - the wire cutter on the pliers will not be good enough, you need something with a cutting edge at the tip.
  4. Small Files - not your normal woodworking files, you need something small. I have a set I got from a hobby shop for working with plastic models - they work well with soft metal as well.
  5. Dremel - any rotary tool really. You will need a cutting disk to go with it.
  6. Helping Hands - something to hold small parts firmly in place while you work on them.
  7. Soldering Iron.
  8. 3V Battery Pack - you will use this to do basic testing of the diode. I used a small 2 x AA battery pack for this.

Obviously you will also need a DVD/RW drive. I recommend collecting a few (at least two) before starting. It took me three attempts to extract a completely undamaged laser diode (the first two still worked despite the damage but were not optimal). The older the drive the easier it is to extract the diode, newer drives have more compact write heads and more tightly packed components.

And it goes without saying that you have the necessary safety equipment - most importantly a pair of laser safety goggles. At various times during the process you will need to apply power to the laser diode to test it - at these times please ensure the following:

  1. You are wearing your laser safety goggles.
  2. Always point the laser away from you (one of the lasers is an infrared laser and shows no visible beam).
  3. Make sure there are no metal fragments or shiny material in front of the laser - you do not want any reflections coming back at you.

Step 1: Expose the Read/Write Head

This is the simplest part - the laser diodes are on a small assembly that is moved back and forward over the surface of the DVD. All we want to do is extract that assembly and leave the rest of the drive untouched. We need to expose that assembly so we can get at it and unfortunately I didn't take any photographs of this part so you will have to go by description alone. Thankfully it's pretty straightforward.

First you will need to remove the outer metal shell of the DVD drive. Usually this involves removing 4 screws that hold it into place (there may also be a plastic clip connecting the front panel to the shell that you will have to release).

Once the metal case is removed you need to open the DVD tray to give yourself a bit of room to work in. There is usually a plastic slide you can push to do this. After that you need to remove the logic board - first unplug (or cut through) any cables connected to it and then detach it from the case. In all of the drives I have worked on it is simply attached by a plastic clip, some of the examples I have seen on the internet show it attached with screws - it should be fairly easy to disconnect and remove regardless. At the end of this you should be looking at something like the image to the left.

Step 2: Remove the Read/Write Head

The Read/Write head is suspended between two metal rods (see the image above), we need to remove it from the rods and (preferably) leave everything else intact. Generally you can achieve this by undoing a few screws and sliding the assembly off the rails it is attached to.

The image to the right shows it removed (the head assembly is in the bottom left of the image). In this photo I have re-attached the sliding rod it was attached to - this could be re-used at a later date for a small plotter or CNC machine.

Step 3: Remove the Laser Diode Assemblies

When you look closely at the read/write head assembly you can see the laser diodes attached to it. These consist of the laser diodes themselves wrapped in a heat sink and some wiring attached to it. At this stage we want to remove the laser diodes and heat sinks, the wiring is not of any use to us so we can sacrifice it. It is easiest to simply cut away any connecting wires and get them out of the way first.

In most cases I've found that the heat sinks are held in place by a mix of mechanical force and some waxy substance. You can scratch away the wax, check for any screws that may be present and remove them in necessary and then gently wriggle the heat sinks away from the main assembly - what you will end up with should look like the next image.

As I mentioned earlier there are two lasers in a DVD drive - one is a low power infrared laser (and doesn't generate any visible light), the other is red diode that we really want. At this stage we need to test both diodes to determine which one is the one we want to continue working with. The remaining parts you can either discard or keep for use later - I added everything I didn't use to a junk box on the assumption it might be useful later (one of the reasons the 'Garage Lab' requires a garage and not just a cupboard).

Step 4: Identify the Red Laser

As I mentioned in the previous step you should have removed all connecting wires to the laser diodes. You may need to make use of a solder sucker, desoldering braid or other desoldering tools as well as judicious use of side-cutters to achieve this. The end result should look something like the image to the right.

You can use a simple two AA (or AAA) battery pack to check the laser output, this will provide enough power to activate the laser diode without damaging it. Before you do this step make sure that;

  1. The lens of the laser is pointing away from you and there are no reflective surfaces in it's path.
  2. Wear your laser safety glasses.

The markings on the laser aren't very clear so you will need to test each pin combination. Simply attach the ground to one pin and touch the positive wire to each of the other pins in turn; repeat this process for each pin combination until you get a result.

One of the lasers will generate red light, the other generates infrared which you will not be able to see. If you don't get a response from either diode it has probably been damaged either before or during the removal process - you will have to start again with a different DVD drive.

Step 5: Remove the Heatsink

The diode needs to be removed from the heatsink material so we can insert it into a lens assembly. They are packed very firmly into the heatsink so trying to remove it by force (just pushing it out) will only damage the head of the diode. Luckily the heatsink is made of very soft metal so the safest way to remove it is to cut through the heatsink and then peel it away from the diode.

The technique I have used with some success is to carefully cut through the thinnest part of the heat sink with a dremel using a cutting disk. You need to take some care that you don't cut into the diode itself so check how deep the cut is at regular intervals. When the cut is deep enough you can grip each end of the heatsink with a pair of pliers and peel it apart.

This process involves a bit of trial and error - if you find yourself applying a lot of force with the pliers you probably need to cut some more before trying again. The end result should be a nice (and hopefully undamaged) laser diode:

Next Steps

Now we have a laser diode and we have proven it works. The next step is to build a decent power supply for it, add a lens to concentrate it on a specific point and see if it can do what we want it to. I will cover these steps in the next post.


The Bluebell, a Bluetooth Notification Device

Wednesday, June 04 2014 @ 09:35 PM

The Bluebell

After more than three weeks, numerous interruptions and delays the project I though would take a few days is finally finished. Finished enough to publish at least.

This post describes the Bluebell - a small Bluetooth controlled ambient device built around an ATtiny85 CPU. This is one of the first complete projects based around my ATtiny85 template library which is a bit of a milestone for that project.

The Hardware

The project pulls together a number of things I've spoken about in recent posts such as the software based UART, a HC-05 Bluetooth module and RGB LEDs driven by PWM so I won't discuss them in detail here.

I've put those components together in a simple circuit, added support for battery powered operation and wrote some firmware to provide a very simple serial protocol for remote control. The whole thing is then packaged in a 3D printed case. As usual, the entire project is available on GitHub under a Creative Commons License if you would like to build your own.

You can see the schematic of the logic board in the image to the left. To make things fit more neatly in the final case I split the LEDs out on to a separate board and use male and female pin headers to join the two together. Although the schematic shows NPN BJT transistors driving the LEDs I am actually using 2N7000 N-channel FETs for this task - I couldn't find a suitable Fritzing footprint for them but the generic NPN transistor was the closest matching component with a compatible PCB layout.

The only part of the circuit that I haven't discussed in previous posts is the power supply. Previously I have used AA battery packs (4 batteries for a total of 6V output) for my projects but I wanted to try and minimise the size of this one so I opted for a 9V battery as the main source of power instead.

There are two regulators in the circuit - a 5V switching regulator and a 3.3V LDO regulator. I'm using a RECOM DC/DC converter for the 5V supply, it is a drop in replacement for the classic 7805 regulator but far more efficient and more suitable for a battery powered device. The output from this regulator is used to drive the LEDs and provide the input to the next regulator. The 3.3V regulator is a MCP1702 LDO regulator which can provide up to 200mA - more than enough for what we need.

To monitor the battery voltage I pass it through a voltage divider and into an analog input. We want to report this back over the Bluetooth connection so it's easy to know when the battery is going to need replacing.

The Firmware

The firmware that is currently in the repository is very simple and doesn't use all the features available on the device - there is no read of the battery level for example even though it is available on an analog input.

Essentially all it does is listen on the serial port for incoming commands from the controlling PC. Each command consists of 6 bytes - a start byte (I'm using the '!' character for this), the red, green and blue values for the LEDs, a time period (in seconds) and a termination byte (the newline character). The use of start and termination characters makes it easier to identify a valid command and to re-sync with incoming commands if there is any noise on the line.

Rather than simply set the requested colour the LEDs will cross fade from their current colour to the requested one, hold it for the specified number of seconds and then fade back to off. This serves two purposes - it means the device is not always glowing at you so you are more likely to pay attention when it does start glowing and it improves the battery life.

There are two RGB LEDs in the device, both of which always display the same colour. In the worst case (the LED's are full white) that means a current draw of 120mA (20mA per colour for two LEDs).

To establish the serial connection you simply connect to the Bluetooth device as a virtual serial port. I have pre-configured the HC-05 module as described here so no additional work is required on the firmware side.

Controller Software

To drive the device I wrote a simple Python wrapper that uses pySerial to communicate with the serial port. I separated that out into a separate class that you can use in your own applications. There is a sample command line tool that simply takes the serial port name, the colour values and (optionally) the time and sends that to the device.

Next Steps

Although I have something up and working it is still very much the seed of an idea rather than the complete fulfilment of one. The whole idea of an ambient device is great and I would really like to spread them through my house like confetti. Currently available implementations seem too overpriced for my liking and lack an easy interface.

The current iteration is very clunky, to say the least, and the position of the two LEDs isn't the most appealing when they are lit. I would really like to shrink it down to a much smaller size. Improving the power consumption or moving to a different power source would help - it's the battery and supporting power management circuit that takes up a lot of room.

The boxy form factor needs to go as well. I recently came across some small LED lights at a dollar store that are fairly appealing - you can see one of them in the image to the right. If I replaced the clear plastic top cover with something that provide a bit more diffuse light it would be a perfect size and easy to mount unobtrusively around the house and the garage.

The Bluetooth based connection works well (and the HC-05 module is very easy to use) but requires a controller that is always on so the connection remains established. It also means you need a separate virtual serial port for each device you have connected - not bad if there is only one or two of them but I would like to have the ability to use a larger number than that.

The biggest improvement would not be related to hardware at all but a simple communications protocol that could be used to control devices such as this as well as reading data from remote sensors that makes it easy to integrate everything together. That however, is a much larger project.


Follow me on Google+ to see build images, construction notes and previews of upcoming projects.

Recommended Sites

  • EEWeb

    Electrical Engineering News, Resources, and Community.

  • Sprites Mods

    A collection of projects from a very talented engineer.

  • Blondihacks

    A great collection of hacks and projects by Quinn Dunki.

  • Embedded Projects

    Embedded Projects from Around the Web.

Donate Doge

Like the site? Be kind and send a few Dogecoin my way.
DAqGZFkVj9meRgHMve9W5KQshdvZ3UCtGF