How to stop EMI from a pwm-fan

This is a weird fan, this guy has exactly the same fan as me (all numbers the same) and he claims it works fine when he uses the yellow wire as pwm-wire.

Another website says it has automatic speedcontrol....well it all goes beyond my hat.

've made such a small set of furniture. This is a server cooling turbine, while arduino is acting as a speed controller by generating a PWM signal.
PWM control works fine. Turbine can not slow down to zero because it has its own electronics - soft-start system.
PROBLEM: The blue wire seems to generate a rotary signal, I connected it as instructed in one of the tutorials. Theoretically, but the faster the turbine works, the more unreliable the value is. At maximum speed there is something hanging at a constant value of about 1500 (but what I do not know).
For me it is strange that at the window counting for about 0.5s gives almost 5000 pulses .. How is it possible at all? It seems to me that the speed sensor in this turbine is something other than the Hall sensor in general. Of course, documentation of this exact version of the turbine I did not find, so I'm a little wandering around: P.

Turbine: Delta Electronics BFB1012VH-5D84

Picture of its and schematic in the attachments. The blue circuit is just this sensor cable. Yellow is PWM.

#include <Wire.h>
#include <TimerOne.h>
#include <LiquidCrystal_I2C.h> // pobrany lib od I2C

#define btnUp 4
#define btnDown 5
#define ctrlPwm 3
#define sensePin 2

// LCD na 0x3F
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6 ,7, 3, POSITIVE);

// speed
unsigned int ctrl;
unsigned int pwm;
unsigned int rpm;
unsigned int counts;

void licznik() {
counts++;
}

void pomiarRPM() {
Timer1.detachInterrupt();
rpm = counts;
counts=0;
Timer1.attachInterrupt(pomiarRPM);
}

void bar() {
switch (ctrl){
case 1:
lcd.setCursor(5,0);
lcd.print("[ ]");
break;
case 2:
lcd.print("[# ]");
break;
case 3:
lcd.print("[## ]");
break;
case 4:
lcd.print("[### ]");
break;
case 5:
lcd.print("[#### ]");
break;
case 6:
lcd.print("[##### ]");
break;
case 7:
lcd.print("[###### ]");
break;
case 8:
lcd.print("[####### ]");
break;
case 9:
lcd.print("[######## ]");
break;
case 10:
lcd.print("[#########]");
break;
}
}

void sterowanie() {
while(digitalRead(btnUp) == LOW){
if(ctrl < 10){
ctrl++;
lcd.setCursor(5,0);
bar();
delay(200);
} else {
lcd.setCursor(5,0);
lcd.print("[ - MAX - ]");
delay(200);
}
}
while(digitalRead(btnDown) == LOW){
if(ctrl > 1){
--ctrl;
lcd.setCursor(5,0);
bar();
delay(200);
} else {
lcd.setCursor(5,0);
lcd.print("[ - MIN - ]");
delay(200);
}
}
}

void regulacja() {
unsigned int spd;
spd = ctrl*20+55;
// sprawdzenie czy za wolno
if(pwm < spd){
for (pwm; pwm < spd; pwm++) {
analogWrite(ctrlPwm, pwm);
delay(50);
lcd.setCursor(3,1);
lcd.print((pwm/10)*4);
lcd.print("%");
}
} else {
}
// sprawdzenie czy za szybko
if(pwm > spd){
for (pwm; pwm > spd; --pwm) {
analogWrite(ctrlPwm, pwm);
delay(50);
lcd.setCursor(3,1);
lcd.print((pwm/10)*4);
lcd.print("%");
}
} else {
}
lcd.clear();
}

void setup() {
// sterowanie (przyciski)
pinMode(btnUp, INPUT_PULLUP);
pinMode(btnDown, INPUT_PULLUP);
pinMode(ctrlPwm, OUTPUT);
// pomiar
pinMode(sensePin, INPUT);
Timer1.initialize(500000); // 0,5 sekund
attachInterrupt(digitalPinToInterrupt(sensePin), licznik, RISING);
Timer1.attachInterrupt(pomiarRPM);
// reset zmiennych
ctrl = 1;
pwm = 0;
// wyswietlacz
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("REG: ");
lcd.setCursor(0,1);
lcd.print("P: ");
lcd.setCursor(8,1);
lcd.print("R: ");
}

void loop() {
unsigned int spd;
spd = ctrl*20+55;
// czytanie przyciskow
sterowanie();
// uruchomienie
if(pwm == 0){
analogWrite(ctrlPwm, 75);
pwm = 75;
} else {
}
// sprawdzanie
if(pwm != spd){
regulacja();
} else {
lcd.setCursor(0,0);
lcd.print("REG: ");
bar();
lcd.setCursor(0,1);
lcd.print("P: ");
lcd.print((pwm/10)*4);
lcd.print("%");
}
lcd.setCursor(8,1);
lcd.print("R: ");
lcd.print(rpm);
delay(25);
//koniec
}