Close

PCB revision 2

A project log for Hidden HID: an almost invisible Bad USB

maybe the worlds smallest (and least practical!) rubber ducky

emmaEmma 11/28/2024 at 17:380 Comments
3D model of PCB revision 2; bottom side. The three test pads at the front are the GND, BOOT0 and 3V3 pins respectively
Schematic of PCB revision 2

While testing the first PCB revision, I identified a number of issues which I intend to improve in a second hardware revision. 

  1. The current version is very irritating to program. Due to the tiny size there was no room for any kind of connector or even a simple pin header. Instead, I simply routed the SWD and power pins to SMD test points with a diameter of 1mm. To program, I must then painstakingly attach the ST-Link programmer using magnet wire soldered to the test points, which then needs to be removed again to test the new application. This is ok if the device only needs to be programmed once, however flexible and easy reprogramming is a fundamental requirement of a USB rubber ducky.

    I had originally intended to solve this problem by writing a USB bootloader, but have since discarded this approach in favour of utilizing the preprogrammed ST USB bootloader. This has the advantage that I do not need to dedicate valuable program memory to my own bootloader. Furthermore, as the ST bootloader comes preprogrammed, I do not need the SWD interface at all, not even for initial bootloader programming. This allows me to simplify the layout considerably as the SWD pins no longer need to be routed to test points. The bootloader can be selected by tieing just one pin, BOOT0, high, and the PCB can then be programmed the same way it is used; by sticking it in the USB port.

  2.  The USB connection is unreliable. 9 times out of 10 the device makes contact with the USB port and everything works fine. Unfortunately, sometimes the board tilts very slightly to one side, leaving one or more USB contacts unconnected. I believe this is due to the fact that I soldered the spacer LEDs myself, as opposed to leaving it to the PCB assembler, and had uneven numbers of LEDs on each side, resulting in a slight height discrepancy. Now that I have established the optimal LED positions, I can try 2 LEDs on each side, adjust the layout accordingly and have them soldered by PCBWay, who will surely do a better job ;) 
  3. As previously mentioned, I would like to implement a simple remote on/off control by replacing the LEDs with IR phototransistors. I chose to replace all LEDs with the 1541201NC3060 phototransistor from Würth, which is a similar size and height. With the SWD test points removed, I had a little more routing space to play with and was able to route the collectors of 2 of these phototransistors to an ADC pin. The other two remain simple unconnected mechanical components as I found no way to route them to the pin. This part of the circuit is untested; hopefully it will be sensitive enough

I have implemented these changes in the schematic and layout and sent the gerbers off to PCBWay for manufacturing and assembly. Now I just need to sit back and wait until they arrive :)

Discussions