Phototransistor

I would be grateful if someone could tell me how to use a phototransistor in a led circuit. XD

Do you want the LED to illuminate the phototransistor or the phototransistor to drive the LED?

I want the phototransistor to drive the LED.

Well if you look at some of the examples you'll probably find a circuit using an ordinary NPN transistor to drive an LED, and the phototransistor should just replace the transistor. Basically phototransistor emitter to ground, collector to current-limiting resistor for the LED (try 220ohm), other side of resistor to cathode of LED, anode of LED to +5V.

I want the phototransistor to drive the LED.

Tricky because you might not be able to get enough current from the photo transistor to drive the LED.
I assume you want a circuit to light an LED when the photo transistor sees light?

Grumpy_Mike:
I assume you want a circuit to light an LED when the photo transistor sees light?

Yes, i want to light a LED when the photo transistor sees light.

Try this:-

PhotoLED.pdf (21.3 KB)

What is the 100K and the BC108 at the circuit?

What is the 100K

It is a resistor.

the BC108

It is a transistor, but any general purpose NPN transistor will do.

I feel if you have to ask these questions then the project might be beyond you at this stage in your knowledge.

Are you using the photo transistor as on/off only? You may be able to do an analog read from the emitter pin to detect your desired amount of light, then use a separate pin digital pin from the arduino to turn on/off the LED. That would solve your current problem. It would also allow you to adjust the brightness of the LED if you desire by using one of the pwm pins of the arduino to drive the LED. If you're not sure how to do this in detail, and you can't find out by searching, I (and others) would be glad to help. (hint: show some evidence that you have researched/learned something since your last post)