Phototransistor problem when using long cable.

Hi everybody,

i have made a rpm counter with a tcst2103 light sensor.
It is connected to an arduino interrupt via a 10k pullup.
Everything is working fine but if i use a long (<20cm) cable to connect the sensor
then i get very high rpm counts.
My levels are still good. Low 0,65V and High 4,81V
I have tried different pullup values but this did not help.
What could be the problem?
Is it possible that there are such high interferences even with a shielded cable?
Unfortunately i dont have an oscilloscope for measuring the signal.
Any help is welcome!

Best regards
Marxon

I would drive it with IF=17mA (use 220 ohm series resistor for the LED), then use 4.7K from emitter to GND in the transistor circuit (collector connected to 5V). This will give a stronger signal. With these connections, try using "RISING" if using interrupts. If noise persists, try a 1K-10K series resistor to the input. If noise still persists, loose the series resistor and connect a 0.01µF capacitor from the input to GND.

Hi dlloyd,

thanks for your help!
I will try your suggestions.
Did you mean it like this schematic?

What kind of capacitor should i use?

Marxon

Yes...looks good...except the 220 ohm is controlled by the Arduino.

Hi again,

i connected everything like you said

  • 4.7K from emitter to GND
  • collector connected to 5V

But I allways get 5V.
No matter if i

try a 1K-10K series resistor to the input

or

loose the series resistor and connect a 0.01µF capacitor from the input to GND.

Are your sure that the transistor collector should be connected directly to 5V?

Sorry, I was rushed and didn't answer correctly. Away from my pc ... I suggest using your original circuit and add the 10nF from the Arduino input to GND.