10000rpm tachometer with photoresistor-possible?

I am making this to measure RPM of a brushless DC motor. I need it to be able to read up to 10K rpm, using a LED and photoresistor/phototransistor. Is this possible? The frequency of the input will be up to 400hz, as the propeller is 2-bladed. I have also considered using the reflection of the motor bell. A hall-effect sensor won't work. Any ideas? At this point, I have code that works up to 3000rpm, which may be a limitation of the photoresistor.
Thanks!

Not possible with a photoresistor. But the phototransistor should be able to do it. You will probably need to bias it correctly, connecting other components to the third leg which is usually left unconnected. The datasheet should tell you what to do.

OK, thanks!
As of right now, I have managed to get up to 4500 rpm with the LED blinking to simulate interruption.
EDIT Now 14640 RPM!
Problem (apparently) solved.

Much simpler to read the signal since you should already know what the motor will do.
Like, if pushing a gas pedal moves a car, you're choosing to measure the car instead of measuring the gas pedal.

I am measuring thrust and RPM with different props, not measuring the throttle setting.

Can you share the code? I need something similar

OK, here it is at this point:

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
// SCK is LCD serial clock (SCLK) - this is pin 13 on Arduino Uno
// MOSI is LCD DIN - this is pin 11 on an Arduino Uno
// pin 5 - Data/Command select (D/C)
// pin 4 - LCD chip select (CS)
// pin 3 - LCD reset (RST)
Adafruit_PCD8544 display = Adafruit_PCD8544(5, 4, 3);

// read RPM
long half_revolutions = 0;
long rpm = 0;
unsigned long lastmillis = 0;
void setup() {
  pinMode(2, INPUT_PULLUP);
  display.begin();
  display.setContrast(50);
  Serial.begin(115200);
  display.display();
  attachInterrupt(0, rpm_fan, FALLING);
  display.clearDisplay();
  pinMode(A5, OUTPUT);
}
byte delaytime = 2;
void loop() {
  unsigned long millisnow = millis();
  if (millisnow - lastmillis >= 1000) { //Uptade every one second, this will be equal to reading frecuency (Hz).
    detachInterrupt(0);//Disable interrupt when calculating
    rpm = half_revolutions * 30; // Convert frequency to RPM, note: this works for one interruption per full rotation. For two interrups per full rotation use half_revolutions * 30.
    Serial.print("RPM =\t"); //print the word "RPM" and tab.
    Serial.print(rpm); // print the rpm value.
    Serial.print("\t Hz=\t"); //print the word "Hz".
    Serial.println(half_revolutions); //print revolutions per second or Hz.

    display.clearDisplay();
    display.setTextSize(2);
    display.setTextColor(BLACK);
    display.setCursor(0, 0);
    display.print(rpm);
    display.println(" RPM");
    //display.display();
    half_revolutions = 0; // Restart the RPM counter
    lastmillis = millis(); // Update lasmillis
    attachInterrupt(0, rpm_fan, FALLING); //enable interrupt
    //blinkalot();
  }
}
// this code will be executed every time the interrupt 0 (pin2) gets low.
void rpm_fan() {
  half_revolutions++;
}

There are sparse comments, and it has provision for output to a Nokia 5110 screen. Remove that if you want.
I don't know where I got most of it. I wrote about 1/2 of it.

You know what, the photoresistor only works at about 1" away. What is a good phototransistor for this? I am using a red LED.

Thank you. You can look for "IR Obstacle Modules" on Ebay. They have both a receiver and an emitter as well as a calibration pot.

I just managed to get about 5000 RPM using a piece of electrical tape on the motor bell. The problem is the motor becomes unbalanced.

So put a piece of black tape on one half and white tape on the other half.

Teflon tape?
The real problem is that it doesn't work past about 5000 RPM. And it isn't the code's fault. Any input on a phototransistor to use?

Will this work? datasheet
It is a IR LED combined with a phototransistor, with Schmitt trigger output. 5mm sensing distance :confused:
It has a response time of 20us, which should be OK. I am using a falling-edge interrupt.
Thanks!