Ever since seeing the article the user Hydron posted about his Model M bluetooth project I have wanted to do a similar controller. Since I dislike DIY projects that look hacked together I was not happy simply reprogramming a controller board from a suitable bluetooth keyboard and connecting it directly to my Model M. I also wanted a simple way to change or charge the batteries as well as press the pairing button.During my search for suitable sources for a bluetooth module I stumbled across Jeff Rowberg and his Keyglove project. In one post he wrote about his experiences with the BluePacket BP20422 module which he sourced from a cheap mini keyboard named ITON PA-BK03 off Ebay. It sounded perfect for my needs so I decided to try it out.After buying a few of the keyboards, disassembling one and desoldering its parts, I desoldered the EEPROM from the bluetooth module, connected it to an SSOP adapter and read out its contents with I2C using my Bus Pirate Unfortunately, after examining the firmware I realized it did not have the same structure as the one Hydron wrote about. The key matrix in this firmware was custom made for a mini keyboard, that is, it was not programmed to scan enough rows and columns to be usable with a Model M keyboard. Since I do not have the skills to reverse engineer the firmware and add a larger matrix, I tracked down a keyboard like the one Hydron used and read out its firmware. Fortunately, the firmware was interchangable between the modules and I could reprogram the key matrix to suit a Model M.Since the mini keyboard included a Li-Po battery and a USB charger I decided to trace and write down the wiring of the keyboard into a Kicad schematic. Comparing it to the full size keyboard, there were a few adjustments to be made, and this is what I came up with:Using Kicad, I designed a PCB that would fit inside a Model M and sent it to a PCB service . Two weeks later I recieved them:Assembled:The 850mAh battery was bought elsewere, the one on the mini keyboard is 150mAh (though it seems to change between production runs). I do not have access to an accurate enough ammeter or multimeter, so I have not been able to calculate how long the batteries will last between charges. I have however been using the 150mAh battery daily for almost a week of moderate typing and have yet to recharge it. The 850mAh will probably last several weeks if not months.I decided to include the four pin serial port connector that can supposedly be used to program the module. However, I have not been able to find any information on how to use it.I also had hopes of utilizing the caps/scroll/num-lock led ports of the bluetooth module (the white four pin connector) but the firmware does not support it.The PCB footprint for the Model M key row membrane (right flat connector) has holes to fit an 8 as well as 12 pin connector to support both older and newer type membranes. The key matrix in the firmware can be programmed to support models 1391401 and 1392934 (including international variants), and probably other models if the key matrix is known.Since I did not wish to modify anything on my Model M except the controller board I made use of the opening for the SDL connector for mini USB, power switch, pairing button and LEDs.The blue LED is on all the time the keyboard is powered (unfortunately) and blinks when the controller is in pairing/discovery mode. The red LED is on while the battery is being charged and is switched off when the battery is fully charged. I am not too concerned about the power loss from the blue LED since it is a quality "high efficiency" one only dimly lit with a high resistance.The battery being charged:As for the USB connector, the module is not capable of sending signals over it as far as I know, so it is only used for charging the battery.The bluetooth module is supposed to have an operating range of 10 meters, but in my experience anything more than 4-5 meters results in delayed or dropped signals. This seems to be very dependent on the reciever and its placement:On my computer setup, the small reciever only has a usable range of ~1 meter, while the larger is usable to 4-5 meters depending on line of sight to the keyboard.The minimum amount of PCBs I was allowed to order was 10, so I made a few more controllers. These have the 150mAh batteries from the mini keyboards. Since I have not decided what to do with them, they are not programmed yet and do not have the key row connector soldered.EDIT: None left now and I'm not planning to make more any time soon. It's a nightmare to support all the different matrices.