Urgent Help Needed: DC Motor Speed (in RPM) Control Using Arduino

by the way, I use this formula in measuring the RPM. I do not use any sensor but I use the DC Gear Motor Encoder itself with 12V and 24 ppr with arduino

With the provided schematic above, I am wondering is it correct or weird that the measurement of RPM is in thousand?

So are you using REAL hardware, or just simulating?

finally we are getting SOME useful information.

you are counting pulses in a 1 second ""timeInterval", using an interrupt.
So rps = pps /24 and rpm = 60 * pps /24

Well that depends how fast your motor is turning.

I'd put a serial print in calculateRPM() to show the values.