Phototransistor usage.

If I was to use a visible light/infrared/UV sensitive photo transistor with a bright white LED at a separation of 1cm or so, am I likely to run into significant problems with interference by ambient light etc?

It depends on what modulation scheme, signalling or optical shielding you use.

It depends on what modulation scheme, signalling or optical shielding you use.

I read else where that you can get 3 terminal phototransistors such that you can bias the base to compensate for ambient light.

"optical shielding"!! Put them in a tube.

Using base bias to desensitize the phototran requires a higher drive on the optical source. Bit of a waste, but works.
Optical shield, cheap and dirty but also works. A big chear for brute force engineering.

Modulate the source and demodulate at the detector, elegant and efficient, but you have to know a little more about what you are doing and cost more parts.

Based upon your question about biasing the base, I also suggest optical shielding.

Everything 123Splat said.

Plus, if for some reason this cannot use a cover, then I strongly suggest using an IR LED with a carrier signal and a remote control receiver. Match the IR LED modulation to the receiver, so if the receiver is 38kHz, use 38kHz carrier on the IR LED. Modern IR remote control receivers are much more sunlight tolerant than they used to be.

A white LED with an unshielded broad spectrum phototransistor -will- experience interference. Unless you use it in a cave with no other sources of light.

Biasing to counteract ambient light will -not- work. Ambient light changes constantly. Move your hand, it isn't even blocking the light, but ambient light at the sensor will change because you are reflecting the main light sources differently.

Would a photodiode be better?

No. Ambient light is ambient light. Without more information from you on the environment, I have to say no.

As far as an IR remote receiver, they use a photodiode with some internal circuitry to amplify and filter, then demodulate.

A photodiode like that is less sensitive than a phototransistor - so it depends how
much sensitivity you need. The photodiode reverse-biased like that is good for fast
response, phototransistors tend to suffer from sluggish turn-off I believe, but if you
don't require a high bandwidth that is irrelevant.

Try and make sure any lenses on the LED or detector are lined up, as that increases the
signal to noise ratio.

Oh yes, note that fluorescent lights can have a marked flickering that will show up
strongly, whereas tungsten lighting and daylight are pretty much constant.

What about a infrared LED and infrared photodiode/phototransistor? Would they suffer from less interference.

Look all I need it for is POV clock to detect the start position.

Precision is not required.

A Hall Effect and a magnet would be simpler

OK, so this can be fairly well shielded. I'd use a phototransistor with integral IR pass filter (they look black and respond almost entirely to UV) and an IR LED, no modulation.

Wired up something like this, it has enough gain on its own to not require an amplifier:

I usually put the IR LED into a piece of opaque tubing so it doesn't inadvertently allow light in at a strange angle and interfere with the phototransistor.

Or magnet and Hall Effect switch.

I have just been playing around with an IR receiver that I pulled out of a tv set. I put the IR LED from an old tv remote on the output of a 555 running at 38kHz, and my IR receiver has a green LED on its output. This works alright so far.

I suppose I would modulate this carrier wave with another 555, running at a slower speed, controlling an NPN transistor between the IR LED and GND

Running at 38kHz, that would certainly work well with my POV clock with no risk of environmental interference.

Depending on what sort of time span the receiver and IR led remain sufficiently aligned, which will depend on the rortation speed of the POV clock, I might even be able to use it for data transfer as well.

The data sheet says that a the maximum burst length is 1.8ms.

At what maximum frequency can an arduino digital pins read individual highs and lows


So I have an astable 555 running at 38kHz whose output goes to the collector of a BC5498 The emitter of the BC548 goes to the anode of my IR LED.

I could have just as easily done this with a PWM pin of my arduino, but I set up another astable 555 running at a frequency of about 10kHz..

The output of this slower 555 is connected to the base of the BC549 via a 22k resistor. The base is also connected to ground via a 200k resistor. The resistors on the BC548 base represent standard transistor biasing for a max CE current of roughly 20mA.

So my IR receiver is still detecting the signal and turning my green indicator LED on.

So all good so far.

In order to greatly simply data transfer to the arduino controlling the POV clock, I suppose there is no reason why I couldn't connect the output of the IR receiver to one of the analogue pins and read the data as varying voltage levels - I only have really simple data to transfer anyway, e.g. to change among the pre-determined colors of the clock.