# Using small signals

#### The Skeptic

Joined Dec 27, 2005
61
> Yes, you could. I try to do what I think will work best instead of what will use the fewest parts.

Sure. Tou seem to have very strong feelings against that first design: you said it's like begging for something to go wrong! Do you think things could mess up easier that way?

>> why are the middle boxes connected differently from the low ones?

> Because there's four ranges: below low, below medium, above medium, and above high.

Sure, but the rules to light yellow and red (connected to middle and low boxes) are similar -- i.e., if there is a signal below a certain threshold, the respective light turns on. So, since the middle outputs are connected to gnd via diodes, why shouldn't the red outputs go to gnd through diodes as well? When red is on, all the current flowing from the led is going into the comparator output (at 0V, of course) instead of going directly to gnd? So why don't you do the same with the yellow?

And just to make sure I understand things here:

- the high comparators should give +12 when one signal is above high
- the middle comparator should give 0 when one signal is below medium
- the low comparator should give 0 when one signal is below low

therefore all comparators should be conected with the threshold on the - input and the signal on the +.

>> I'd like to use lights of higher power than a LED (something around a few watts). Could I use relay+diode instead of a LED?

> Depending on the relay, the op-amps may not be able to do it. The datasheet for the TL084 says that the relay will need to have a resistance of at least 1000 ohms. I'm not so sure of that, I wouldn't be surprised if they could go as low as 300, in particular they won't even light those LEDs very well if they can't. (maybe they can't, I didn't test it...) I've seen datasheets that claim that the output current a TTL chip isn't enough to drive one of it's inputs, so I don't take datasheets too seriously. I think they just muck up the numbers in them so that if they sell you a broken chip they can say "we never said it would work that well" or something like that. The datasheet also says that you can short the outputs to ground continuously, so it won't break the chips at least, but what's important I suppose is wether or not the lights come on.

> You could probably swap the LEDs out for transistors (and change those 330 ohm resistors to 10k), then have those transistors switch some other transistors (otherwise the relay current still goes through the op-amps) and then have those transistors switch the relays, which would be the safe way to do it.

Why would just the relay be unsafe? And isn't the whole thing just a matter of searching parameter tables?

Oh, and what happens if the output signal should be above supply? This is the saturation that leads to a output = +Vsupp?

#### peajay

Joined Dec 10, 2005
67
> Do you think things could mess up easier that way?

Yes. Of course, I'm wrong sometimes, but I just don't like it.

> Sure, but the rules to light yellow and red (connected to middle and low boxes) are similar -- i.e., if there is a signal below a certain threshold, the respective light turns on. So, since the middle outputs are connected to gnd via diodes, why shouldn't the red outputs go to gnd through diodes as well? When red is on, all the current flowing from the led is going into the comparator output (at 0V, of course) instead of going directly to gnd? So why don't you do the same with the yellow?

What's going to ground? The left side of the middles that goes to the transistor? The right side of the middles and lows are connected identically for the yellow and red LEDs.

The connections on the left are there so that when middle is high, because one of the signals is normal or high, the high voltage triggers the transistor which supplies a low voltage for the green LED.

> And just to make sure I understand things here:
>
> - the high comparators should give +12 when one signal is above high
> - the middle comparator should give 0 when one signal is below medium
> - the low comparator should give 0 when one signal is below low

Yes, six comparitors, all inverting inputs go to reference voltages, all non-inverting inputs go to signals.

> Why would just the relay be unsafe?

If the op-amp can't supply enough current to trigger it, then the light won't light. You also need 9 volt relays, as that's all you'll have left once you get past what the op-amps don't deliver and what the diodes strip away.

> And isn't the whole thing just a matter of searching parameter tables?

The datasheet says you need a relay with a coil resistance of 1000 ohms or more for 12 volts, I didn't think to look up 9 volts, but it will be a lower resistance.

> Oh, and what happens if the output signal should be above supply? This is the saturation that leads to a output = +Vsupp?

From a resistance that is too low or too high? Yeah, it'll be either 0v if it's too low, or 10.5v if it's too high, I think.

#### The Skeptic

Joined Dec 27, 2005
61
> What's going to ground? The left side of the middles that goes to the transistor? The connections on the left are there so that when middle is high, because one of the signals is normal or high, the high voltage triggers the transistor which supplies a low voltage for the green LED.

Okay, before this I actually hadn't read about bipolar junctions to understand how that connection to gnd works [embarrassed]. I thought that he green would always have 0V in its bottom side. And how do I specify the transistor and the diodes?

>> And isn't the whole thing just a matter of searching parameter tables?

> The datasheet says you need a relay with a coil resistance of 1000 ohms or more for 12 volts, I didn't think to look up 9 volts, but it will be a lower resistance.

And what be the problem with that? Anyway, wouldn't a solid-state relay be more durable and better than a mechanical one -- and have no coils? If ss relays are okay, how do we choose between them and transistors?

An opinion: "In summary, a transistor is fast, switches a small current, has a long lifetime and works with dc only. Whereas a relay is slow, can switch a large current, has a shorter lifetime and works with ac or dc." http://www.plcs.net/chapters/transout28.htm. What do you think? THis looks like an interesting question to ask around.

Oh, and there's another thing: what if we picked the higher signal using a diode gate and then proceded to the rest of your circuit removing the double boxes to add single boxes?

#### peajay

Joined Dec 10, 2005
67
> And how do I specify the transistor and the diodes?

You mean which ones do you get? It doesn't matter, any will work.

>> The datasheet says you need a relay with a coil resistance of 1000 ohms or more for 12 volts, I didn't think to look up 9 volts, but it will be a lower resistance.
>
> And what be the problem with that?

Nothing, as long as you get a 9 volt relay with a coil resistance of 1000 ohms or more.

> Anyway, wouldn't a solid-state relay be more durable and better than a mechanical one

I've never used one, but I don't see why you couldn't.

> If ss relays are okay, how do we choose between them and transistors?

There's quite a price difference, solid state relays start around $3, transistors start around$0.05. So if you can use a transistor instead, then that's what you do.

> What do you think?

I think I'm going to fall asleep.

> Oh, and there's another thing:

Of course there is.

> what if we picked the higher signal using a diode gate and then proceded to the rest of your circuit removing the double boxes to add single boxes?

You're going to be really embarrased when you figure out the answer to that one.

#### The Skeptic

Joined Dec 27, 2005
61
>> If ss relays are okay, how do we choose between them and transistors?

>There's quite a price difference, solid state relays start around $3, transistors start around$0.05. So if you can use a transistor instead, then that's what you do.

That was simple.

>> what if we picked the higher signal using a diode gate and then proceded to the rest of your circuit removing the double boxes to add single boxes?

>You're going to be really embarrased when you figure out the answer to that one.

Hmmm... lemme see... a comparator is not a diode gate, because it's pretty much like an op-amp, which is not a diode gate (and plus, a comparator only gives +V or 0, not one compared voltage or the other).

And yes, I see that each double box of yours is a diode gate, but your inputs to the gates (the boxes) were the outputs of comparators. I propose that you use one diode gate to sort out the highest voltage, compare it to the high threshold and take the output to the green, thus eliminating the need of one comparator. And maybe there is a way to get another kind of gate to produce the lowest voltage, which would then be connected to the yellow and red boxes. My idea was to eliminate at least half of the comparators (3) this way. If we use a diode gate with inverted diodes do we get the lowest voltage as output?

Or maybe now I am going to get even more embarrassed...

#### peajay

Joined Dec 10, 2005
67
> Or maybe now I am going to get even more embarrassed...

No, I think you're on to something there, that just might work. You'd have to adjust the reference voltages a little to account for the voltage drop of the diode, but that's not a big deal. For the high side, you just have those two diodes, and where they join you put like a 10k resistor to 0v (otherwise the point may just float high).

For the lowest voltage, you just do the opposite. Put the diodes in the other way, and have a resistor going to 12v.

Then when one voltage is above the high mark, it supplies the positive voltage to the three lights. Red and yellow are obviously when the low voltage is below low and middle, and then the green is when the low voltage is above middle. So you'd need four op-amps total, the one going to the green light being connected backwards.

You could perhaps just use a transistor to invert the output of the middle op-amp and so only use three, but since there's four op-amps to a chip, that would be pointless.

Excellent idea there, I didn't see that one at all.

#### The Skeptic

Joined Dec 27, 2005
61
> Then when one voltage is above the high mark, it supplies the positive voltage to the three lights. Red and yellow are obviously when the low voltage is below low and middle, and then the green is when the low voltage is above middle. So you'd need four op-amps total, the one going to the green light being connected backwards.

Do you mean four comparators? One for each light, plus...?

> You could perhaps just use a transistor to invert the output of the middle op-amp and so only use three, but since there's four op-amps to a chip, that would be pointless.

I didn't get this inversion thing.

> Excellent idea there, I didn't see that one at all.

If I have seen further... ;-)

#### peajay

Joined Dec 10, 2005
67
> Do you mean four comparators? One for each light, plus...?

One for each light plus one for all of the lights.

> I didn't get this inversion thing.

That's a good thing I suppose, because now that I think about it, what I said wouldn't have worked correctly.

Ok, we've got the three reference voltages and four op-amps. (I can't turn the lights on, so drawing a schematic isn't possible at the moment.) Op-amp A's + input goes to the high signal, it's - input goes to the high reference voltage, it's output goes to the three resistors for the three LEDs. Op-amp B's + input goes to the low signal, it's - input goes to the low reference voltage, and it's output goes to the red LED. Op-amp C's + input goes to the low signal, it's - input goes to the middle reference voltage, and it's output goes to the yellow LED.

Now op-amp D, it's + input needs to go to the 6 volts line, it's - input needs to go to the output of op-amp C, and it's output goes to the green LED. That way the green LED is the opposite of the yellow LED, which is what we want.

#### The Skeptic

Joined Dec 27, 2005
61
I'm sorry I took so long to answer. Let's do this one thing at a time. I bought the following parts:

- Two NPN transistors TIP29A (one is 210S and the other is 048S. Can't figure what this is) for high current (1A). Unfortunately, I need 3 of them...

- Five NPN arrays LM3046 (only 50mA)

- A bunch of 1N4148 diodes.

- A bunch of leds which I thought I could use instead of diodes to help me see what's going on.

- Eleven LM301A op-amps and seven LM741 op-amps

Well, before I build the circuit, I started with the Wheatstone bridges. Since one leg of is constant and the same for both bridges, I had them share this leg, which is composed of only two 470 resistors. In Ω the other legs I connected two 470s with a 5Ω in the middle (1Ω was too little to compensate for the resistance difference). The 5Ωs are shunted with 1KΩ potentiometers for bridge calibration. To mimic the 470 variation, I shunted to it a potentiometer in series with another resistor.

The problem is that calibration is not so easy because voltage keeps changing, usually +-.1 or .2mV, sometimes even +-.5mV (I'm using a very simple UNI-T DT830B multmeter, and the lowest scale is 200mV with .1mV precision). I guess this could be a real problem, since the voltage thresholds to which it will be compared are close to 0. I hope I'm wrong.

Well, I also tested the diode bridge and noticed that the voltage drop across diodes is substabtial, even when output current is flowing only into the voltmeter. So, if I want to use the diode bridge output into a comparator, either I calculate the necessary corrections or I also connect a diode between the tension divider and the comparator. I hope I'm wrong again.

#### peajay

Joined Dec 10, 2005
67
> - Two NPN transistors TIP29A (one is 210S and the other is 048S. Can't figure what this is) for high current (1A). Unfortunately, I need 3 of them...

That's one of those big ones, isn't it? In a TO-220 package?

A simple 2N3094 would have worked, and they're only 7 cents each.

Unless you're planning to power something large, in which case you should have gotten MOSFETs instead.

The last time I bought MOSFETs I got IRFZ14, I assume because it was the cheapest I could find. It's $0.52 over at Digikey, and it's good for 10 amps. Transistors just aren't any good for high current applications. > - Five NPN arrays LM3046 (only 50mA) Transistor arrays? I've never heard of such a thing. Oh my, those things are$2.79 each and only contain four transistors!

Seriously, 2N3904 and 2N3906, you can get them over at Jameco, you can get 100 of each for about $12. > - What was that? > - A bunch of 1N4148 diodes. Oh, yeah, ok... > - A bunch of leds which I thought I could use instead of diodes to help me see what's going on. LEDs have a much larger voltage drop than normal diodes, and they also require a certain amount of current to light. So there's usually nothing to see, if the circuit even still works. > - Eleven LM301A op-amps and seven LM741 op-amps Not the "single op-amp to a chip" variety! The LM324 has four op-amps to a chip, and cost$0.25. Eighteen op-amps (or actually, twenty) in LM324 costs $1.25. I'm thinking you spent at least$8.50 there.

> To mimic the 470 variation, I shunted to it a potentiometer in series with another resistor.

What?

> The problem is that calibration is not so easy because voltage keeps changing,

Are you measuring the voltage output of the amplifier? 1mV is irrelevant. The voltages you'll be comparing against are going to be like a least a volt apart, 1mV is 0.1% of that. Just measure the output of the amplifier and get it as close to zero as you can manage in five seconds, and that will be close enough.

> Well, I also tested the diode bridge and noticed that the voltage drop across diodes is substabtial,

About 0.7 volts? Yeah, that's normal.

> So, if I want to use the diode bridge output into a comparator, either I calculate the necessary corrections

Yes, that's what I said you'd have to do. It's just a matter of using different reference voltages that are offset by 0.7 volts, it's nothing complicated.

#### The Skeptic

Joined Dec 27, 2005
61
>> - Two NPN transistors TIP29A (one is 210S and the other is 048S. Can't figure what this is) for high current (1A). Unfortunately, I need 3 of them...

> That's one of those big ones, isn't it? In a TO-220 package?

Exactly.

> A simple 2N3094 would have worked, and they're only 7 cents each.

I'm planning 1A max. I suppose you mistyped the number, that one has a pretty odd package. The 2N3094 datasheet says 110Amp RMS SCRs.

> Unless you're planning to power something large, in which case you should have gotten MOSFETs instead.

Well, it's probably in the 0.3-1A range.

> The last time I bought MOSFETs I got IRFZ14, I assume because it was the cheapest I could find. It's $0.52 over at Digikey, and it's good for 10 amps. Note taken. >> - Five NPN arrays LM3046 (only 50mA) > Oh my, those things are$2.79 each and only contain four transistors!

Oh my...

> Seriously, 2N3904 and 2N3906, you can get them over at Jameco, you can get 100 of each for about $12. Oh, those numbers make sense. Note taken. > LEDs have a much larger voltage drop than normal diodes, and they also require a certain amount of current to light. So there's usually nothing to see, if the circuit even still works. Steep learning curve, eh... >> - Eleven LM301A op-amps and seven LM741 op-amps > Not the "single op-amp to a chip" variety! The LM324 has four op-amps to a chip, and cost$0.25. Eighteen op-amps (or actually, twenty) in LM324 costs $1.25. I'm thinking you spent at least$8.50 there.

We newbies like to do stupid things.

No, they are local stores, and clerks know nothing of the subject. I took the specifications myself...

>> To mimic the 470 variation, I shunted to it a potentiometer in series with another resistor.

>What?

We're simulating the resistence change in a strain gage. The resistor whose resistance is supposed to change in this circuit is a 470Ω. Since I can't do that directly, I use a large resistance potentiometer in series with a large resistance fixed resistor, and this set in parallel with the 470. The whole set resistance varies very little around 470.

> The problem is that calibration is not so easy because voltage keeps changing,

Are you measuring the voltage output of the amplifier?

No, I didn't even begin testing the amps. I'm talking about the bridge output. That's why a .2mA variation seems too much.

> Yes, that's what I said you'd have to do. It's just a matter of using different reference voltages that are offset by 0.7 volts, it's nothing complicated.

Ok.

#### The Skeptic

Joined Dec 27, 2005
61
>> - Two NPN transistors TIP29A (one is 210S and the other is 048S. Can't figure what this is) for high current (1A). Unfortunately, I need 3 of them...

> That's one of those big ones, isn't it? In a TO-220 package?

Exactly.

> A simple 2N3094 would have worked, and they're only 7 cents each.

I'm planning 1A max. I suppose you mistyped the number, that one has a pretty odd package. The 2N3094 datasheet says 110Amp RMS SCRs.

> Unless you're planning to power something large, in which case you should have gotten MOSFETs instead.

I weas planning 4W lightbulbs, which I already bought. Maybe more. Given our 12V, that's at least 0.33A.

> The last time I bought MOSFETs I got IRFZ14, I assume because it was the cheapest I could find. It's $0.52 over at Digikey, and it's good for 10 amps. Note taken. >> - Five NPN arrays LM3046 (only 50mA) > Oh my, those things are$2.79 each and only contain four transistors!

Oh my...

> Seriously, 2N3904 and 2N3906, you can get them over at Jameco, you can get 100 of each for about $12. Oh, those numbers make sense. Note taken. > LEDs have a much larger voltage drop than normal diodes, and they also require a certain amount of current to light. So there's usually nothing to see, if the circuit even still works. Steep learning curve, eh... >> - Eleven LM301A op-amps and seven LM741 op-amps > Not the "single op-amp to a chip" variety! The LM324 has four op-amps to a chip, and cost$0.25. Eighteen op-amps (or actually, twenty) in LM324 costs $1.25. I'm thinking you spent at least$8.50 there.

That's why I asked what parts I should buy... We newbies like to do stupid things.

No, they are local stores, and clerks know nothing of the subject. I took the specifications myself...

Since they do not have a lot of different ICs in stock, I just took a few different specifications and bought whichever of them they had.

>> To mimic the 470 variation, I shunted to it a potentiometer in series with another resistor.

>What?

We're simulating the resistence change in a strain gage. The resistor whose resistance is supposed to change in this circuit is a 470Ω. Since I can't do that directly, I use a large resistance potentiometer in series with a large resistance fixed resistor, and this set in parallel with the 470. The whole set resistance varies very little around 470.

>> The problem is that calibration is not so easy because voltage keeps changing,

>Are you measuring the voltage output of the amplifier?

No, I didn't even begin testing the amps. I'm talking about the bridge output. That's why a .2mA variation seems too much.

> Yes, that's what I said you'd have to do. It's just a matter of using different reference voltages that are offset by 0.7 volts, it's nothing complicated.

Ok.