I wanted to add internal bluetooth to my tablet PC, so I took a USB bluetooth dongle and shoehorned it into my tablet; adding a little control PCB to allow it to be turned on and off.
Firstly I looked at the current consumption of the dongle, as I was wondering whether to bother to add a power switch of some sort. I desoldered the USB plug with my hot air reflow tool (could have used my soldering iron, of course, but to a man with a new hammer everything looks like a nail).
I reattached the plug with wires so I could add a multimeter in series with the USB power line.
It used about 50mA when idle! I desoldered the LED, but that only used about 10mA of course. When transmitting it went up to around 140mA. 40mA is, arguably, fairly insignificant when compared to the rest of the hardware (and 10Ah battery!), but I still found it quite offensive. A power switch was required.
I didn't want to destroy the cosmetics by adding an external switch, so I had to make use of the existing tablet buttons. There are 9 buttons on it, but all except the wifi button do something immediately when pressed. The wifi button turns the wifi on and off, but must be held down for a few seconds. So I considered turning on the bluetooth with a tap of the wifi button, leaving the wifi-switching functionality intact. A more elegant solution, however, was to use the Fn button somehow. Pressing the function button in combination with each of the other buttons activates some secondary feature, with the exception of the power and wifi buttons. Some of these features are useful, and others can be reassigned in software, so I wanted to leave them alone. So I decided to have Fn+Wifi toggle the power to the bluetooth module. This made sense to me, because both of the radio devices would share a switch!
I knew I had an extra USB port because there is an optional docking station that includes some USB devices, so I dismantled the tablet to look for it, investigate the operation of the buttons, and find a spare space for the dongle to occupy. I carefully removed the "tamper proof" Warranty Void if Removed stickers, so that I can desolder my bluetooth mod and return it to the manufacturer if my tablet ever breaks! These stickers are easily (but slowly) removed by applying lots of petrol and very gentle peeling. I found that a hypodermic syringe full of lighter fluid (petrol, basically) and a Stanley knife blade worked well. Hypodermic needles are available for free from pharmacies (at least in the UK), so that drug addicts needn't use dirty needles. They even supply sterile citric acid and spoon-replacements for safely cooking up your heroin!
Nicely tampered with, but with none of the "void void void" intruder detection! I stuck them onto some sticker backing material. My tablet had been dismantled once before, and I had done the same thing. It developed a fault and I sent it back, stickers-reattached, and Electrovaya didn't say anything! They look slightly strange in this photo, but they really are perfect.
Hunting down the USB connections was pretty tricky. Ground connections abound, of course, and a suitable 5V supply could be found by poking around likely looking chunky tracks with the multimeter in continuity mode and the other probe connected to another USB port's 5V connection. I realise that sucking power from another port isn't ideal, but it was really the only option, short of living in some fantasy dreamworld where manufacturers are actually nice to people. The multilayer board was really far too complex to find anything by following traces. I soldered on temporary power and ground connections, and poked around the docking station connector with wires soldered to the D+ and D- pads on the BT module. This was quite intersting, it seems that USB goes into some kind of "device not working properly" mode when just the D- connection is made. Windows pops up a little box to tell you so (I appologise for my use of Windows here, but I'm really stuck with it on my tablet until someone writes some decent handwriting recognition software for Linux. I now dual boot FC6). Once the D- connection was made, I poked around with the D+ connection until the device enumerated correctly. I didn't take any photos at this stage, because poking around with the wires and clicking on things occupied quite a lot of hands. Rob helped here, thanks Rob.
Once the BT module enumerated correctly, I worked out the simplest way to turn if on and off. Breaking and making the ground connection didn't work, as the device then failed to enumerate properly when reconnected. Breaking and making the +5V rail with D+, D- and ground all connected worked reliably. I therefore needed to use a p-channel FET as the switch.
Next I hunted down the switch connections. I removed the board to see how it worked, but I didn't really need to, I should have just looked at the voltages on the connector pins.
Each button simply grounds one of the pins on the connector. They must be pulled high on the motherboard. I found the two pins responsible for the wifi and Fn buttons, and measured the signals to be 5V, and active low. So I designed a simple circuit with a dual switch debouncer to clean up the switch signals, a tiny logic NOR gate to produce the AND behaviour (because a NOR with inverted inputs is an AND), a D-type latch to generate the latching function, and a p-channel fet to do the switching. I knocked it up in eagle, and produced a little PCB layout.
The NOR gate has a funky symbol because it is actually a TI 74LVC1G57 "Multi-configurable gate", which does different things depending on which pins are connected high, low, or to other pins. I didn't have a tiny logic NOR gate to hand. Note I read the datasheet wrong, and ended up modding the PCB! The schematic is still wrong, so don't go and build it! I also drew funky hourglass symbols for the switch debouncers. Also note the RC network on the Preset pin of the 7474. It is there to set the output high just after the circuit is powered up. This way the tablet powers up with the bluetooth switched off, rather than in an undefined state. Time constant is not critical, just a few ms. The pull-up on the FET is not really required, just added instinctively. Unused inputs on the other half of the 7474 are tied high. C2 and C3 are decoupling caps.
Here's the PCB layout.
I etched it by my standard photolithographic means, along side some of Xbee test adapters for Rob. I made two copies just in case.
Here's the finished board, cut out and resist-stripped, with the bluetooth adapter. Isn't it embarrasing that my ridiculously simple board is about the same size?! One day...
The sharpest readers may have noticed that's not the same bluetooth module I had at the start. The first one was too cheap to work properly in Windows. Works fine in Linux, so I reassembled it for use with my laptop.
I populated the board. See the flickr set for more details, and more on the PCB etching process too. I didn't have any solder paste, so I assembled it with a soldering iron. I did solder on a couple of components by tinning the pads and reflowing with the hot air tool because it was brand new and I wanted to know what it was like! It's worth noting that there's little you can do with a hot air tool that can't be done with more patience with a soldering iron. With the exception of BGAs, of course, and desoldering very large, fiddly things. I drilled a couple of holes to allow for wires to the existing mechanical support holes in the BT module.
I soldered the bluetooth module directly to the board. I had intended to mount the bluetooth module up the other way, but I accidentally mirrored the layout of the connector! It worked out well though, with small bits of wire bridging the solder joints (not visible, embedded in the blobs).
I soldered on some temporary connections, and hooked it up to a breaboard to test it because, as we know, the simplest of PCBs don't work first time. The LED was connected in parallel with the BT module, to indicate it's power status. The flying wires and pullup resistors are emulating the buttons.
This, the simplest PCB in the world, didn't work first time. I had the multiconfigurable gate configured incorrectly, as described above! Kynar wire to the rescue (blue, on the left).
I replaced the chunky temporary breadboard wire with nice, thin kynar wire. I twisted the D+ and D- leads together for some noise immunity, reasoning that it would help since USB is differential. Does it help? Who knows.
Then I began soldering stuff to the motherboard. Feel the freedom of modding, comrades!
Tinning the button connections
Soldering the USB connections to the docking station connector
All the connections made, I temporarily taped it down and tested it at this stage. Sure enough, pressing Fn+Wifi resulted in a nice windowsy "pong-ping!" sound and a new hardware pop-up! Another press led to a nice "ping-pong". I neglected to photograph it, because I'm an idiot. Watch the video at the bottom instead.
I added some heatshrink, and tucked it away in a corner. I checked the corner was roomy enough first by adding a little column of blu tack, screwing the case together to squash it, and measuring its final height.
I reassembled the case, and tested the range. It was a rather disappointing 30mm or so, and only from the back of the tablet! I was both surprised and not surprised. People have done it successfully on other laptops without offering any sacrifices to the easily-angered RF gods, but it's a pretty much perfect Faraday cage!
So I decided to sacrifice my auxilliary wifi antenna and connect it to the bluetooth module in place of its weedy chip antenna.
I desoldered a UFL connector from an old wifi module (thanks Justyn!) and added it to the BT module:
Fortunately it just fitted at that jaunty angle without my having to extend the antenna connection.
The range is now excellent - a good few metres. Wifi performance doesn't seem to have degraded noticeably. This is possibly because the antennas are orthogonally placed for use in portrait and landscape modes, and I pretty much always use my tablet portrait. Who knows, wifi is essentially witchcraft. One day I would like to add an external antenna socket to extend wifi range in times of need. Early experiments with a 7dBi antenna on a UFL pigtail seemed to improve perfomance quite impressively.
Here's a really exciting video
As per Electrical Idiot's request below, I have created an alternative, single input, schematic
It has just one switch input which toggles the power when the switch input goes high. Note that this is just one of many ways to build this circuit. The original one was made to be as compact as possible with the parts I had to hand. As long as you have something to debounce the switch (this may even be included on your laptop motherboard if you poke around), some kind of latch to toggle the power, and a P-channel FET with a fairly low Rds(on) at -5V gate-source voltage, then you're set. I like the Maxim range of debouncers, but if you can't get hold of them you could use a schmitt-RC combo, or even a small microcontroller if you really want.
categories [ ]