Connect the pin of the PIC together with the LED's cathode and the pull-up resistor to the photo-transistors's collector. The photo-transistor's emitter connects to GND. The other terminal of the pull-up resistor obviously connects to VCC. Put a current-limiting resistor in series with the anode of the LED to VCC also. With this arrangement there is no voltage divider. Of course the current flowing in parallel through both the pull-up resistor and the LED must be lower than the current that the photo-transistor is able to sink. Isaac Em 29/3/2013 14:37, Neil escreveu: > So with the transistor off, yes you have a voltage divider... 5V to=20 > R-pullup to R-led to LED. Knowing the LED voltage, you can calculate the= =20 > voltage at the R-pullup to R-led junction, which is what the PIC gets. =20 > You should be able to lower R-pullup and raise R-led to change that=20 > voltage. Or switch the LED via a transistor. If you need it for the=20 > final circuit, why not run it from another PIC output? > > Cheers, > -Neil. > > > On 3/29/2013 1:00 PM, alan smith wrote: >> The other LED is on the collector of the opto, with a resistor to +5V. = So normally the LED is biased off with the 10K pup, and when its grounded..= ..turns on obviously. Sorry if that wasnt clear the first time. >> >> >> >> >> ----- Original Message ----- >> From: Neil >> To: piclist@mit.edu >> Cc: >> Sent: Friday, March 29, 2013 10:42 AM >> Subject: Re: [EE] opto driving LED and PIC input >> >> Confused about your circuit... 12V sig goes to opto LED, via a 2k >> resistor. Opto output collector has pullup to 5V and also goes to PIC >> input. Opto output emitter to ground. But where is the extra LED? At >> the opto output? If so, does it have its own resistor? >> >> Cheers, >> -Neil. >> >> >> On 3/29/2013 11:29 AM, alan smith wrote: >>> I have a 12V signal coming into a board, so I'm using an opto to isolat= e it (comes from a longish cable), so tied a 10K pup to 5V, and into the PI= C, but also tied a LED to the same signal. >>> >>> Thought of course is....opto comes on, drives the collector low, turns = on the LED and PIC sees it. Well the LED does turn on, but the PIC wasnt = seeing it low. Looking just with a voltmeter, its sitting about 2.4V, so i= ts still a high. OK, physics still work. >>> >>> I changed out the resistor driving the opto's LED from a 2K to a 1K, th= inking that driving the LED harder will turn on the transistor harder...if = it wasn't fully saturated then its possible it can't drive all the way low.= No change. Did a really quick LTspice, and it simulates the way I expect= ....goes to ground. >>> >>> >>> But now I'm thinking we might have a voltage divider between the pup an= d the LED circuit? The other solution, that Ive done before and probably s= hould have on this was to put the LED in series with the opto input. sign= al..resistor....LED.....opto's LED....ground. >>> >>> Just wondering what I can do with the existing circuit >>> >>> --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .