PCB design: China style!

Today I came across a small problem – my brand new USB-UART dongle wasn’t working. It connected to the PC correctly, drivers were installed etc, but the UART side just didn’t work. I have bought a few of these from eBay previously, and usually they work right away, but this time it wasn’t the case.

So I observed the problem: my board started taking more and more current as I sent packets over UART. Than I looked over the board under a microscope, and resoldered the pins. No effect. Than I decided to take the chip off, and see what was under it and there I found the problem. Image below.

The board is based on CP2102 chip, which is in a QFN package, that has a ground pad underneath. And in case you are wondering, these two lines under there are RX and TX, shorted out by the ground pad of course. Chinese engineering at is best. So since I needed the thing to work and decided to fix it. So I took a piece of kapton tape and put it under the chip and resoldered the chip on top of it.

And yes, it worked.


How I fixed the Roccat KONE broken wheel

I have been extremely busy with few projects last couple of months, so I haven’t had the time to post anything. But this will be a guide/summary to how I fixed my broken Roccat KONE scroll wheel.

Breaking of the scroll is a very common problem with the Kone. Mine lasted for about 2 years and when it finally broke, I decided to investigate what’s the problem with the mouse. So here are few pictures of the mouse and what lies inside it.

Now let’s go further: disassembly of the scroll mechanics and finding out what broke.

The final picture shows what’s the cause of the failure. The shaft that connects the scroll wheel and the rotary encoder is only 1.75 mm in diameter. The other reason why it breaks, is the plastic. Classic cheap, glossy, flimsy, fragile plastic used in cheap consumer electronics. I was quite careful while taking it apart, but I still managed to break the plastic in two places while disassembling it. Yes, I wouldn’t have a problem with it if they had used this kind of plastic in a 10€ mouse, but the thing costs about 80€. Cutting costs on the plastics of the scroll wheel? What on earth were they thinking?

So, how to fix this little bugger? Yes, you guessed it: let’s use the magic of 3D printing!
First however, I needed to 3D model the mechanics of the thing. Took me 2 evenings of measuring&modelling and I finally ended up with this.

While doing the model, I was annoyed by the encoder they had chosen for the mouse. It has a hex shaped hole in the middle, so my first idea was to find a hex key, cut and file it a bit and use it as my new encoder shaft. After few minutes I realised the error in my idea. They don’t manufacture hex keys with 1.75 mm diameter, what a disappointment. So I considered milling one out of aluminium or steel, but that seemed an awful lot of trouble and effort. My final solution was to 3D print that also, won’t be that strong and reliable, but will do, at least for a while. They could have used a encoder with a 2 mm shaft hole – this would have added some strength to the shaft itself and would have made the repair process a lot simpler. The encoder itself however, feels nice and robust.

After finishing the model, I ordered the parts from Shapeways and here they are.

I had the parts made out of “Strong & Flexible Plastic” aka PA 2200. The quality was good in general, the parts required some filing and doing, but this was expected, considering the 3D printing technology. I was a bit disappointed by that the scroll wheel was missing the hexagon shaped hole in the middle, there was only a slight couture of it. So to fix this, i grabbed my scalpel and cut the shape out manually under a microscope. Annoying work I have to admit. This maybe wouldn’t have happened if I had the shaft and wheel in one piece. But for the first prototype it felt more reasonable to have them made separately.

After that I had to assemble the mechanics again. Pictures follow.

Assembling the mechanics wasn’t very problematic and all went nicely, Looking at the timestamps on the photos taken, it took me less than half an hour to put the thing together and fit it back inside the mouse. After assembling the mouse once again, came the moment of truth: will it work? The answer is YES and has been working for few months now.

So the verdict.
1) The general structure of the scroll mechanism is not that bad, could be a bit stronger however, considering that this still wants to be a gamer/performance mouse. The shaft that connects the scroll wheel and the encoder is an epic fail, the engineer who designed it – shame on you.
2) The encoder feels nice and robust, as I mentioned earlier, but the 1.75 mm diameter hex hole is a fail in my eyes.
3) The material used for the scroll mechanics sucks. No more comments.
4) The centre button is quite hard to click, this could have been avoided very easily, but it wasn’t. I have clicked the central button <50 times since I bought the mouse, mainly because it requires effort and concentration to press it right. I even considering desoldering the button and buying a button that was easier to click, but couldn’t be bothered.
5) Was the repair worth the time, effort and the money spent? Probably not, but it was a fun hack to do.

I hope that you enjoyed reading this and maybe this will help you repair your mouse. I have also included the 3D models of the mechanics below in SolidWorks and STL formats.

Download HERE!



Some tips on EagleCAD

I’ve been very busy since the start of the year and haven’t managed to post anything new. There will be some posts coming up now though. I received some new PCBs today, will post some pictures and info soon. Also I will be making a post about the stuff that I’ve been working on for the past few months. But more about that when I find some time. Will be awesome, I promise you that.

But now, to the topic on hand. Many people don’t usually use hotkeys, macros, commands etc in the programs they use. Most of the time I don’t either, but given that I use EagleCAD alot, I decided to optimize my workflow. I started out with using the command line input, but after some time it felt kind of slow, so I also made some hotkeys and macros to improve my workflow even further. I have to admit, I was quite surprised how much faster I got my work done. So here is a short overview how I managed that.

Commands I use frequently:
Schematic editor
gr on //displays grid
a //opens component adding menu
v //add value to the component
fr //draw frame
sm //smash
pack //displays the alternative packages menu
er //ERC test
tex //add text

Board editor
gr on //(grid on) displays grid
gr mm //change the grid units to mm
gr a mm //change alternative grid units to mm
gr .2 //change grid size to 0.2 mm
gr a .05 //change alternative grid size to 0.05 mm
pack //displays the alternative packages menu
dr //DRC test
po //polygon tool
c w .3 //change trace width 0.3
c w .2;vi //changes via drill to 0.2 and selects via tool
c is .3 //changes isolation to 0.3
c sto on //changes stop on

And some minimized displaying commands for most used layers
di none //clears all
di v //display Via
di p //display Pads
di u //display Unrouted
di d //display Dimension
di t //display Top
di b //display Bottom
di tor //display tOrigin
di bor //display bOrigin
di td //display tDocu
di bd //display bDocu
di tp //display tPlace
di bp //display bPlace

Useful in both
sh c* //shows everything that starts with the letter c, mostly capacitors. sh r* can be used to show the resistors for example. I suggest you read more about the wildcards in the Eagle manual, very useful stuff
sh @ c23 //shows and draws a box around the C23 capacitor

If you are using the route tool for example, you can change the width of trace by just writing “.3” and it changes the width to 0.3mm, very useful and fast

Hotkeys and macros I use constantly (they can be set under Assign menu):
Schematic editor
Ctrl + Q > move
Ctrl + W > net
Ctrl + E > group
Ctrl + R > show
Ctrl + A > copy
Ctrl + D > delete
Ctrl + F > info
Ctrl + T > name
Ctrl + G > label

Board editor
Ctrl + Q > move
Ctrl + W > route
Ctrl + E > group
Ctrl + R > show
Ctrl + A > copy
Ctrl + D > rip
Ctrl + F > info

F1 > set POLYGON_RATSNEST OFF; rat; SET POLYGON_RATSNEST ON //only calculates the airwires, won’t recalculate the polygons, alot faster on boards with lots of components
F2 > rat

Ctrl + 1 > disp none unrouted dimension vias pads top bottom tplace bplace torigin borigin tdocu bdocu
Ctrl + 2 > disp none unrouted dimension vias pads top tplace torigin tdocu
Ctrl + 3 > disp none unrouted dimension vias pads bottom bplace borigin bdocu
Ctrl + 5 > disp none dimension unrouted vias pads top
Ctrl + 6 > disp none dimension unrouted vias pads bottom

Some useful ULPs
run bom //generates bill of materials

run statistic-brd //lots of stats about the board
run length //calculates the trace lengths
run count //counts drills, pads, vias etc

If you find any mistakes or have some further suggestions, feel free to contact me.


My SMD component library

People seem to like my mobile component library, so I decided to make a post about it in my blog also, maybe someone who likes it also, can build one for him-/herself.

It is a box from the BOX-ALL series by Aidetek. I got mine from eBay for about 30 dollars from http://myworld.ebay.com/smtzone. The box was well packaged in bubble wrap and included labels with adhesive and some kind of cheap tweezers that were kind of useless. About the labels; you can get a .doc template for the labels from Aideteks homepage, but I have to warn you, be very careful when inserting the label page into your printer, mine decided to eat it diagonally and ruined the whole page, also some of the labels got stuck inside the printer. Very annoying. So, my friend who owns the same box, found similar labels and made a new template, and problem solved.

But now to the box itself, it has 144 enclosures, each 18.3 x 16.7 x 10.2 mm in size and the box itself is 229.2 x 156.8 x 37.4 mm, so quite compact I’d say. The build quality is quite good, the plastic outside feels solid and durable, inside the comparment lids feel a bit cheap though and few of the lids don’t want to stay closed, so I improvised a hack to fix the problem; I cut out a piece of paper approximately the size of the box and inserted it between the two sides, since the compartment lids interlock somewhat, the piece of paper improves the locking of the lids.

So what do I keep in my library? Resistors, capacitors and LEDs mostly… Specifically 50 values of 0603 and 0402 resistors, some 0402 and 0603 capacitors for decoupling and bypassing and LEDs for indication, debugging etc.. Where are the components from? I bought 0603 and 0402 resistor kits from eBay for about 13 dollars a kit, LEDs also ordered from eBay and the capacitors  are from Farnell. Capacitors seem to be cheaper in Farnell and if you order X7R than you get X7R. The specific values of the components can be seen on the images. Will probably add some SMD buttons, slide switches and connectors when I get some time…

In conclusion, I have to say that I like the box a lot. It makes assembly/soldering a lot more comfortable and faster, no need to strip the tape of the resistor strip etc. Well worth investment.


ATMEGAxxU4 development board

I needed a small board, I could use to test and prototype things with, so I decided to make such a board.
The question that might arise is, why didn’t you just order something from the wide range of Arduino branded products or a Teensy. First, I don’t like Arduino because it uses a 328 and that chip lacks hardware USB support. So that rules out Arduino. Next, Teensy, I looked at it, and I didn’t like how it was designed: some pins brought out in stupid places, uses more layers than two, has hard to acquire, and annoying to rework (at least in Europe) QFN style ATMEGA, should you kill the one soldered on at the first place etc…

So I what I wanted to achieve
– Components on one side only, so I could also use it as an SMD device
– No more than two layers (easier and cheaper to acquire)
– Decent ground plane with two layers design
– Uses TQFP package ATMEGA (easier to rework and acquire)
– Most of the pins brought out and only on the sides
– Buttons for both Reset and HWB
– LED to indicate that the board has power
– Silkscreen on both sides indicating the pins

So here is what I came up with. This is actually version 2B, I had some version As made, but I unfortunately lost the schematics and board files, so I had to redo the work. But now the revision B is here. I will also add some images of the 2A version boards I ordered and assembled.
Eagle schematic and board included and available for download here


Sample code for the board, blinks the debug LED with 1 second delay
NB! Optimization is required for this code to work!

#define F_CPU 16000000

#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>

int main() {
	// Remove CLKDIV8
	CLKPR = 0x80;
	CLKPR = 0x00;

	// DISABLE JTAG - take control of F port

	// Set PE6 (LED) as output
	DDRE |= _BV(PE6);

	while(1) {
		_delay_ms(1000); // sleep 1 second
		PORTE ^= _BV(PE6); // toggle LED pin


Sample code .c and ready to flash .hex available here



Here I will post info and updates related to my projects or just random (useful?) stuff.