# Standalone TouchID Sensor (Lightning) I recently stumbled upon [this DIY TouchID](https://www.printables.com/model/320000) button, and I want to make one. I'd like it to be wireless, because it's already got the brains for that, I just need to keep the battery intact. This means that the enclosure will be much larger than just the one key. This makes me wonder if I could add a few other keys to it too. Maybe things I don't normally have on my keyboard, like a dedicated Focus button (which unlike Media keys is not, I think, something I can replicate with QMK on my main keyboard). Maybe the emoji button. I will be deconstructing a "Magic Keyboard with Touch ID" like this one: ![Apple's "Magic Keyboard with TouchID". This is a tenkeyless wireless keyboard with a fingerprint sensor](MK293.jpg) Since I will need the battery and logic board for my own TouchID sensor, I wonder if I can salvage all the keyswitches for [[tenet-folio|Tenet Folio]] or some other future slim keyboard. ## Getting the TouchID Components out The plastic back is afixed with adhesive on the perimeter. I used a thin pry tool to get a purchase, then a thicker pry-bar to remove it. I probably could have made it easier by heating up the plastic first, but I didn't want to risk damaging the battery. Speaking of which, be careful not to stick your pry tools too far into the device. The battery is close to the edge, and you should _not_ use it as a fulcrum when levering on the back panel. With the panel off, I was greeted by the electronics. **The first task is always to disconnect the battery**. The logic board and edge components were simple enough to remove with a T3 driver. A large plastic shield separates the battery from the rest of the keyboard. I detached the plastic shield, then carefully removed the battery from it. (I'm sorry I didn't take photos of this part). The battery is held onto the plastic sheet by adhesive, but there's an easy way to remove it. On the non-connector-end of the battery is a sticker. Carefully remove or cut the sticker, then pull the raw edge that disappears under the battery. It should stretch a lot, but don't pull so hard you tear it: you want it to stretch out so that it removes itself from under the battery. With that done we have most of the components arrayed before us: ![The electronic components of a Magic Keyboard with TouchID](IMG_6965.jpeg) In the photo above, from left to right, top to botom we have: - the TouchID sensor-button with attached ribbon cable - a return spring for the sensor-button - the power switch subassembly (plastic shield, small PCB, and switch slider thingy) - the Lightning connector with ribbon cable - the logic board - the battery (Note: I took this picture before I completely removed the plastic backing from the battery) We can run a quick test to make sure the stuff still works. Connect the TouchID sensor-button to the logic board, as well as either the Lightning connector or the battery. It should power on when you press the button part of the sensor-button (on the underside of the sensor). So what about the power switch? It doesn't seem absolutely necessary to use this as a standalone TouchID sensor. But being the person I am, I had to make this project a little more complicated. I knew that I wanted to use this wirelessly most of the time, which means I need a way to charge it, which means I need to securely affix the Lightning connector to the enclosure. So I figured, _Apple already went to great pains to design this enclosure (in California no less), so why not use the frame of the keyboard as part of my enclosure? And as long as we're using the actual frame, why not include a functional power switch?_. So, we continue with the deconstruction. (Plus, there's still a question of salvaging the membrane keyswitches for use in another project). ## Re-enabling the Power switch During the removal of the electronics, I disconnected the main ZIF cable from the logic board. This cable transmits all the signals from the keyboard presses, but it _also_ handles the signals from the power switch. So in order to reconnect the power switch we have two options: 1. figure out (through some multimeter sleuthing) which contacts on the logic board correspond to the power switch, and solder or otherwise reconnect those contacts with the power switch subassembly. 2. pull out the existing wire-mesh and use that to reconnect the logic board to the power switch. Since I was going to take the keyboard apart further anyway (to use the frame for my enclosure), I figured I'd try option 2 to start. The keyboard at this point has a black sticker covering the rest of the internals. I removed that. I'm guessing it's for static discharge protection and/or spill protection. Under the protective sheet, we see a complex stamped metal sheet holding all the keys together. This sheet is spot-welded in many places to the keyboard's upper frame. You can tear it out (like I did), but this will destroy the sheet and thus any (reasonably practical) chance of using the butterfly switches in another keyboard. ![a partially-deconstructed Magic Keyboard, showing the stamped and spot-welded metal sheet that holds all the keyboard keys](IMG_6967.jpeg) If you want to keep this sheet intact, you will probably have to drill out all the spot-welds. After removing the metal sheet (and the keys it holds in place), there are two final layers: the wire mesh and the silicon spring membrane. Unfortunately at this point I realized that 1. because I had irreversably modified the metal sheet, and 2. the fact that the wire mesh and silicon membrane are so custom-made for this keyboard, I will probably not be able to use these key switches in another project. That's ok! It was a long shot, and now I know. Moving on. The wire mesh contains the traces from the power switch ZIF connector to the logic board ZIF connector. I did some tests with cutting up this wire mesh, and it turns out it's still usable! So I cut off as much as I dared while keeping the power switch functional, and I'm happy to report that this setup works to lock and unlock my computer: ![The internals of a Magic Keyboard, with the power switch connected to the logic board using a cut-down wire mesh](IMG_6968.jpeg) My next task is to prepare the enclosure. ### Forming an Enclosure It was a quick job to cut the original top frame down with a hacksaw and files. Then I 3d-printed an insert to cover up the holes: ![It looks like the top right corner of a Magic Keyboard, if the keys were all flattened and the key legends wiped off. The TouchID button remains functional](IMG_6986.jpeg) Remaining to do: - [-] #project #TouchID #3dp wire mesh is shorting! [cancelled:: 2025-03-29] - [-] #project #TouchID #3dp make internal framing to make sure the electronics don't move around [priority:: medium] [cancelled:: 2025-03-29] - [-] #project #TouchID #3dp make the enclosure bottom to keep the electronics safe from dust and liquid [priority:: medium] [cancelled:: 2025-03-29]