Fan RPM detection issue

ok, the picture of the connection and the "circuit" below.
If the horrible sketch wouldnt be enough, let me know, I will redraw it.
The FAN connection is at the top left, inside the terminal. I use a 12V source for the FAN and a down step to 5,1V for the Arduino.

PS: Some of the parts on the board are not connected, I have tried them but since they wasn't working I kept them unconnected.