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. S= o 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 isolate= it (comes from a longish cable), so tied a 10K pup to 5V, and into the PIC= , but also tied a LED to the same signal. >> >> Thought of course is....opto comes on, drives the collector low, turns o= n the LED and PIC sees it. Well the LED does turn on, but the PIC wasnt s= eeing it low. Looking just with a voltmeter, its sitting about 2.4V, so it= s still a high. OK, physics still work. >> >> I changed out the resistor driving the opto's LED from a 2K to a 1K, thi= nking that driving the LED harder will turn on the transistor harder...if i= t 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 and= the LED circuit? The other solution, that Ive done before and probably sh= ould have on this was to put the LED in series with the opto input. signa= l..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 .