Author Topic: LM317 Questions  (Read 3189 times)

0 Members and 1 Guest are viewing this topic.

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
LM317 Questions
« on: March 19, 2022, 10:14:41 pm »
Hello all, I am working on a project with an LM317 regulator. I am using the LM317 to take 12Vin and get 3.3Vout. I used an online calc to determine the resistor sizes but bumped the 1uF cap to 10uF because I had 10uF caps around, and was told this was ok. My problem is, I am only getting 2.1Vout instead of 3.3Vout.

Why is my output lower than expecteed? Is this related to the higher uF cap? If so, can I adjust resistors as needed to achieve 3.3Vout?
Another question, I was not planning to use a heat sink for the LM317, should I? As mentioned I am using the regulator to bring my 12V to 3.3V, but I am only using this 3.3V to activate a relay. The LM317 doesn't seem to be heating up, however, I don't know how it would react when running 24/7.

Please let me know what kind of questions come up. I appreciate any help and thank everyone in advance.
[ Specified attachment is not available ]
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: au
Re: LM317 Questions
« Reply #1 on: March 19, 2022, 10:18:39 pm »
You need to swap the position of R1 and R2.  :)
 
The following users thanked this post: Jbouss

Offline tunk

  • Frequent Contributor
  • **
  • Posts: 981
  • Country: no
Re: LM317 Questions
« Reply #2 on: March 19, 2022, 10:32:28 pm »
And I think you have to connect 3.3VO+ directly to the LM317 OUTPUT, not through the resistor.
 
The following users thanked this post: free_electron, Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #3 on: March 19, 2022, 10:43:53 pm »
There is something wrong with my schematic too, when I switch my resistors to the right place, I only get 0.7V.
 

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #4 on: March 19, 2022, 10:45:02 pm »
If I take my 3.3Vout direct to +, where do I connect the resistor?
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: LM317 Questions
« Reply #5 on: March 19, 2022, 10:59:25 pm »
fix schematic.

 
The following users thanked this post: Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #6 on: March 19, 2022, 11:14:54 pm »
Thank you langwadt!
That was it, 3.3 out:)

Any feedback on the heat sink will be appreciated as well. Do I need to add a heat sink or will it be ok without it?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: LM317 Questions
« Reply #7 on: March 19, 2022, 11:49:33 pm »
Impossible to tell.  A TO-220 package in free air is generally reckoned (rule of thumb) to be good for about 1W dissipation in a 'shirtsleeve' environment.   Your regulator will be dropping 8.7V, so if your load averages over 110mA, it will most likely overheat without a heatsink.  Detailed thermal characteristics should be in your LM317 datasheet so if you've got the max. ambient temperature, and know the max. input voltage and output current, the need for a heatsink (and if needed, how good it must be) can be calculated.

N.B. Unless you can guarantee your 3.3V load *ALWAYS* draws over 6mA, your R1 should be reduced to 120 ohms (and R2 in proportion) to meet the LM317 worst case min. load current requirement of 10mA.  Failure to meet the min. load current requirement can result in loss of regulation and overvoltaging your load.
 
The following users thanked this post: Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #8 on: March 20, 2022, 12:54:13 am »
Appreciate the feedback. I should play it safe and use a heat sink.

120Ω and 200Ω will create 3.3V as well, I will switch those if those are better values? One question though, I am using the 3.3V to power a (255-1478-ND) relay. The coil rating on the datasheet says 66.7mA is the coil current. Does that mean the load will be 66.7mA?

 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2550
  • Country: us
Re: LM317 Questions
« Reply #9 on: March 20, 2022, 01:43:57 am »
You have the absolute bare minimum circuit to have something work.
I would at least follow the typical application circuit in the datasheet.

 
The following users thanked this post: Jbouss

Offline Ground_Loop

  • Frequent Contributor
  • **
  • Posts: 645
  • Country: us
Re: LM317 Questions
« Reply #10 on: March 20, 2022, 02:44:48 am »
If you're just using that 12 V to drive a relay then you might as well just use a resistor in series with the coil. The 317 is essentially doing the same thing. Nonetheless, I always use an adjustable resistor with 317s as shown in the data sheet. You'll have difficulty getting bang on voltages with fixed value components without a lot of trial and error.
There's no point getting old if you don't have stories.
 
The following users thanked this post: Jbouss

Offline not1xor1

  • Frequent Contributor
  • **
  • Posts: 716
  • Country: it
Re: LM317 Questions
« Reply #11 on: March 20, 2022, 08:12:10 am »
Appreciate the feedback. I should play it safe and use a heat sink.

120Ω and 200Ω will create 3.3V as well, I will switch those if those are better values? One question though, I am using the 3.3V to power a (255-1478-ND) relay. The coil rating on the datasheet says 66.7mA is the coil current. Does that mean the load will be 66.7mA?

that is a 3V panasonic relay
two 68Ω (1/2W or 1W) resistors in series with the relay coil should work
of course a 12V relay would be better
 
The following users thanked this post: Jbouss

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1091
  • Country: nz
  • Retired Electronics Design Engineer
Re: LM317 Questions
« Reply #12 on: March 20, 2022, 04:13:58 pm »
Appreciate the feedback. I should play it safe and use a heat sink.

120Ω and 200Ω will create 3.3V as well, I will switch those if those are better values? One question though, I am using the 3.3V to power a (255-1478-ND) relay. The coil rating on the datasheet says 66.7mA is the coil current. Does that mean the load will be 66.7mA?
Switching to the lower values would be better. The LM317 routes its internal quiescent operating current through to the Vout pin and consequently requires load current of 10mA minimum to sink this current otherwise the output voltage might rise uncontrollably.

If you don't have any other fixed circuit load to guarantee sinking this 10mA minimum current the normal approach is to size resistor R1 sufficiently low (< 125 \$\Omega\$) to set the minimum load current. R2 is also scaled down, in proportion to R1, to set the required output voltage.
 
The following users thanked this post: Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #13 on: March 20, 2022, 05:09:38 pm »
Thanks for all the comments!

Since I am essentially using the regulator as a voltage divider I thought the bare minimum would suffice. I agree I could have used resistors only but since I am new to electronics, I wanted to learn about the LM317 and so far it has been fun to play.

I am using a 3V relay because the 3V will be flowing through a series of switches that are rated for 3V. The goal is if one of the switches opens the relay will collapse, and a 12V LED warning light will turn on. I am using the 12V from the LED warning lights power supply to regulate my 3V. Attached is a more detailed schematic of the full project.

I am really focused on the circuit working and being safe, so if I need to add more that is fine but I would like to understand why. Currently, the 3V relay draws 60-70mA(this is the only thing the 3V is being used for) and the LM317 is running about 50C. This will be running 24/7, therefore, I want to ensure long-term reliability.

Lowering my R1 resistor and adding a heat sink to the LM317 is easy enough so I will make those adjustments. Should I add a bridge rectifier, another cap, and a couple (Zener?)diodes for this application? Does my schematic make sense, or do I need to make adjustments?

All the feedback is appreciated, reaching out to the forum has been amazing.

1444465-1
« Last Edit: March 20, 2022, 06:56:29 pm by Jbouss »
 

Offline TERRA Operative

  • Super Contributor
  • ***
  • Posts: 2917
  • Country: jp
  • Voider of warranties
    • Near Far Media Youtube
Re: LM317 Questions
« Reply #14 on: March 20, 2022, 05:28:42 pm »
Your ring of switches is acting as a dead short across the output from your voltage regulator.....
Where does all this test equipment keep coming from?!?

https://www.youtube.com/NearFarMedia/
 
The following users thanked this post: Jbouss

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 2583
  • Country: gb
Re: LM317 Questions
« Reply #15 on: March 20, 2022, 06:13:28 pm »
silly question but why not just use a 12V relay
 
The following users thanked this post: Jbouss

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: LM317 Questions
« Reply #16 on: March 20, 2022, 06:28:31 pm »
It depends on whether you want the relay to be energized or deenergized with all switches closed.  If energized, the loop of switches needs to be in series with the relay coil.

If deenergized is the objective, one way to do it would be to use an 18.7 ohm resistor to make the LM317 into a 66.8mA current source (remove R2, fit 18.7 ohm for R1 and take output from Adj) that can then safely be shorted by the loop of switches as you have the relay and switch section drawn.  If you change the relay, you'll need to change the current source to match its nominal coil current.  N.B the total on resistance of all the switches *MUST* be at least an order of magnitude less than the coil resistance.  However a better approach would be to use a PNP transistor (with a high enough collector current rating for the load) as a high side switch for the LED tower.  The emitter goes to +12V,  the collector to the resistor feeding the LED tower, and the base is pulled down by a resistor chosen to give a base current of 5% - 10% of the expected collector current.  The loop of switches is then wired base to emitter to turn the transistor off till one opens.  No moving parts, runs cool (if the transistor is properly specified), so should be far more reliable long term.  N.B. an extra resistor chosen to drop 2.5V at the planned base current, or if the base current is under about 25mA, a LED with a Vf of about 2.4V, may be put directly in series with the base to increase the voltage across the switches to about 3.3V for 'wetting', needed if they don't have precious metal or conductive elastomer contacts.
« Last Edit: March 20, 2022, 06:38:32 pm by Ian.M »
 
The following users thanked this post: Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #17 on: March 20, 2022, 06:53:08 pm »
Again thanks for the feedback.

The reason I am not using a 12V relay is that the switches are only rated for 3.3V. That said, I want the relay always to be energized NO, so if one of the switches opens, the relay closes to my 12V supply, and my warning light lights up. The relay coil is around 40Ω, but I am unsure of the switch resistance. I believe it will be very low, basically, the wire connecting them in series, the switch itself is only about 1Ω, but will have to look into the total resistance.

I will look into using a PNP transistor instead. If I am understanding correct this would eliminate the need for the relay and LM317? It may take some time for me to figure out, but I will post something if I do.

[ Specified attachment is not available ]
« Last Edit: March 20, 2022, 06:56:52 pm by Jbouss »
 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3383
  • Country: us
Re: LM317 Questions
« Reply #18 on: March 20, 2022, 07:05:33 pm »
What kind of switch is only rated for 3.3V?  I've never heard of such a thing.
 
The following users thanked this post: tooki, not1xor1, Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #19 on: March 20, 2022, 07:15:40 pm »
The switches are custom pressure switches that measure water flow.
I should say, the switches are only ever used with 3.3V, as for the rating, I do not have the actual spec. I am playing it safe based on what I know.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11561
  • Country: ch
Re: LM317 Questions
« Reply #20 on: March 20, 2022, 08:27:33 pm »
In that case, don’t control a relay with them at all, especially without a freewheeling diode: if those switches are really not capable of more than 3.3V, the inductive kick of a relay will smite them instantly.

I’d definitely use a semiconductor based solution, like a solid state relay.
 
The following users thanked this post: Jbouss

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2550
  • Country: us
Re: LM317 Questions
« Reply #21 on: March 21, 2022, 11:14:02 am »
I don't see how you're going to apply 3.3V across each switch if they are all in series.   :-//
Are the contacts in the pressure switches separate from the power?
 
The following users thanked this post: Jbouss

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1091
  • Country: nz
  • Retired Electronics Design Engineer
Re: LM317 Questions
« Reply #22 on: March 21, 2022, 01:32:24 pm »
Again thanks for the feedback.

The reason I am not using a 12V relay is that the switches are only rated for 3.3V. That said, I want the relay always to be energized NO, so if one of the switches opens, the relay closes to my 12V supply, and my warning light lights up. The relay coil is around 40Ω, but I am unsure of the switch resistance. I believe it will be very low, basically, the wire connecting them in series, the switch itself is only about 1Ω, but will have to look into the total resistance.

I will look into using a PNP transistor instead. If I am understanding correct this would eliminate the need for the relay and LM317? It may take some time for me to figure out, but I will post something if I do.

(Attachment Link)
There is no need to go to the complexity of having a separately regulated supply just for the switch circuit.

A much simpler solution would be to just use a NPN transistor to directly switch the LEDS. Connect the base of the transistor to the +12V supply through a resistor, say 2k2, and connect the series-connected switches across the base and emitter of the transistor. The emitter is connected to 0V and the top of the LED string is connected to +12V while the bottom of the LED string is connected to the tansistor collector.

When all the switches are closed the base is shorted to the emitter and the transistor is switched off and no current flows through the LEDS. If any switch is opened the short is removed from the base-emitter and the transistor turns on illuminating the LEDs. The maximum voltage that appears across any switch is limited by the 0.7V drop across the base-emitter junction of the transistor.

The circuit complexity is reduced to just 2 components rather than 6 and you are eliminating an expensive relay.
 
The following users thanked this post: Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #23 on: March 21, 2022, 11:42:11 pm »
Tooki, thanks for pointing out the need for a flyback diode. If I go this route I will add one in.

I am working on a transistor solution based on the feedback, but am not sure if I drew it out correct? Also, how do I go about picking a transistor for my application, any recommendations?

[ Specified attachment is not available ]
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: au
Re: LM317 Questions
« Reply #24 on: March 22, 2022, 12:27:41 am »
The GND (negative supply rail) connection should be on the emitter of the transistor.
Also the LEDs are drawn connected reverse polarity.

The transistor type is not very critical. Something simple and readily available like say a 2N2222 should do just fine.
 
The following users thanked this post: Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #25 on: March 22, 2022, 12:37:03 am »
Great, Thank you!

I have learned a lot through all the feedback. I am going to order the transistor, and test it out:) Is the 2k2 resistor ok?

[ Specified attachment is not available ]
 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3383
  • Country: us
Re: LM317 Questions
« Reply #26 on: March 22, 2022, 01:10:26 am »
I think you are getting ahead of yourself, because you have not explained what these "switches" are.

If they are mechanical switches, there is no way they would be limited to 3.3V.

If they are electronic sensors, you have to provide power somehow.  Putting them in series is highly unlikely to work.

 
The following users thanked this post: Ian.M, Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #27 on: March 22, 2022, 01:33:49 am »
They are pressure switches activated by water flow. There is a dome-like structure inside that collapses when enough flow is present and that closes the switch. During their normal operation, they are connected to a system that uses a 3.3V signal to tell whether the switch is open or closed. This is how I know they can withstand 3.3V. In all likelihood, they could probably withstand 12V, but I do not know.

Out of the system, the switch works the same, when enough water flow is present the switch is closed, if water flow is lost, the switch opens. I want a light to indicate if an open event occurs, so my thinking was: If the switches are in series and closed with 3.3V running through them activating a relay(or transistor), as long as my circuit is wired correctly, if a switch opens, it will collapse my relay and turn on 12V to my light.

I'm sorry, I am new to electronics and am having a hard time understanding why putting the switches in series will not work? Thank you for your feedback.
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: au
Re: LM317 Questions
« Reply #28 on: March 22, 2022, 01:42:56 am »
If they are switches with mechanical contacts similar to what a relay has, i.e two pieces of metal that touch, then all should be good. If they have some kind of semiconductor switch e.g. Hall effect then that gets a bit more tricky. But from your description it sounds like it should be perfectly okay.
 

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3383
  • Country: us
Re: LM317 Questions
« Reply #29 on: March 22, 2022, 01:48:49 am »
OK, that clarifies things a bit.

Since they are mechanical switches, you can put them in series.

Do you have a datasheet?

(BTW, are they pressure switches or flow switches?  Those are 2 separate things.)

 

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #30 on: March 22, 2022, 01:53:23 am »
Unfortunately no datasheet:(

I think they are flow switches. They use water pressure to activate, but, ~1.2PSI of air pressure will activate them on a bench.
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: au
Re: LM317 Questions
« Reply #31 on: March 22, 2022, 02:07:09 am »
How many wires come out of each switch? If there are only two then it sounds like they are a mechanical switch.
 
The following users thanked this post: Jbouss

Offline edavid

  • Super Contributor
  • ***
  • Posts: 3383
  • Country: us
Re: LM317 Questions
« Reply #32 on: March 22, 2022, 02:18:27 am »
I think they are flow switches. They use water pressure to activate, but, ~1.2PSI of air pressure will activate them on a bench.

Why do you think they measure flow?

And if they are pressure switches, what is the point of using more than one of them?  Isn't the pressure the same everywhere in the system?
 
The following users thanked this post: Jbouss

Offline JboussTopic starter

  • Contributor
  • Posts: 33
  • Country: us
Re: LM317 Questions
« Reply #33 on: March 26, 2022, 01:46:15 am »
Hi Again, I got my transistor kit and tried out the below schematic, and there is something wrong :palm:

Currently, when I apply power, my LED tower just comes on.

[ Specified attachment is not available ]
 

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1091
  • Country: nz
  • Retired Electronics Design Engineer
Re: LM317 Questions
« Reply #34 on: March 26, 2022, 05:29:38 am »
Hi Again, I got my transistor kit and tried out the below schematic, and there is something wrong :palm:

Currently, when I apply power, my LED tower just comes on.

(Attachment Link)
Should work. What transistor did you use? Have you triple checked the transistor leads are connected in the right order?

You can check that the transistor is working by applying a direct short between the base and emitter - the LEDs should go out.

N.B. your drawing title is confusing - this is a actually an NPN transistor, which is the correct type for this circuit configuration.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf