Go Down

Topic: iS my photoresistor (LDR) too slow ? || tachometer (Read 4 times) previous topic - next topic


Hi guys

I've been making an optical tachometer,  trouble is it can't seem to read fast RPM's like those of an average motor you get in a starter kit, it can read up to like 3000 RPM, but beyond that it's all over the place

my test motor has a 2 slot circle with an LED shining through onto the LDR, and the motor is powered by battery to rule out interference ( I thought at least :D).  I tried different slot sizes to no avail.
Is my code alright? if so, is there fast and slow LDR's or something?


unsigned long time=0;
unsigned long time2=0;
unsigned long rpm;
unsigned long period;
int counts=0;
int potpin=1;
int motorpin=10;
int motor;
unsigned int runs=0;

void setup(){

void loop(){
  if(runs>2840){   // this no. of runs means it takes exactly 500 millis
    Serial.print(" ");
    Serial.print(" ");
void ping(){



CDS cells are very slow having a maximum speed of around 30 times per second (at best).
Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!


LDR's are inherently slow.  In fact, the slow recovery of an LDR is often exploited as an advantage. (like 250rise to 300fall micro seconds)  which is Damn Slow in my book and not good for anything faster than about 2000 RPM.

So in your case, it's just the wrong part.  You should re-design your solution and consider using a Photo-Diode or a Photo-Transistor.

A photo-transistor traditionally would have higher sensitivity with a trade-off in response time compared to a photo-diode.

Honestly though, a Photo-Transistor should be just fine for what you want.

Example of how one gets used:



guess i'll have to go digging in a radio or something, i'll pst results with a phototransistor

cheers!  a nice karma 4 u :D

wish it was called internets, " i award you +1 internets fine sir "


By the way, where is a good place to dig for a phototransistor?     :smiley-slim:

Go Up