I'm in need of tapping a bunch of inputs (at least 15) via a PIC16F877a. The inputs are all ~ 14v. I'm looking for the most compact way to do this and I'm not having a lot of luck. It's to go on a smallish protoboard so I'm trying to optimize space. I've found some quad isolators (PS2501-4) but where wondering if there were any bigger. Tried searching for some, but didn't have any luck. Any recommendations for making it compact as possible? Thanks, -Lee
Can't you do it with a couple of octal darlington ICs (ULN2803)? 14V on the input will pull anything connected to the output down, 2x9 pins long and built-in input resistors. And use a 9-pin SIL 8-resistor package for pull-up on the PIC side? Otherwise I think optoisolators are end-stackable, so 2 quads, 4 duals or 8 singles (in types without base connections) take up the same length on 0.1" proto board.
If I'm understanding you right (I'm not that bright with the electronics yet), that sounds perfect. I was hoping someone would say there was some sort of opto with rails so it would be straight through pin-wise. This sounds pretty much like that what I was hoping for package wise. I'm read through the datasheet and am looking at some example circuits. I think I grok it. So the ULN2803 is inverted output. So when the input is high, it will start sinking current at the output. There's two things I'm not 100% on though. The pullup, is that to keep the pin from floating? (Remember, I'm dumb). If so, what value resistor. 1K? And not so sure what the common line should be hooked up to. I'm guessing the 5v regulated? Thanks for your help. I know I've asked a lot of questions since I've joined. Many of them have been geared towards one project. The digital dashboard for my car, and you've answered most of them and I'm most appreciative. Well I've finally made some real progress. I've got a good deal of the software written, now I need to actually hook into the dummy lights and other indicators. There's a screen shot here if anyone's interested. -Lee
That's it, keeps the PIC pin high (5V) if the input switch is off. Value not too critical, 10k is commonly used AFAIK. I'm no PIC expert. Strictly speaking you don't need to connect V+ to the common pin#10 unless you're switching an inductive load; if you look at the datasheet you'll see how it will put an internal protection diode across each load. But using a 9-pin sip right next-door it's handy to connect the PIC +5V supply line to it.
Sorry, I meant going from the 5v to common. I had seen zeners used in a couple of the examples circuits I found. I guess I should read the datasheet again before I say stupid things. Thanks again.
So the parts get here tomorrow. Does this look ok? The wiring to the pic isn't obviously how it's going to be. Is this on the right track? Thanks, -Lee
There's no point in the zener. ULN2803 pin#10 can be connected straight to the supply line (+5V) or left disconnected with non-inductive loads. When I said, "using a 9-pin sip right next-door it's handy to connect the PIC +5V supply line to it", I was thinking with stripboard you could mount the IC in the next column to the SIP pull-up resistor package to keep board size down, there's no need to break the 5V track in between the two. All pin#10 does is connect a plain rectifier diode (inside the chip) between each output pin and line, i.e., across each load, for back-emf protection. Got a link to an example?
Looks like "belt & braces" design - "The Zener diode is included to protect the ULN2803 against possible damage due to "back emf" voltage spikes that may be produced when relays and motors are used. Generally a 30 volt, 1 watt Zener diode will suffice." A bit OTT IMO for the average small relay.
Thanks. I didn't really think it would do anything in this situation, but wasn't sure. Btw, I sent you a pm if you get a chance, don't know if you're like me, I never notice when I get them here as I so infrequently use them. Hopefully I'll have this in and driving the software this weekend. Thanks again!
Mouser had backordered the uln2803 and they finally came. Worked perfect in the test circuit. Thanks again!