replacing LM317 with LM1117 (or LDI1117-ADU)

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,282
Hey everybody, it's been a while since I've been on the forum, but I've gotten tons of help over the years, and I really appreciate it!

Right now, we've got a problem because we can't seem to find a source of LM317LPK (SOT89-3 package) and we need to order a new batch of boards that rely on them ASAP. It looks like adjustable linear regulators in that package are going away completely, so I know we'll probably have to redesign the board around a different package soon (SOIC probably,) but we are really pressed for time and I'd love to get one last order placed before changing the board layout. I haven't found ANY LM317s or direct equivalents in the SOT89-3 package yet, but I did find the LDI1117, which is a low-dropout linear regulator in the same package, with the same 1.25V reference.

So the question is, can I substitute a Diotec Semiconductor LDI1117-ADU (which appears to be equivalent to an LM1117) in the simple ~10mA current regulator circuit below?
1625850491699.png
The regulation doesn't have to be perfect, it just has to be good enough to keep an opto-isolator input happy. When reading the datasheets, I don't see any examples with the LM1117 being used as a current regulator, although I would assume it works on the same basic principles as the LM317 and can be applied in the same ways. The only reason I'm a little concerned about this is that the recommended input and output capacitor values for the LM1117 (in the voltage-regulator circuit examples) are much, much higher than those for the LM317L, which makes me wonder if it will behave nicely in a super simple current-regulation application with no capacitors on input or output.

Any insights would be greatly appreciated!
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,282
In my earlier attempts, I looked through datasheets for the Diotec Semiconductor LDI1117-ADU, which is the one I hope to use because it's the only part available, and also for the TI LM1117, which the LDI appears to be a copy of. Neither datasheet had example circuits for current regulators, which made me a little suspicious.

This morning I found an On-Semi datasheet for their version of the LM1117, and it has a current source example circuit (finally found one!) It shows a large capacitor on the output when running as a current regulator, which they don't show as a requirement on the current regulator circuit in their LM317L datasheet.

https://www.onsemi.com/pdf/datasheet/lm1117-d.pdf
https://www.onsemi.com/pdf/datasheet/lm317l-d.pdf

1626104870836.png
1626104846701.png
Although I don't understand much of anything about the internal details of IC design, it seems like what little information I can find keeps indicating that the LM1117 needs a big capacitor on its output, even in circuits where the LM317L would not need an output cap, or could use a much smaller one. Based on this, I'm starting to think that the LM1117 (and equivalents) would not be a good substitute in my original circuit (at least not without redesigning the board to add an output cap.)

I'm pretty close to giving up on the idea of using the LM1117 series here, but would appreciate any insights and guidance that you can offer. Thanks!
 

crutschow

Joined Mar 14, 2008
28,227
The LM1117 series does appear to need more output capacitance or than the LM317 so, if that's a problem, then I agree it may not be a good choice for your needs.

But I'm curious.
Why do you need a constant current through an opto isolator?
Does the signal voltage vary so much that you can't use a simple series resistor to control the current?
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,282
The LM1117 series does appear to need more output capacitance or than the LM317 so, if that's a problem, then I agree it may not be a good choice for your needs.

But I'm curious.
Why do you need a constant current through an opto isolator?
Does the signal voltage vary so much that you can't use a simple series resistor to control the current?
That's a very good question, and something I've been wondering about these last few days as well. This is one of several circuits that I sort of inherited. I've made a few connector changes (with corresponding board layout tweaks) and minor BOM substitutions over the last few years, but the basic circuit design had already been in production for 5 years before I got involved with it, and I haven't changed anything in terms of scheme or performance specs so far.

We only ever drive this circuit with a 5VDC signal, so the only deviations it would see are from whatever noise gets picked up on a ~4ft run of 22 gauge wire through a noisy machine (lots of big AC motors and solenoid coils nearby.) I've got to think that C1 soaks up the bulk of any transients and that a constant-current circuit isn't really helping with anything, but I never seriously considered changing the input stage because it was designed by a real electrical engineer and it was never a problem until now (as you may remember, I'm not an electrical engineer, just a hobbyist who's learned just enough to be involved in some cool projects at work.)

Honestly, it really looks to me like the engineer before me already had a sort of "standard" TRIAC-based-SSR circuit in his library and just tweaked it to fit our specific compact enclosure needs. I think the input stage wasn't specifically tailored to our needs, but was just copied from circuits he'd already used elsewhere.

I am pretty tempted to just replace the constant current circuit with a simple resistor.
 

crutschow

Joined Mar 14, 2008
28,227
I am pretty tempted to just replace the constant current circuit with a simple resistor.
I see no problem with that.
If concerned about noise, just add a capacitor to ground after the series resistor to the opto.
It can be large if you aren't particularly concerned about response time (it would be approximately the RC time-constant).
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,282
I see no problem with that.
If concerned about noise, just add a capacitor to ground after the series resistor to the opto.
It can be large if you aren't particularly concerned about response time (it would be approximately the RC time-constant).
Yeah, I think that's probably the way to go.

I was only trying to shoe-horn in the 1117 in order to buy time before doing a re-design... but if I have to do a re-design anyway because that part won't work, then I'm free to play around with a simpler input stage.

Honestly, I'd even wondered if there was a shunt, SMD diode, or some other oddity in an SOT-89-3 package that I could put in place of the 317 so that we could get this next batch of production done using the simple resistor concept, but without needing a new board layout (and new stencils, etc.) quite yet. Much easier to just make a BOM change today and then have a few months to get a new board layout verified and prepped before it's time for the next order.
 

crutschow

Joined Mar 14, 2008
28,227
I'd even wondered if there was a shunt, SMD diode, or some other oddity in an SOT-89-3 package that I could put in place of the 317 so that we could get this next batch of production done using the simple resistor concept
Since you would not be using the LM317 and its associated parts, just put a wire jumper from the IN to OUT vias of the LM317 and use R1 (different value of course) as the current-limit resistor.
 

Ian0

Joined Aug 7, 2020
3,785
some other oddity in an SOT-89-3 package that I could put in place of the 317
Try a P-channel MOSFET such as PCP1302. You would end up with the source connected to V+ and the drain to the resistor, both of which are correct. The gate would be connected to the anode of the LED, making it 1.2V above the -ve supply, or 3.1V below the positive supply (allowing 0.7V for the 1N4148), which should be enough to switch it ON.
It should be enough to puzzle anyone thinking of copying it!
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,282
Try a P-channel MOSFET such as PCP1302. You would end up with the source connected to V+ and the drain to the resistor, both of which are correct. The gate would be connected to the anode of the LED, making it 1.2V above the -ve supply, or 3.1V below the positive supply (allowing 0.7V for the 1N4148), which should be enough to switch it ON.
It should be enough to puzzle anyone thinking of copying it!
Thanks - I love creative thinking like this. Exactly the sort of thing I had in mind, but I hadn't worked out a way to do it yet. The standard SOT 89-3 part would be easier on the pick-and-place machines than trying to put some other component (resistor, wire jumper, etc) on those pads, and the inexplicable mystery for anyone trying to copy the circuit just the icing on the cake!
 
Top