Philips Hue garden floodlight

So, after the initial teardown, it’s time to start the Philips Hue hacking. To be honest this is fairly simple so doesn’t really qualify as a hack. I said I’d start small and work up from there, so consider this a warm-up exercise.

I’ve got a motion sensing 10W LED floodlight mounted on my workshop. It’s supposed to light my way as I head out there but it doesn’t really work as I’d like. As I’m walking straight towards it the PIR only triggers when I’ve already trudged through the dark garden and I’m about a metre away. Also, the local foxes are constantly triggering it at night. Having this under Hue control would be ideal. Let’s take a look.

img_20161231_130126My Wicked brand floodlight contains a single chip LED which actually had 9 separate LEDs on the die. It has a constant current LED driver which outputs 350mA at about 24V. Hmmm – this could be very easy. They pretty much matches the Hue bulb I tore down. Electrically this might be as easy as connecting the spotlight’s LED in place of the Hue’s board. And you know what – it was! I did a quick check that the hue bulb circuitry was happy to dive the LED in the floodlight directly and then it was just a case of putting it all together. Out came the PIR sensor. Out came the constant current LED driver (the white box) and in went the Hue circuit board.

img_20170102_130311The only tricky bit was deciding where to put the PCB. Once the LED driver had gone, there was plenty of room behind the light. However, this was a metal case and the light is a fair distance away from the house. I didn’t think the Zigbee signal would reach. It didn’t have to be in the lamp at all of course, but it seemed neater.

I decided that the best place to put it was where the PIR has been. All it needed was a new 3D printed front cover. I could have saved space and printed a new back piece. I could have missed out the hinged bit and printed a two part case. My new Year’s resolution is to get project finished so I went with the simplest option.

img_20170102_131430So, here it is side by side with an original. Fitting was pretty easy. The only gotcha I has was that as i connected it, the Hue hub decided it would be a good time to update the firmware in the bulb. Hue bulbs normally switch on when first powered but whilst updating it was off. Cue some unnecessary checking of wiring, removing and remounting it, checking fuses, etc. Oh well, it working

 

NFC login (version 1.0)

After my experiments with NFC readers I felt it was time to actually create something useful to work with my NFC implant. At work I need to make sure that my PC is locked whenever I leave my desk. It’s not that I work with anything really sensitive, it’s just that given half a chance my colleagues will certainly send an email on my behalf admitting to unusual sexual inclinations or offering to buy everyone biscuits.

I decided the easiest way to do this was with keyboard emulation. It doesn’t require me to have any privileged domain access, modify the PC or install anything that compromises security. Plus, it should all be possible using a MSP430F5529.

The launchpad, booster pack and antenna.

The launchpad, booster pack and antenna.

My proof of concept involved a MSP430F5529 LaunchPad and a . I made sure that I could emulate a USB keyboard, implement a USB CDC serial port and read my tag id.

The USB side of things was adapted from some of TI’s example code. The NFC stuff was a little trickier. The Booster Pack is sold bundled with either the G2 or F5529 Launchpads. However the sample code is surprisingly complicated and only supplied for the MSP430G2553. Porting it over to the MSP430F5529 should have been fairly simple – just changes to some in assignment and clocking. It somehow took me ages but I managed it in the end. I must publish my ported code to save other people the same trouble.

I combined them all together to implement the following:

  • A USB CDC serial port allows me to set the password (but not read it). It’s stored in the microcontroller’s flash so persists when powered down.
  • Pressing one button on the launchpad send Windows-L to lock my PC. (Not actually easily accessible in its current form.)
  • It scans continuously for NFC tags and if it sees mine it sends Ctrl-Alt-Del{password}Enter

The 2 part 3D printed case for my NFC login

The 2 part 3D printed case for my NFC login

Hardware wise for version 1.0 I went with the setup from my previous including a DLP coil antenna and a cheap bit of U-FL to SMA cable from eBay. I don’t intend that the final version will be using a dev board and booster pack. It’ll be a custom etched PCB, but I decided to take the same approach as with Agile software development – produce a minimum viable product first and improve later. If I don’t ever get round to a nice neat version 2.0 then at least I can actually log in with my implant.

A view showing the installed boards and antenna

A view showing the installed boards and antenna

I 3D printed a case that allows the launchpad, booster pack and antenna to slot in. It comprises two parts that clip together and a couple of magnet to hold it firmly against the PC case on my desk. The case is 3mm thick but only 1mm thick by the antenna coil so it reads fairly easily.

OK, it just looks like a plain yellow box

OK, it just looks like a plain yellow box

The final version looks a little dull. It’s a plain box that was almost done in black, but I happened to have yellow filament in the printer. All that happens when I successfully scan my tag is that a red LED shows through the case for 5s whilst scanning is temporarily disabled and my PC unlocks.

I’ve got a little bit of tidying of the code before I include it. As it’s evolved from two different lots of sample code in different styles it’s a little bit messy. I’ll also attach the STL files for the case – designed once again in my 3D modelling package of choice OpenSCAD.

Source code (still messy) and STL files (under files folder) are now available at https://bitbucket.org/fredmurphy/public/src/127c1b2f26305bd8b2b2184084927da72457f9e5/LoginNFC/?at=master

Adjustable MSP430F5529 Launchpad enclosure

F5529 caseI’ve been working on a project using the MSP430F5529 – a really nice microcontroller with built-in USB functionality. The final product should get an etched board. However it has a whole Launchpad for now, so I thought I’d dust off the 3D printer and make a case. My favourite tool is still OpenSCAD so I came up with an adjustable enclosure. It should be easy to add any openings or custom bit if you want to.

 

Here’s what it’s being used for. More info on that later…WP_20131014_001

Custom Fisher Price records

IMG_6789I decided to turn my recent interest in CNC milling into something useful. I was discussing with a colleague at work the old Fisher Price toy record player that everyone seemed to have as a kid. It dawned on me that it might be possible to reverse engineer the records and CNC mill or 3D print a new record.

There was an interesting competition on Instructables with a really nice 3D printer as a prize, so I got to creating a CNC milled version and documenting it there. Rather than repeating myself, I’ll just point you there – http://www.instructables.com/id/Custom-records-for-a-70s-toy-record-player/

Whilst I didn’t quite manage to win the star prize, I did win a really nice home 3D printer – the UP.

IMG_7198Inspired by the win, I then adapted many project to 3D print the records instead. This is also documented on Instructables – http://www.instructables.com/id/3D-printing-records-for-a-Fisher-Price-toy-record-/

I just missed out on winning a laser cutter with that one, despite getting over 37,000 views. Nevermind. I ended up buying one anyway.