Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Have a TIL 78 photo transistor toggle PICs input pin

Status
Not open for further replies.

bpmelo

New Member
Hi guys, I'm having a hard time figuring out how to use a TIL 32 (IR emissor diode) and a TIL 78 (IR phototransistor) to just toggle on and off a port in PIC.

The chip I'm working on is a 16f877, and I building some sort of telemetric hardware for my R/C 1:10 car (nice !!)

I have all sorts of things working on this chip already, like USART (wireless communication) , A/D (for the engine temp) and a LCD attached to it.

I can't figure out what's needed for this TIL 78 to work as a switch when pointing to the IR emissor, TIL 32, I have the feeling I'm just missing a couple of pull down or up resistors.

The actual usage of this will be like a RPM counter, so all it needs is to trigger the port on and off. (it will be the exact system used on those old ball mouses)

Quick questions :

1. Can I setup the port as digital input or should I use analog insted ?
2. Both pieces are made from translucid plastic, both have two legs only, like any LED, and one has bigger legs than the other, so I'm guessing the TIL 78 is the one with the longer legs :)

Thank you all for your help.
 
The phototransistor conducts current when it sees light (so you will need to shade it from ambient light and/or use a dark red filter in front of it). You connect it with the transistor emitter to ground and a resistor from the collector to +5V. Also connect the collector to the PIC input (set for digital input).

The value of the resistor will determine the sensitivity, a larger resistor making it more sensitive. The resistor can vary from about 1k ohm to 50k ohm depending upon your sensitivity requirements.

With this setup the PIC input will be low (logic 0) when the phototransistor is being lit.

Sorry, I don't have any info on the devices so can't help you with identifying them. You'll need to see if you can find a data sheet.
 
I can't figure out what's needed for this TIL 78 to work as a switch when pointing to the IR emissor, TIL 32, I have the feeling I'm just missing a couple of pull down or up resistors.

I just built an IR repeater yesterday and I was having trouble with the phototransistor.

This diagram I found may help you test the phototransistor or troubleshoot.

Good Luck
 

Attachments

  • remote tester.GIF
    remote tester.GIF
    4.3 KB · Views: 6,345
The phototransistor conducts current when it sees light (so you will need to shade it from ambient light and/or use a dark red filter in front of it). You connect it with the transistor emitter to ground and a resistor from the collector to +5V. Also connect the collector to the PIC input (set for digital input).

The value of the resistor will determine the sensitivity, a larger resistor making it more sensitive. The resistor can vary from about 1k ohm to 50k ohm depending upon your sensitivity requirements.

With this setup the PIC input will be low (logic 0) when the phototransistor is being lit.

Sorry, I don't have any info on the devices so can't help you with identifying them. You'll need to see if you can find a data sheet.

Hello crutschow, thanks for the quick reply on the topic, I tried your ideas, basically I had this setup already in place, except for the resistor, which I was using a 10k one and changed it for a 1k.
Nevertheless, it didn't work, I probably just ruined the transistor by trying all possible setups, so I'm going to buy some new ones tomorrow and try them out.

So, since I'm going shopping tomorrow anyway, does anyone have an idea if this approach is efficient and valid ? To use IR emitter diode and a IR phototransistor for RPM counting ?

If not, what other approaches I'm looking for ?
 
The following circuit will produce very little gain as the load is in the emitter and the transistor is classified as an emitter-follower.
If the load is placed in the collector, the LED will illuminate brighter and the circuit will be more sensitive.
remote-tester-gif.26541
 
Last edited:
Finally I managed to get the TIL 78 photo transistor working as a ON/OFF switch, the problem is actually on the TIL 32, which should be a IR LED but it's not working, so I tried one that I got from an old TV remote and BANG !! It worked, now I can see the port state changing from 1 to 0 when I place a paper between the two LEDs.

The current setup is a 10k resistor pulling up (+5v) the TIL 78 and a 1k resistor on the IR LED, worked perfectly.

I have a new challenge now, get the TWS-434 and RWS-434 RF modules working, but I will create a new topic for it, thanks for the help guys.
 
Status
Not open for further replies.

Latest threads

Back
Top