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
Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...
Phew! I've crawled through the entire thread over the past two weeks, and I wanted to say thanks for all the great information in here (mtwieg - your OpAmp/Comparator article was especially informative). I have a plan for my first 'real' project, though I need a little advice on how exactly to go about it.

I'd like to make a battery-operated, analog electronic thermometer. Basically, the output would just be a line of LEDs of various colors, each corresponding to a minimum temperature (I'm hoping for an LED for each 5'c, from -20'c to 45'c). I've got a 10k Thermistor and all the LEDs I need (as well as various assorted resistors, capacitors, transistors, and diodes), however I'm not 100% on how I should set it all up yet.

My plan was to effectively have two 'units'. First, the temperature probe, which would have as intput a supply voltage, would contain the thermistor in parallel with a resistor (from what I had read this can help to provide a linear voltage output over the target temperature range). This voltage output would then be fed into the 'display', which I think would essentially be like a LED VU-meter: A cluster of comparator-LED circuits in parallel, each taking the probe lead as input and a differing reference voltage depending on the desired temperature the LED is supposed to correspond to. The other end of the LEDs would go to the power supply, via a ballast resistor for each LED (is there a better way to do this?)

Does this sound like a reasonable approach?

The basic circuit I had in mind looks something like this (All resistor values arbitrary ATM; pretend one of the ones on the left is the thermistor):


One other optimization I was thinking of would be to have the power to the LEDs be pulsed instead of always hot so as to save battery power. I have a bag full of 555s I could use, or would this be overkill? I'm still not 100% sure that I know how to drive an arbitrary number of LEDs in parallel and produce consistent current across each...

Adbot
ADBOT LOVES YOU

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

BattleMaster posted:

You need to make a voltage divider with the thermistor and a resistor, not a parallel circuit. If you match that 10k thermistor with a 10k resistor, the output should be VCC/2 at the optimal temperature. Edit: Okay, now that you added a diagram I can see that's what you were already doing.

The tricky part is that the thermistor increases or decreases its resistance on a curve rather than linearly so you need to compensate for that somehow. The typical way to do it would be to use a microcontroller with a conversion table in software, but that doesn't seem to be what you want. Edit: I see now that you don't really need it to be very accurate, with only three LEDs.
Well, that was just a reduction, because I didn't want to put 15 OpAmp/LED circuits down there :) But would a micro-controller really matter? Since I'm looking for thresholds ("Temperature greater than X for LED1, greater than Y for LED2," etc) can I just have my reference voltages scale non-linearly along with the curve of the thermistor? Either way, yeah I'm probably looking at 5'c per LED, so I don't need too much accuracy -- I'm mostly just struggling with getting the reference voltages right and the LEDs to not explode on me at this point.

This page was where I got the impression that I could just use another resistor to make the Thermistor circuit roughly linear -- is that not correct?

quote:

You would probably prefer using an LM35 temperature sensor, which accurately outputs 10mV per degree Celsius. The datasheet for the LM35 also includes an application note that tells you how to make a bar graph thermometer, but it uses a couple of ICs designed for that task which is probably not as do-it-yourself as you'd like.

That's cool, I may look into that (if not for this, than for the next evolution of the project).

e:

quote:

Edit: Holy poo poo, edits galore! I was looking at the datasheet for the bar-graph LED driver and you might want to rip off the schematic of its internals for your project.
Oh wow, that would be pretty perfect. I'm planning on doing some audio work later on, so I may grab a bunch of these anyways for building visualizers, if nothing else.

Hubis fucked around with this message at 21:07 on Dec 5, 2008

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...
OK, can someone help me figure out what bonehead problem I'm having with building a buffer for an audio circuit using an Op-Amp?

I'm starting to get into wiring up my own guitar pedals from scratch. I have mocked up some fairly ambitious circuit designs in the Falstad simulator, but I'm trying to wade very slowly into actually implementing the circuits to make sure I'm not overlooking any obvious problems.

Step 1: I've got a box which contains 2x1/4" TS jacks (input and output), wired to a 3PDT toggle as a true bypass. In the off position, my signal is passed straight through; in the on position, it goes to two leads which are wired to my breadboard. There is also a ground lead which connects the ground of the input and output cables, which is then wired to the ground of my breadboard.

Step 2: Wiring the leads together, I'm getting a clean connection in both on and off states, so my switch seems to be working.

Step 3: I have also seemed to wire a very simple passive low-pass filter using a 0.1 uF film cap and a 10K pot. All is well and good (although the effect isn't really all that impressive -- sounds more like a volume control than anything else).

Step 4: My problem. I'm trying to build my first active circuit now, which is just a simple OpAmp buffer between the input and the output. I'm using a 4558 dual-OpAmp I got from Small Bear Electronics, and the circuit looks like the following:

code:

            |[ -  9V Battery  + ]|
            |                    |
            |     ____  ____     |
            |    |    \/    |    |
            |   =|AOUT  +VCC|=---+
            |    |          |
            |   =|A-IN  BOUT|=---+---[OUT_signal]
            |    |          |    |
            |   =|A+IN  -BIN|=---+
            |    |          |
            +---=|-VCC  +BIN|=---+
            |    |__________|    |
            |                    |
            |                    |
[IN_gnd]=---+---=[OUT_gnd]  [IN_signal]

What I think I should be seeing/hearing is a voltage signal identical to the input on the output (which is plugged into a crappy 10W amp). What I am *actually* getting is the output pegged at +9v. Is there something I should be taking into account here that I'm missing? I've read that grounding the input to a follower like this will cause the Op-Amp to drive high due to a very small offset voltage bettwen the +IN and -IN; is it possible that the input voltage of my signal is totally wrong (like too quite, or needs to be offset somehow)? I was trying to make this circuit as simple as possible and still work, but maybe I made it a little too simple :downs:

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

ANIME AKBAR posted:

Well first of all, your op amp is supplied by nine volts. We'll call the negative terminal of the battery our ground (0V). So your buffer can only work with voltages in your supply range (0-9V). In the real world it can't even do that, and your usable signal range will never reach the supply rails, so you're actually stuck with maybe 1.5-7.5V. If your input signal is not in that range, it will not perform properly.

The audio signal going in is an AC signal, meaning it has no DC component. Since its ground connection is made to 0V on your circuit, this means that it will be centered (or rather biased) around 0V. So if your input is 1V in amplitude, the signal seen by the op amp input will range from -1V to +1V, relative to 0V. See the problem yet? That is outside the buffers operating range.

What you need to do is bias the input signal into the buffer's operating range. The easiest way to do that is to give your circuit what's called a dual supply. Meaning that it has two voltage sources. So use two 9V batteries in series. This gives you three voltage points. Let's now call the point at which the batteries connect to each other our 0V ground. Meaning at the other terminals of the batteries we get +9V and -9V. Connect these points to the op amp supply (in the correct polarity). Your op amp now has an operating range more like -7.5 to +7.5.

Now, connect everything else the same way except connect IN_gnd and OUT_gnd to the 0V point, instead of the negative supply of the op amp. Both the output and input are still biased around 0V. The thing, now your buffer's operating range includes that, due to the dual supply.

So essentially, do this:
code:
            |----[ -  9V Battery  + ]-----------------+
            |                                         |
            |                          ____  ____     |
            |                         |    \/    |    |
            |                        =|AOUT  +VCC|=---+
            |                         |          |
            |                        =|A-IN  BOUT|=---+---[OUT_signal]
            |                         |          |    |
            |                        =|A+IN  -BIN|=---+
            |                         |          |
            +--[ +  9V Battery  - ]--=|-VCC  +BIN|=---+
            |                         |__________|    |
            |                                         |
            |                                         |
[IN_gnd]=---+---=[OUT_gnd]                       [IN_signal]
Mind the battery polarities. Try that and see what happens.

Of course, that makes perfect sense. The two-battery configuration worked fabulously (although now there's some hum in the sound, which I assume is coming from the preamplifier not expecting a DC-offset in its input signal).

Do you have any suggestions on how I'd go about applying a DC-offset to the input using only a single battery? Every pedal I've ever seen or worked with uses a single bipolar supply (usually either 9v or 12v, unless it has tubes), so I assume there's a fairly simple solution. Looking at some simple schematics online like this one (posted earlier), it seems like they produce a +4.5v source (Vb) using a resistor divider, then somehow use that to pull up the input voltage. I'm not quite clear on how that works, however.

So, what do I have to modify to make this work:


(Thanks for the assistance, btw. There's a huge amount of really great resources for learning this stuff all over the internet, but all that bootstrapping turns to crap when something goes minorly wrong and you have no idea what the right questions are to find a solution ;) )

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

Hubis posted:

Of course, that makes perfect sense. The two-battery configuration worked fabulously (although now there's some hum in the sound, which I assume is coming from the preamplifier not expecting a DC-offset in its input signal).

Do you have any suggestions on how I'd go about applying a DC-offset to the input using only a single battery? Every pedal I've ever seen or worked with uses a single bipolar supply (usually either 9v or 12v, unless it has tubes), so I assume there's a fairly simple solution. Looking at some simple schematics online like this one (posted earlier), it seems like they produce a +4.5v source (Vb) using a resistor divider, then somehow use that to pull up the input voltage. I'm not quite clear on how that works, however.

So, what do I have to modify to make this work:


(Thanks for the assistance, btw. There's a huge amount of really great resources for learning this stuff all over the internet, but all that bootstrapping turns to crap when something goes minorly wrong and you have no idea what the right questions are to find a solution ;) )

OK, thinking about it a bit more, I came up with this:


Which should mix the AC input with the +9V DC leads to give me (9v + 1vAC) / 2 = 4.5v + Signal/2

Is this a sane approach? Should I be using lower value resistors in the mixing stage? Is there a way to do this without cutting my signal in half, or should I just add some gain to my OpAmp stage?

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

Delta-Wye posted:

I'll give a shot at this: if you unplug the analog input (just use the DC input) the resistor divider will bias the opamp input to 1/2 of 9V, or 4.5 V. The output will also go to 4.5V DC, but because there is a capacitor that blocks the DC component, the final output of the circuit is 0V. When you add a AC signal (guitar, whatever) it is superimposed on the 4.5V, amplified, and assuming the capacitor is correctly valued, passes through just fine.

Lets say you have an AC signal that is -.5/+.5 V (I want to say guitars look like 100mV p-p, but I'm going from memory and its not truly important anyways). The V+ input on the opamp will look like it is +4/+5 V as a result, and the output of the circuit should be -.5/+.5 V again.

(Just did a measurement; my guitar seems to put out around 10-30 mV if I clip the leads to the cable)

So I should have something that looks like this?


It seems to work in the simulator, at least. I've seen a lot of circuits use a capacitor in the input like this, which if I understand properly is to prevent overloading the inputs? Would I be better using a resistor there or something? I'm kind of at the stage right now where I can just think of capacitors as frequency-dependent resistors, but I'm not sure if that's always a valid assumption...

Also, how do I determine if my capacitor to remove the DC offset is the right size? I understand how high-pass filters work in terms of R-C circuits, but (based on your comments) in this case I am just running the output through a capacitor without a resistor shunt to ground. Is this ok, and/or does it simply require that I assume a high-impedance input on whatever this is plugged into?

e:

SnoPuppy posted:

Your first one was more correct. Just make sure to add a DC blocking cap to the input.

edit:
I'm also assuming that you're not grounding your + input. It looks like the ground wire is broken, but I just want to make sure.

Yeah, sorry for the confusion; that's a virtual scope lead that I left on the circuit when I took the screenshot.

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

ANIME AKBAR posted:

You've got the right idea. Your main concern will be your source impedance (in the case, the impedance of you pickups or whatever feeds into the input). You want the AC impedance of the biasing network to be low and the DC impedance to be high. The capacitor effectively kills all DC and passes all the AC. However the biasing resistors can still load down the AC signal, which is bad. So you should make those resistors bigger; like maybe bump them to 100K. Don't go to high or they'll lose their effect, though.

Also on the output you'll want another bias resistor coupling the output signal to 0V (the same thing the output ground connects to). This will result in a pure AC output (with respect to ground).

Here's what you'll end up with. Import this into the falstad simulator:
code:
$ 1 5.0E-6 37.11724081536377 50 5.0 50
a 560 400 656 400 1 15.0 -15.0
r 528 384 528 304 0 100000.0
r 528 384 528 464 0 100000.0
c 512 384 448 384 0 1.0E-6 3.3091063244183205
r 752 400 752 464 0 100000.0
c 688 400 736 400 0 1.0E-6 3.3085477228158027
g 752 464 752 480 0
g 528 464 528 480 0
R 528 304 528 272 0 0 40.0 9.0 0.0 0.0 0.5
w 656 400 688 400 0
w 736 400 752 400 0
w 512 384 528 384 0
w 528 384 560 384 0
w 560 416 560 464 0
w 560 464 640 464 0
w 640 464 656 464 0
w 656 464 656 400 0
r 384 384 304 384 0 100000.0
w 384 384 448 384 0
v 256 384 256 464 0 1 300.0 2.0 0.0 0.0 0.5
w 256 384 304 384 0
g 256 464 256 480 0
x 639 161 691 167 0 24 hello
o 19 64 0 35 20.0 3.90625E-4 0 -1
o 2 64 0 35 40.0 3.90625E-4 1 -1
o 16 64 0 35 20.0 9.765625E-5 2 -1
o 4 64 0 35 10.0 9.765625E-5 3 -1
The resistor directly from the AC source isn't an actual component. It's meant to symbolize the source's inherent impedance. Go ahead and play with its value and see what happens.

Awesome, I'll give this try and see if I have any more stupid questions

Adbot
ADBOT LOVES YOU

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

clredwolf posted:

Me and some friends had an impromptu 'poo poo that looks cool in a microwave' buildoff. Holy poo poo we had some awesome sparks. Best ones were:

-Spark gap with dipole antenna made from a coke can (held together with tape)
-coupled lines separated with some weird sticky goop we had lying around, connected to part of a dipole on each side
-spark gap with wires from a cat5 cable making a dipole

We had to have tried like 30 different ways to make sparks. I will try to get some video up at some point, phone has some weird proprietary video format.

So I ask you DIY...what is the biggest baddest microwave spark you can make?

Hint: A microwave is just a big oscillator firing into a cavity. Said oscillator oscillates at 2.4GHz.

My favorite piece of "Microwave Magic" was taking a couple grapes, slicing them in half so that only a small flap of skin connected the two halves and sitting them on a tray, spread open. If done right, you can create these brilliant blue/red balls of fire above the grapes, which is drat cool.

e: http://www.youtube.com/watch?v=_ux8nSWmAz0

Hubis fucked around with this message at 06:10 on Apr 19, 2009

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