Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Delta-Wye
Sep 29, 2005

Comrade Milton posted:

I didn't even know how to phrase what I didn't know, so Google wasn't of much use.


You realize the two are the same thing, right? Small, identical dots? Just that one comes with grammar and the other with numeric values? I don't know if they teach anything except equations and being a smug prick at engineering school.

I actually had two semesters on how to be a smug prick at engineering school. Kinda on topic, check out my new shirt I got today.



I won't deny that we/me can be dicks sometimes.

Plus, if you can't type "led battery resistor" (key words from your post) into google and read the first result, you are more retarded then I previously expected.

quote:

Regarding the v6 source, you guys are speaking a little over my head. All I know is that by looking at this page, it says "Supply Min = 6 Volt; Supply Max = 36 Volt". And when I look at the LM386 cover sheet, it says that the chip has a "Wide Supply voltage range: 4V-12V" And knowing that the LM386 can be powered by a 9v, I assume that the meaning is similar -- any DC power supply between 6v and 36v (like a 9v battery) will work for the KA4558.

Am I reading that incorrectly?

Those are the min/max values for the voltage inputs, most likely. You'll have to supply something in between to get the expected output. Here is a schematic showing what I mean:

If R1 and R2 are equal, the output values should be fairly close to the expected values until the loading circuit (your op amp business) is connected. Larger values of R1/R2 are more efficient, but if they are bigger than your loading circuit's equivalent resistance, the output voltages may not be very accurate (due to parallel resistances being significantly lower).

Adbot
ADBOT LOVES YOU

SnoPuppy
Jun 15, 2005

babyeatingpsychopath posted:

The thing about opamps is they need dual voltages, because they amplify signals that have both positive and negative voltage. Without positive and negative voltage (or differential voltage, such as from a voltage divider) the opamp just won't work at all. It will "do stuff" but not what you think it should be doing. With DC filter caps on the input and output, it won't do anything at all.

I played around in spice with this for a bit and am convinced that opamps are magic.

Op amps are super easy, especially when compared to trying to do an equivalent circuit with discrete transistors. There are only two rules you have to remember for op amps, assuming you have negative feedback.
1. No current will flow into the input terminals
2. Both input terminals will have the same voltage present on them

The output will do whatever it must in order to satisfy these conditions.

And it is quite possible to operate an op amp without a negative supply - you just will clip at around 0v instead of -Vcc. All you have to do is bias the input of the op amp to a DC offset and AC couple the inputs/outputs, like in his schematic.

While SPICE is a good tool, remember that 95% of the time it is using a simplified model. If you understand how it works then you can then determine if it's doing something reasonable or something stupid - you shouldn't blindly follow tools without knowing what they are doing under the hood.

Corla Plankun
May 8, 2007

improve the lives of everyone
I actually built a really ghetto single op-amp amplifier for my guitar a couple weeks ago. I used a 9 volt AC adapter, and absolutely no fancy split-power supply. It sounds really distorted (and awesome, for my application: playing a super crappy squier into a pair of headphones) and I just assumed thats what Op-Amps did, and thats why they're 50 cents a piece at radio shack.

Are you guys suggesting that if I linked it to a split power supply, it would amplify without wonky low-fi distortion? I like it the way it is, but I'm also quite curious.

pim01
Oct 22, 2002

Comrade Milton posted:

I didn't even know how to phrase what I didn't know, so Google wasn't of much use.

Come on dude, even typing in 'led resistor' has calculators as the first results.

jovial_cynic posted:

Dual powersupply confusion.

Tangent has a good write-up on splitting powersupplies and virtual ground.

pim01 fucked around with this message at 10:06 on Mar 21, 2008

Delta-Wye
Sep 29, 2005

Corla Plankun posted:

I actually built a really ghetto single op-amp amplifier for my guitar a couple weeks ago. I used a 9 volt AC adapter, and absolutely no fancy split-power supply. It sounds really distorted (and awesome, for my application: playing a super crappy squier into a pair of headphones) and I just assumed thats what Op-Amps did, and thats why they're 50 cents a piece at radio shack.

Are you guys suggesting that if I linked it to a split power supply, it would amplify without wonky low-fi distortion? I like it the way it is, but I'm also quite curious.

There could be a number of things up with your design. It could just be a lovely opamp (it WAS from radioshack, after all), it could be not having a bipolar supply, or it could be a lack of negative feedback. I would be interested in hearing if adding a bipolar supply would clean the signal up. Opamps are limited by their rail (supply) voltages - it can't output a higher level than you put in. If your supply is +9/0V, you will only amplify the positive portions of the signal at best. If you're lacking negative feedback, your gain is going to be ~10,000 and the opamp is just going to be swinging from one rail to the other (or from 0-9V in your case).

If adding a bipolar supply and having negative feedback cleans it up, and you want a dirty signal again, adding two diodes back to back across the feedback resistor should get you some clipping. Ought to be a bit better sounding than what you currently have, at any rate.

scholzie
Mar 30, 2003

If I had a daughter, she'd probably be pregnant by the time she turned 12.

Corla Plankun posted:

I actually built a really ghetto single op-amp amplifier for my guitar a couple weeks ago. I used a 9 volt AC adapter, and absolutely no fancy split-power supply. It sounds really distorted (and awesome, for my application: playing a super crappy squier into a pair of headphones) and I just assumed thats what Op-Amps did, and thats why they're 50 cents a piece at radio shack.

Are you guys suggesting that if I linked it to a split power supply, it would amplify without wonky low-fi distortion? I like it the way it is, but I'm also quite curious.

Yes, that's the suggestion. Keep in mind that it's not called a split power supply though. A bi-polar (or dual) supply isn't really "split," it's just acting as a negative and positive supply with respect to a common ground (which, in this case, is a floating ground. Don't use earth ground or the ground from another supply.) Splitting something usually gives two or more lines with the same signal on each one.

Anyway, you don't NEED a bi-polar supply as long as your signal fits completely within the voltage supply you're feeding the op-amp. That means that if your guitar gives off a signal with a maximum amplitude of +/- 3V (that's pretty high for a guitar), then you need to offset your input signal with +3V DC (at least) in order to make sure it's centered well within the range of your power supply. Essentially, you only need a negative lead into the op-amp if your circuit will be dealing with signals which go negative. If you bump up your entire signal by a few volts, it will always stay positive, and you can get away with feeding a normal voltage source into the op-amp's power terminals.

But at the end, you're now left with a signal which is centered around whatever your DC offset voltage was, which might not work with whatever next stage you're feeding the signal into. In that case you'll need to drop the signal back down to center around ground (negative DC offset, 1:1 transformer, or something like that). If you're going to headphones I think it would be fine as long as you used your DC offset source as the "ground" for the headphones.

It's a lot easier to just throw 2 resistors and 2 caps in to give yourself a bi-polar supply to use with the op-amp.

Delta-Wye posted:

If adding a bipolar supply and having negative feedback cleans it up, and you want a dirty signal again, adding two diodes back to back across the feedback resistor should get you some clipping. Ought to be a bit better sounding than what you currently have, at any rate.

You can also build an overdrive stage by using a dual op-amp design. Use one opamp to amplify, and one to clip (or vice versa). Diode clipping can tend to be really tinny and gross, but red LEDs sound nice as clipping diodes (the color of the LED actually makes a difference!).

Overdrive is the act of driving a signal to clip before outputting it. Just make your first amp stage's gain high enough to clip the signal (by designing a gain higher than the opamp source rail voltage), then feed that signal into your output amp stage. Check out the Marshall Blues Breaker (caution: pdf) schematic for a pedal built around that idea. Notice there's a pot for controlling the gain (amplification multiplier) of the first stage. You could use the same idea for your amp, just use a switch to turn the first stage on or off (or use a switch to flip between a gain of 1 and the gain set by the pot). (Nevermind, I had a senior moment.)

scholzie fucked around with this message at 04:23 on Mar 22, 2008

Locker Room Zubaz
Aug 8, 2006

:horse:
~*~THE SECRET OF THE MAGICAL CRYSTALS IS THAT I'M FUCKING TERRIBLE~*~

:horse:

babyeatingpsychopath posted:

The thing about opamps is they need dual voltages, because they amplify signals that have both positive and negative voltage. Without positive and negative voltage (or differential voltage, such as from a voltage divider) the opamp just won't work at all. It will "do stuff" but not what you think it should be doing. With DC filter caps on the input and output, it won't do anything at all.

I played around in spice with this for a bit and am convinced that opamps are magic.

there are tons of single rail op-amps out there that put a dc offset into the signal so it can swing high and low, then you can just throw a decoupling cap on the output to remove the DC.

quote:

You realize the two are the same thing, right? Small, identical dots? Just that one comes with grammar and the other with numeric values? I don't know if they teach anything except equations and being a smug prick at engineering school.

Get out of here you aren't providing anything to the discussion and are just being a lovely troll and enticing flames. This thread is about information and learning not about being a cock and bitching about people not wanting to do your work.

edit: didn't realize there was another page on this thread.

Locker Room Zubaz fucked around with this message at 17:51 on Mar 21, 2008

jovial_cynic
Aug 19, 2005

Now that I've got a better idea of how op-amps work (this site was tremendously helpful), I'm a little more comfortable with experimenting and trying to see what happens when I start wiring things up together.


Regarding the LM386, we've already covered the fact that it's not an op-amp. It's a 1/2 watt audio power-amp. And in my scavenging of parts, I came across a KA22065.

http://www.ortodoxism.ro/datasheets/SamsungElectronic/mXrrtyy.pdf

This appears to be a 4.6W dual power amp, specifically made for audio.

The diagram is sparce, but there's a "test and application" page that shows how it can be wired up.

On that diagram, what is "BS1" and "BS2"? What do they stand for? I see that on the block diagram, they are connected to some kind of thermal-protection unit. And what about "NF1" and "NF2"?

The supply voltage says "6v to 15v," and it originally came from a device that had a 12v AC adaptor. I suppose a 9v would work as well?

So... is this basically an older and more powerful version of what the LM386 will do, in terms of making a small instrument amplifier? Is there anything in this circuit that I should be particularly aware of?

-----

edit: I also found a LA4485 audio power amp chip.

http://www.ortodoxism.ro/datasheets/sanyo/ds_pdf_e/LA4485.pdf

Same questions about that.

jovial_cynic fucked around with this message at 19:44 on Mar 21, 2008

the wizards beard
Apr 15, 2007
Reppin

4 LIFE 4 REAL

scholzie posted:

You can also build an overdrive stage by using a dual op-amp design. Use one opamp to amplify, and one to clip (or vice versa). Diode clipping can tend to be really tinny and gross, but red LEDs sound nice as clipping diodes (the color of the LED actually makes a difference!).

Overdrive is the act of driving a signal to clip before outputting it. Just make your first amp stage's gain high enough to clip the signal (by designing a gain higher than the opamp source rail voltage), then feed that signal into your output amp stage. Check out the Marshall Blues Breaker (caution: pdf) schematic for a pedal built around that idea. Notice there's a pot for controlling the gain (amplification multiplier) of the first stage. You could use the same idea for your amp, just use a switch to turn the first stage on or off (or use a switch to flip between a gain of 1 and the gain set by the pot).

Actually, diode clipping sounds pretty good, it's very common in overdrive and distortion pedals. Clipping an op-amp sounds pretty bad, op-amps are not designed to be operated this way and usually don't handle clipping very gracefully. If you look at the Bluesbreaker schematic again, you can see that the first stage amplifies the signal to usable level and acts as an input buffer. The second op-amp has 4 diodes in it's feedback loop, this is where the clipping takes place. The first gain stage is completely "clean", and in the newer version of the Bluesbreaker you can bypass the second stage for clean boost.

scholzie
Mar 30, 2003

If I had a daughter, she'd probably be pregnant by the time she turned 12.

the wizards beard posted:

Actually, diode clipping sounds pretty good, it's very common in overdrive and distortion pedals. Clipping an op-amp sounds pretty bad, op-amps are not designed to be operated this way and usually don't handle clipping very gracefully. If you look at the Bluesbreaker schematic again, you can see that the first stage amplifies the signal to usable level and acts as an input buffer. The second op-amp has 4 diodes in it's feedback loop, this is where the clipping takes place. The first gain stage is completely "clean", and in the newer version of the Bluesbreaker you can bypass the second stage for clean boost.

You're right about the BB - I linked it without even really checking it out because I was recalling it differently. I could have saved us both the trouble if I looked at the second stage. There's another design out there somewhere that I recently built on my breadboard that sounded great, and it used 1 dual opamp (or maybe a 3/4 on a quad opamp). If I can find it I'll post link.

What I meant about diode clipping sounding bad, but didn't phrase right at all, was that the choice of diodes makes a huge impact on the sound you get. A pair of 1N400x diodes sounds horrible, but 914s sound great. LEDs sound great if you get the right ones. So yeah I didn't mean to imply that diodes weren't used for overdrive - they're used all the time, but the FET driven overdrives tend to have a more tube-like distortion.

scholzie fucked around with this message at 04:26 on Mar 22, 2008

radioactivelego
Jun 1, 2004

only in the CPT
I'm looking to do a little project that uses multi-color LED's that react to sound. Imagine an 80's LED tachometer except it reacts to sound (or hey if frequencies are possibly even cooler). It'd be hooked up to a computer microphone and would be aimed at a sound. dB or frequencies I want 5 different color LED's (like a blue to white gradient) that react and light up based on levels. I would imagine some form of resistors would be in order and would revolver around voltage dropping etc. Some sort of variable potentiometer?

edit: Oh poo poo answered my own question.



http://www.escience.ca/hobby/RENDER/0001/C9/3043/13055.html

Got another one though. I'd imagine something like that knob would adjust how sensitive it is to the sound?

radioactivelego fucked around with this message at 13:00 on Mar 25, 2008

scholzie
Mar 30, 2003

If I had a daughter, she'd probably be pregnant by the time she turned 12.

radioactivelego posted:

I'm looking to do a little project that uses multi-color LED's that react to sound. Imagine an 80's LED tachometer except it reacts to sound (or hey if frequencies are possibly even cooler). It'd be hooked up to a computer microphone and would be aimed at a sound. dB or frequencies I want 5 different color LED's (like a blue to white gradient) that react and light up based on levels. I would imagine some form of resistors would be in order and would revolver around voltage dropping etc. Some sort of variable potentiometer?

edit: Oh poo poo answered my own question.



http://www.escience.ca/hobby/RENDER/0001/C9/3043/13055.html

Got another one though. I'd imagine something like that knob would adjust how sensitive it is to the sound?

http://www.google.com/search?q=led+VU+meter

There are many circuits out there that do exactly what you want, but lots of them vary the extent to which they do. I had one on my old PC that went from blue to white to red to indicate volume levels.

You could also route the signal through a few parallel bandpass filters in order to get VU levels at specific frequencies. That would require some design work though, and I don't know if you're up to that. I'm sure there are more designs for exactly that out there, but it would just take some digging.

You could control "sensitivity" a few ways: a potentiometer before the LEDs to scale back the driving voltage (in this case your output signal), or a potentiometer on the signal input. It would really just depend on the circuit design which way you'd choose. If the signal is small, you might need to run it through an amplifier to get it to a point where it can control the LED circuitry, so you can also add a pot to change the gain of the amplifier. That's probably the closest to a "sensitivity" setting as I can think of.

If you have a better idea of exactly what you want, it's much easier to come up with a solution.

Mach Won
Jun 17, 2004

Is UNC playing? My post is either whining about (1) ref favoritism, (2) unfair recruiting/player caliber, (3) opposing team sucking or (4) the inevitable UNC win. The day you see me giving UNC credit for anything is the day someone hacked my account.

Roy era: 1-16 :qq: RIVALS!!!!!
I'm not really sure what you want the circuit to do?

Chillbro Baggins
Oct 8, 2004
Bad Angus! Bad!
Dammit.

Finally got around to soldering the mp3 player cord onto the radio, left/right be damned. Alas, I didn't get to test it because I hooked it up the the car wrong -- switched the always-on and ignition-switched 12v lines, which are orange and yellow on the radio side but both yellow on the car side, and I'm working without a plug because the thieves cut it off to get the CD head unit out -- and didn't have time to redo it before InediblePenguin left for work. It does work in radio mode, at least, so I didn't kill it.

Also, I didn't pay enough attention when putting the front panel back on, and forgot to line up the balance slider, so it's all the way to one side and the slider doesn't move the switch-thing. I'll fix it while she's home for lunch and try it with the mp3 player plugged in.

Next project, assuming that works: build a car charger for the mp3 player. I'm pretty sure I've already got a car-lighter-plug transformer that outputs 5vDC; all I'd have to do is wire it up to the correct pins on a USB cable, right?

Chillbro Baggins fucked around with this message at 14:15 on Mar 26, 2008

ANIME AKBAR
Jan 25, 2007

afu~

radioactivelego posted:

I'm looking to do a little project that uses multi-color LED's that react to sound. Imagine an 80's LED tachometer except it reacts to sound (or hey if frequencies are possibly even cooler). It'd be hooked up to a computer microphone and would be aimed at a sound. dB or frequencies I want 5 different color LED's (like a blue to white gradient) that react and light up based on levels. I would imagine some form of resistors would be in order and would revolver around voltage dropping etc. Some sort of variable potentiometer?

edit: Oh poo poo answered my own question.



http://www.escience.ca/hobby/RENDER/0001/C9/3043/13055.html

Got another one though. I'd imagine something like that knob would adjust how sensitive it is to the sound?
Having it react to volume is easy. Just amplify the signal off a microphone, rectify it and low pass it to get a volume to voltage converter. If you wanted to have the brightness of the leds vary with volume, you could just hook that voltage up to voltage to current converter and drive the leds with that. If you want different leds to turn on at different volumes you could use comparators and set a few thresholds at which the comparators will switch on, and power the leds from there. There a lots of ways to go about doing this.

Reacting to frequency is a great deal harder, because unless the sound is a perfect sine wave, any sound will have many frequencies in it. If you're looking for one or more specific frequencies, you could build a bandpass filter for each frequency then rectify the output as before. But if you want to look at continuous range of frequencies you'd effectively have to build a spectrum analyzer, which is pretty deep stuff.

clredwolf
Aug 12, 2006
Oh wow, you guys have kept this thing going in my absence. I'll read through this when I get some free time again sometime tomorrow. Been rather distracted lately, but I definitely want to see this thread stay alive.

greasyhands
Oct 28, 2006

Best quality posts,
freshly delivered
I've got a total noob question. My tweeter quit working on one of my speakers so i took it apart and started poking at it with my multimeter. By comparing the working speaker to the non-working speaker I arrived at the conclusion that a small blue plastic piece with one wire in/ one wire out is the culprit. All it says on it is "EXPOTUS 3.3k100V" what kind of part would that be? EXPOTUS is a british component manufacturer, the speakers are made by Monitor Audio. The + wire passes through a resistor, then into the broken piece, then onto a wrapped wire capacitor (I think thats what it is?)

FPS_Sage
Oct 25, 2007

This was a triumph
Gun Saliva

greasyhands posted:

All it says on it is "EXPOTUS 3.3k100V" what kind of part would that be?

I would guess that's a 3.3 kilo-ohm resistor (rated to 100V). They probably put that in series with the other resistor in order to get the spec'd resistance because nobody makes resistors of that particular value (i.e. a 10k + your 3.3k = 13.3k, and that part is probably hard to find). The good news is, if that really is the broken part, you should be able to fairly easily (and very cheaply) replace it.

greasyhands
Oct 28, 2006

Best quality posts,
freshly delivered
edit: nevermind that doesnt make any sense

greasyhands fucked around with this message at 06:23 on Mar 28, 2008

scholzie
Mar 30, 2003

If I had a daughter, she'd probably be pregnant by the time she turned 12.

FPS_Sage posted:

I would guess that's a 3.3 kilo-ohm resistor (rated to 100V). They probably put that in series with the other resistor in order to get the spec'd resistance because nobody makes resistors of that particular value (i.e. a 10k + your 3.3k = 13.3k, and that part is probably hard to find). The good news is, if that really is the broken part, you should be able to fairly easily (and very cheaply) replace it.

This really doesn't make sense. A 3.3k resistor "rated to" 100V would only be 300mW. You could easily get away with a basic 1/2 Watt 3.3k resistor. They typically also don't put max voltages on resistors because there's almost always no point. A picture might be useful if you can get one.

Also, wrapped wire capacitor? Do you mean one of these?

FPS_Sage
Oct 25, 2007

This was a triumph
Gun Saliva
I meant that 100V would be the maximum potential it could handle before the resistance value changes significantly/shorts out/catches his house on fire. I could be wrong about it being a resistor, though. It just seemed reasonable to me that that's what it would be - I can't think of any other component that would be labeled "3.3 thousand" units, and have those units be anything other than ohms (but I could be stupidly overlooking something). I guess if greasyhands posted a picture, it would certainly help.

clredwolf
Aug 12, 2006

scholzie posted:

Also, wrapped wire capacitor? Do you mean one of these?


On that note, does it look like the big copper thing in the pic here?



Both are inductors, but I've seen the latter kind more in audio equipment. Even sorta looks like a cap if you squint.

That starts to not make sense though because usually inductors are rated by amps, not volts. Stranger things have happened though.

mtwieg posted:

Reacting to frequency is a great deal harder, because unless the sound is a perfect sine wave, any sound will have many frequencies in it. If you're looking for one or more specific frequencies, you could build a bandpass filter for each frequency then rectify the output as before. But if you want to look at continuous range of frequencies you'd effectively have to build a spectrum analyzer, which is pretty deep stuff.

If you go this route and want to do frequencies, a half decent ADC (analog digital converter) and a higher-end PIC microcontroller should be sufficient to build a basic spectrum analyzer. However, the software you'd write for that would be, uh, challenging unless you know what you are doing. Lots of math, FFTs, and craziness involved there.

You can also do it with a whole bunch of bandpass filters, but I somehow doubt you want to contend with that. Volume meter is the easy way to go for now!

clredwolf fucked around with this message at 23:07 on Mar 28, 2008

clredwolf
Aug 12, 2006

jovial_cynic posted:

Now that I've got a better idea of how op-amps work (this site was tremendously helpful), I'm a little more comfortable with experimenting and trying to see what happens when I start wiring things up together.


Regarding the LM386, we've already covered the fact that it's not an op-amp. It's a 1/2 watt audio power-amp. And in my scavenging of parts, I came across a KA22065.

http://www.ortodoxism.ro/datasheets/SamsungElectronic/mXrrtyy.pdf

This appears to be a 4.6W dual power amp, specifically made for audio.

The diagram is sparce, but there's a "test and application" page that shows how it can be wired up.

On that diagram, what is "BS1" and "BS2"? What do they stand for? I see that on the block diagram, they are connected to some kind of thermal-protection unit. And what about "NF1" and "NF2"?

The supply voltage says "6v to 15v," and it originally came from a device that had a 12v AC adaptor. I suppose a 9v would work as well?

So... is this basically an older and more powerful version of what the LM386 will do, in terms of making a small instrument amplifier? Is there anything in this circuit that I should be particularly aware of?

-----

edit: I also found a LA4485 audio power amp chip.

http://www.ortodoxism.ro/datasheets/sanyo/ds_pdf_e/LA4485.pdf

Same questions about that.

The particular opamp you pointed out is an older style opamp with bias inputs. That's BS1 and BS2. Both are set to a particular voltage to try and get the output voltage to be as close to 0V as possible. NF1 and NF2 are connected to ground through a capacitor. If you want to use that particular opamp, then the diagram on page 3 of that part's spec sheet is a good circuit to start with for what you want to do.

There are better opamps nowadays that don't need the biasing. However, I'd reccomend getting an amp on an IC, since it's just easier.

The LA4485 looks like a nice power amp too. The sample circuit on p.15 (the BTL one) is a nice place to start for a monoblock amp (like, say, for a guitar practice amp). BTL simply means that both output stages of the amplifier are tied together, much like in high-quality car amps nowadays.

You can do better, though. The LM1875 pushes 30 watts with few external components required.

http://www.national.com/mpf/LM/LM1875.html

You'll need at least a 16V supply for that though, but that's only 2 9V batteries. I'll be a power hungry beast, but it'll definitely have some kick to it. Both amps (sanyo and national) might push the current draw for alkaline batteries, so you may want to consider using older NiCad/NiMH batteries to power it. Some R/C car stuff is over 12 volts.

jovial_cynic
Aug 19, 2005

Nobody likes a braggart, but I figured that people here might get as much of a kick out of this as I have. Except that it happened to me, and not to you. So maybe not as much.

Anyhow...



Last weekend, a coworker offloaded a truck-load of electronic componants to me -- resistors, capacitors, potentiometers, ICs, audio connectors, fuses, PCB boards, soldering equipment, etc., etc., as well as some circuitry books and schematic tutorials.

I am now my own Radio Shack, as far as electronic componants are concerned.

These two chests in front are full of resistors, ranging from less than 1 ohm to about 1 mega-ohm. The chest in the rear is full of capacitors and more resistors. I have another chest (not shown) that's full of fuses, and another one full of non-polarized capacitors, plus a giant cabinet full of miscellaneous ICs, diodes, and other things I haven't identified yet.

Fun! It's like geek Christmas!

e: fun fact. Nearly all the resistors in this bunch are blue. I didn't even know that blue resistors existed until I got all of this stuff, and it turns out that blue resistors are precise to 1%, as opposed to standard light-brown resistors which are precise to 5%. Mmm. Precision.

jovial_cynic fucked around with this message at 23:56 on Mar 28, 2008

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


I got an LM317 voltage regulator, and it's totally tits. The datasheet for the thing is 26 pages long, six of which are schematics showing you how to do stuff.

One of the "stuff" things you can do is have digitally selected output voltages using transistor-controlled resistors.

This, I understand.

What I don't understand very well is how this device works. Does it need a resistive load on the adjustment output, or will a differential voltage load work? I'd love to be able to infinitely vary my output voltage using a DAC. I'm not sure if a variable resistor that can be controlled electronically even exists. Does a transistor work this way?

SnoPuppy
Jun 15, 2005

babyeatingpsychopath posted:

I got an LM317 voltage regulator, and it's totally tits. The datasheet for the thing is 26 pages long, six of which are schematics showing you how to do stuff.

One of the "stuff" things you can do is have digitally selected output voltages using transistor-controlled resistors.

This, I understand.

What I don't understand very well is how this device works. Does it need a resistive load on the adjustment output, or will a differential voltage load work? I'd love to be able to infinitely vary my output voltage using a DAC. I'm not sure if a variable resistor that can be controlled electronically even exists. Does a transistor work this way?

And you can! The easiest way to think about it is that the regulator wants to keep its Vref at some constant voltage (probably 1.25, if I am remembering correctly). It will adjust the output until this is stable, hence why you need the feedback resistor and then the resistor to ground. If you didn't have the feedback, it would just hit one of the rails.

To operate it with a DAC you just need to to replace the ground connection with the output of your DAC. This will allow your DAC to control one of the points on the voltage divider and thus control what the output level needs to be to satisfy the Vref requirement.

ANIME AKBAR
Jan 25, 2007

afu~

babyeatingpsychopath posted:

I got an LM317 voltage regulator, and it's totally tits. The datasheet for the thing is 26 pages long, six of which are schematics showing you how to do stuff.

One of the "stuff" things you can do is have digitally selected output voltages using transistor-controlled resistors.

This, I understand.

What I don't understand very well is how this device works. Does it need a resistive load on the adjustment output, or will a differential voltage load work? I'd love to be able to infinitely vary my output voltage using a DAC. I'm not sure if a variable resistor that can be controlled electronically even exists. Does a transistor work this way?

the lm317 is a solid device, though one of the things that bugs me about it is that it will only operate correctly if you load it with at least 10 or so milliamps, so it blows as a low power reference but is good as just a supply.

Linear regulators are pretty simple and they can be built from a few transistors and stuff pretty easily. There tons of tutorials online. You just have to understand how negative feedback works. That's how most analog circuits work.

The Dipshit
Dec 21, 2005

by FactsAreUseless
Holy poo poo, this thread makes the entire sub forum worthwhile. If only I had the time to seriously purse this.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


SnoPuppy posted:

And you can! The easiest way to think about it is that the regulator wants to keep its Vref at some constant voltage (probably 1.25, if I am remembering correctly). It will adjust the output until this is stable, hence why you need the feedback resistor and then the resistor to ground. If you didn't have the feedback, it would just hit one of the rails.

To operate it with a DAC you just need to to replace the ground connection with the output of your DAC. This will allow your DAC to control one of the points on the voltage divider and thus control what the output level needs to be to satisfy the Vref requirement.

This is so awesome; thank you so much.

DrColossus
Jul 17, 2006
I've got a 24 volt, 20 amp power supply and need to run a 12 volt battery charger on it. Is there an efficient way to drop the voltage without just burning it off in a resistor? Ideally it would be able to output 15 amps, but 10 or so would be tolerable.

I've seen commercial products that do what I need, but they all have huge heatsinks which makes me think efficiency isn't their strong point. They're also expensive: I could always just get a 12v supply.

SnoPuppy
Jun 15, 2005

DrColossus posted:

I've got a 24 volt, 20 amp power supply and need to run a 12 volt battery charger on it. Is there an efficient way to drop the voltage without just burning it off in a resistor? Ideally it would be able to output 15 amps, but 10 or so would be tolerable.

I've seen commercial products that do what I need, but they all have huge heatsinks which makes me think efficiency isn't their strong point. They're also expensive: I could always just get a 12v supply.

The (possibly) easiest, and least efficient way, would be a resistor/linear regulator combo. Even then, it would have to be quite beefy as you would be trying to dissipate something like 180 watts of power. The other option would be a switching power supply - those are much more efficient, but much harder to design/build/debug. I would bet that those commercial products are actually switchers, as even at 90% efficiency you still have to dissipate around 20 watts (that would need some big heat sinks).

I wouldn't be surprised if your cheapest option is just to buy a 12v 15A supply, rather than attempting to use what you have.

DrColossus
Jul 17, 2006

SnoPuppy posted:

I wouldn't be surprised if your cheapest option is just to buy a 12v 15A supply, rather than attempting to use what you have.

Thanks - I thought that would be the case but was holding out hope for something really clever.

I 'll probably just cut the extra outputs off an old PC power supply and throw some banana plugs on it. I think I've got one that'll do 10A.

Nerobro
Nov 4, 2005

Rider now with 100% more titanium!
So, tonight I actually got some silicon hooked up on my bicycle headlight project. I'm using a 7805 vreg to cut down the power from a 9.6v 2.3ah battery pack. I'm looking to drive 50leds at 20ma each. That butts right up against the limit of the 7805.

I'm using groups of 10leds and 10ohms of resistors. I'm getting exactly the right voltage drop across the LED's. (that's 3.2v) So I think I've got that part right.

Tonight I hooked up the 7805 and 20 leds. The 7805 got quite warm. I do not yet have a heatsink on it. That's something I can address easily... it's something I'd like to NOT address, if you get my drift. Which brings us to my question.

I've never built a SMPS. I'd like to build one. Every switch mode power supply I've looked at seems to have a whole bunch of components. And I get somewhat lost while searching digikey for the proper one.

Can any of you give me recommendations on a chip to go with? I was hoping to find something in a 5 pin to-220 package. And what I should do for the inductor?

scholzie
Mar 30, 2003

If I had a daughter, she'd probably be pregnant by the time she turned 12.
For some reason (probably because it's 5:30 AM and I just got up) I thought you said you were going to put 50 LEDs on your bicycle helmet, and I thought to myself "Jesus Christ what a loving nerd."

But I approve of LED bicycle headlights :)

Nerobro
Nov 4, 2005

Rider now with 100% more titanium!
While I don't have any lights on it, my bike helmet is red. :-) And I have a obnoxious red flashing taillight. My goal is to have enough light that I can ride confidently in the dark.

I have a PCB layout that will net a very neat looking headlight. I have a road bike, and nothing is uglier than a bunch of stuff hanging off the bars. My bars are about 7/8" thick, and two rows of LED's are only about half an inch wide. I'm looking to have the headlight be a "stick" of light.

Digging around on digikey, I found two good candidates. And I think I settled on the LM2576. http://www.national.com/ds/LM/LM2576.pdf It has a wider acceptable input voltage than the LM1575. The whole reference design is the chip, the inductor, a diode to handle the back emf from the inductor, and two caps. I think that's about as simple as it can get.

Better than that, someone on ebay is selling sets of 10 of the needed components for $23. Having a stockpile of 5v 3A SMPS wouldn't be a bad thing.

Locker Room Zubaz
Aug 8, 2006

:horse:
~*~THE SECRET OF THE MAGICAL CRYSTALS IS THAT I'M FUCKING TERRIBLE~*~

:horse:

Nerobro posted:

While I don't have any lights on it, my bike helmet is red. :-) And I have a obnoxious red flashing taillight. My goal is to have enough light that I can ride confidently in the dark.

I have a PCB layout that will net a very neat looking headlight. I have a road bike, and nothing is uglier than a bunch of stuff hanging off the bars. My bars are about 7/8" thick, and two rows of LED's are only about half an inch wide. I'm looking to have the headlight be a "stick" of light.

Digging around on digikey, I found two good candidates. And I think I settled on the LM2576. http://www.national.com/ds/LM/LM2576.pdf It has a wider acceptable input voltage than the LM1575. The whole reference design is the chip, the inductor, a diode to handle the back emf from the inductor, and two caps. I think that's about as simple as it can get.

Better than that, someone on ebay is selling sets of 10 of the needed components for $23. Having a stockpile of 5v 3A SMPS wouldn't be a bad thing.

the 2576 is a good part and will work fine for what you are doing. It gets a little finnicky at low input voltages, the spec sheet says it can go down to 2.5v input but it stops working at like 4, so if you are going to really low voltages stay away from it.

Nerobro
Nov 4, 2005

Rider now with 100% more titanium!
I'll have greater than 7v input at all times. Unless I want to destroy my nimh pack. I think that means I'm safe.

Chalupa Joe
Mar 4, 2007

Nerobro posted:

So, tonight I actually got some silicon hooked up on my bicycle headlight project. I'm using a 7805 vreg to cut down the power from a 9.6v 2.3ah battery pack. I'm looking to drive 50leds at 20ma each. That butts right up against the limit of the 7805.

I'm using groups of 10leds and 10ohms of resistors. I'm getting exactly the right voltage drop across the LED's. (that's 3.2v) So I think I've got that part right.

Tonight I hooked up the 7805 and 20 leds. The 7805 got quite warm. I do not yet have a heatsink on it. That's something I can address easily... it's something I'd like to NOT address, if you get my drift. Which brings us to my question.

I've never built a SMPS. I'd like to build one. Every switch mode power supply I've looked at seems to have a whole bunch of components. And I get somewhat lost while searching digikey for the proper one.

Can any of you give me recommendations on a chip to go with? I was hoping to find something in a 5 pin to-220 package. And what I should do for the inductor?

The 7805 is rated to max current of either 1A or 3A (depending on the version) and only with an adequate heatsink.

If you need more current output (and you do), you can use a shunt circuit something like this:
http://www.rason.org/Projects/vreg/vreg.htm

R1 and R2 are used to increase the output voltage, so aren't necessary for your application.

you should also have a 5.1V Zener connected between Vout, and Gnd, which will clamp the voltage to a non-LED destroying level if the 7805 fails.

Nerobro
Nov 4, 2005

Rider now with 100% more titanium!
The kind I have are 1amp. I was aware of the need to heatsink ;-) Just not that acutely aware.

I apreciate the research you did. I've done biasing on linear vregs to adjust the output voltage before. However this will be a battery powered application, so I'd like to avoid the whole linear thing.

I like the ziener idea. I need to check to see what the failure mode of the smps is. If it fails safe, I won't bother. if it fails on, poof, there goes $5 in white leds.

Adbot
ADBOT LOVES YOU

UserNotFound
May 7, 2006
???

Nerobro posted:

The kind I have are 1amp. I was aware of the need to heatsink ;-) Just not that acutely aware.

I apreciate the research you did. I've done biasing on linear vregs to adjust the output voltage before. However this will be a battery powered application, so I'd like to avoid the whole linear thing.

But a bicycle is the perfect place for a heatsink: lots of air movement!

Also, maybe I didn't read your orignal post well enough, but you could put 2 LEDs in series for a 6.4V drop, which would halve the power wasted by the resistors and be closer in efficiency to a switching supply?

Actually, what you should look into is to is use a 555 timer to blink the lights very quickly. 99% of LED lights do this to save power.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply