So, I have a number of potential locations where my NFC lock might be useful. I decided to start with the easiest - my garage door. Operating a lock is easy if the door is already motorized and I just need to simulate a button press! I did a little investigating into the door opener. The useful connections I found were:
|Header 1||Header 2|
|Ground||A reference ground. I didn't check whether it was isolated from the mains earth powering the door opener. It shouldn't matter.|
|Power||There is a power output that supplies a separate radio receiver for the remote. I measured it with a multimeter and it's about 20V. The electronics are old, so I will assume it's not the cleanest DC signal.|
|Switch||This is connected to a manual switch. This is pulled up to the 20-ish volt level and For door operation the switch this to ground.|
I decided it would be easier to make my project battery powered. The MSP430FR2633 has a recommended input voltage range of 1.8 to 3.6V and the TRF7970A specifies 2.7 to 5.5V. A pair of 1.5V AA cells should do the job if I can make sure everything stays powered down in sleep mode most of the time. Luckily the MSP430 is particularly well suited to low power operations.
Whilst a relay is often used in switching circuits, I decided that a transistor should do the job with a little less fuss. I've actually got two garage doors and in theory the reference ground on each might not be the same. I decided for the sake of my MSP430 and to keep the door openers isolated from each other that I'd use an optoisolator in place of each of the switches. This extension to the surface mount PCB was going to be a slightly rougher one-off using through hole components on a veroboard, so I ordered a Vishay (and a few spares of course). Obviously it needed some series resistors for the LEDs inside the optoisolator and I added a couple of flyback diodes just in case it was switching anything inductive and that was that. I successfully tested it out with just one garage door and went away happy.
Battery power (again)!
The eagle-eyed amongt you may have noticed the photo shows 3 AA batteries, not 2. Everything worked well when I installed it but it seemed that within just a few hours the NFC reader stopped working. I checked I hadn't installed part-used batteries. I checked my code for device sleep modes. Nothing too suspicious. I decided that the 2.7V minimum for the TRF7970A was too close to the 3V I was supplying (over longish leads), and I switched to 3 x 1.2V NiMH rechargeables. Surely 3.6V would give me a better overhead. Still I had problems. Often one battery would be drained quickly - very odd. Also, in my efforts to keep power low I had to sweep the back of my hand over the keypad to ensure it had woken up properly before using the NFC reader. Nothing awful, but it irked me a bit.
Luckily I just happened to have some small Recom DC/DC convertors lying around. They take an 18-24V input and have a (reliable) 3.3V output. I decided life was too short to be fiddling with batteries if I didn't have to, and took the 20V power from one of the garage door openers through the DC/DC convertor instead. Version 2 turned out to be much more reliable. I also backed off on the power saving and made it more responsive. I'm sure that old door opener is wasting more power than I'm dealing with anyway.
I have some suspicions as to what the power problem might be, but I'll come back to that later. (I may have confused a power output on the TRF7970A for an input.) For now though, I'm happily opening my garage door using my NFC implant and my kids have their own secret codes, which they refuse to tell their mum!
For a video of the garage door in action, see my previous post on the firmware.
Next, something a little trickier - the front door of the house. It's far more visible so I have to make sure this is of suitable quality to pass for a professional product. No dangling wires, visible batteries, or any such bodges. Let's see how I get on...