Hands off, it's my next how-to at Fan Noise Solutions. A 4-channel controller, LM324 & 4 PNPs. The amplifier feed-back loop comes straight from the fan, so includes the transistor. With it being PNP, voltages around the opamp are well below the supply voltage, so rail-to-rail not needed.
Hi, I made the same circuit as you with CircuitMaker and simulated it, and probed the points where you had voltages. At the inverting input, I'm getting something like 9.4V instead of 2.4V. It rises to about 9.6 at the pot. How do you adjust the pot to bring it down to 2.4V?
Haha, geez, how'd you tell? Well I put it in the right direction and yeah I get 2.4V, but now the amp output is 3.318V How'd you get the multiple voltage points and display the voltagesin the schematic? Anyway, I couldn't find some part numbers in the database, like even the simple TIP series of transistors...or the BD140 that you used even. How'd you get those in your schematics?
I tried changing the PNP transistor to different ones, and I got different values for Vout from the 741, but it doesn't seem to affect the final voltage to the fan load. Why's that, and does it matter? Also, the 0-2.4V DAC output causes a corresponding 0-12V fan supply voltage. Is there any way to scale the voltage to 7-12V instead, so that all the resolution of the DAC is contained within that 5V usable range rather than the majority of the resolution being wasted on the unusable 0-7V range? An easy method I can think of would be to extend the DAC by 1 bit and hard coding the input of that bit to 1(or 2.5V). By doing so , only the 3 LSBs change, and this has the effect of scaling the voltage between roughly the upper half of the voltage range, i.e. 6-12V. Extending by 2 bits and hard coding them would scale the voltage between 9-12V, so the closest I can get is with 1 extra bit. Is there a better way with finer granularity?
Easy method I could think of is using a potential divider to compress and shift the DACs output, I dropped the feedback resistor down to 24k as it was pushing 12v for virtually the whole cycle, you can go higher than 24k, but the furthur you go the more bits your throwing away from your DAC, since you were concirned I chose something which doesn't clip. I'm addicted to sine generators, I just like seeing waveforms:
That's nice for just an extra 2 resistors. Does anyone know how to get more components for the CircuitMaker database? It doesn't have some of the parts that I use.
R6 and R7 are pretty flexible, it'll just change how much and by what you shift/compress the voltage and it's variation by, the values above are correct on the simulator, though the genterator is 'ideal' the output impeedance of your R2R DAC would change things. It's still true, but you probably don't need to care too much about it, if youve gone and deleted most of your post now
Yeah I deleted most of my post because I was doing things wrong before. The BJT was facing the wrong way, I forgot to rotate/mirror it Anyway, interesting point about my R-2R DAC, because I'm having some weird problems with it. Here's what it looks like: As can be seen, in the above case I'm testing the binary value 001, which should be converted to 1.5V. I'm using the 4N35 optoisolator to turn on the NPN transistor, which would then drive 12V to the appropriate DAC lines. However, with 0b001, U3 and U4 (and therefore Q3 and Q4) appear to be conducting as well, but with a much higher voltage drop(~2.42V instead of 5/12V). Also, the voltage into R9 is only 4.25V instead of 12V. Am I choosing the wrong transistors or something? I checked the ratings out and I think I'm staying within their limits.
You're using the transistors in emitter-follower mode, so output voltage = base voltage-0.6 at low currents. If the optos are full on, they'll drop about 0.2V, plus a small drop on the 330R resistor, so the best you can get on the emitters is about 4.2V whatever the collector voltage is.
Hmm, ok, so what should I do to use the opto as a switch to turn on/off Q2-4? I tried connecting the optos to +12V instead, but even when the detector isn't conducting(logic 0), I'm getting over 5V on the emitter side. Also, why does the emitter voltage for Q3 and Q4 depend on Vmod[0]? When Vmod[0] is 0V, Ve for Q3/Q4 are close to 0, which is fine. When Vmod[0] is 5V, then Ve for Q3/Q4 is over 5V, which doesn't make sense since they're not connected to Vmod[0] or U1 in any way.
Let's think outside the box a minute, instead of messing with R2R & such, you could use your binary signal to switch parallel resistors into place on an adjustable regulator. There's one on the front page of the NS 317T datasheet, but same method can be used with the low-dropout regs. Actually, with your opto circuit you may not need the transistors at all, the currents are low enough for the opto to handle and with no base potential to worry about they'll switch the same with load either side. CircuitMaker claims even with 5mA diode current there's only 260mV lost across the optotransistor, which ain't bad.
Thanks. I'm looking at the 317 datasheet now. Do you mean switch parallel resisters that would replace R2(the variable resistor)? How would the switches/resistors look like then? 3 parallel vertical resistors in series with an opto transistor below them, with the binary signal at the detector side of the opto? Regarding your 2nd point about the currents, you're talking about my circuit and not the 317 right? Are you saying that I won't need the NPN, and I can use the opto as a switch and directly connect the emitter to the 2K resistor at DAC input? Would the converted analog voltage have a high enough current to drive a fan though? edit: I tried taking out the transistor in my circuit, as described above, and with binary value 000 I'm only able to reach ~10.3V. The drop from the collector to emitter of the opto was pretty small, ~200mV, but the drop from the 2K resistor was quite a bit.
Yes, just as shown on the datasheet. With the 317, reducing R2 lowers the output voltage, so '111' (all switches on) would be minimum. With the Micrel LDOs used here, reducing R2 increases the output, so '111' would be max and '000' a preset minimum from a fourth unswitched resistor. You still need the Fig.4 voltage amplifier/current booster. Maybe you should look at using an opamp summing amplifier for the DAC. And/or tweak resistor values to compensate for VCE loss if you want exact steps.
Well, a R-2R DAC is cheaper and easier to build since resistors are basically free, so I'd prefer to stick with that if possible. It seems as if the opto is kinda messing things up with regards to setting the DAC input to ON state or OFF state. I extended my DAC to a 4-bit one and when I try 0000 and 1111, things are fine. The DAC output is close to 0V and 12V. However, when I try anything else, the 0's are never 0V, but rather some positive voltage. For example, as shown below, with 0010, the Vout should be ~1.5V, but I'm getting ~7V, because the emitter of U1 is over 4.7V, and that of U3/4 are ~7V. If I wire R20/R26/R15 directly to 0V, then Vout is ~1.5V, which is why I want. The reason, as I found out, is because the opto is just disconnecting the DAC input from 12V, it isn't actually pulling it to 0V. My question then is, how can I set it up such that the opto pulls the DAC input up to 12V when connected, and pulls it down to 0V when it's disconnected? Thanks.
Well, after thinking about it for a while, and messing around with many "solutions" that didn't work as expected, I managed to use a simple pull down resistor to bring the DAC input to 0V when the opto wasn't conducting. That took a while. Anyway, here's my circuit for now: The 2 wires on the RHS are the 2 voltage sources for the fan, which will be fed into an analog mux and only 1 of them selected. The left source is DAC output 7-12V, and the right output is user controlled(with trimpot) voltage. With the above setup, I'm able to get around ~7V-11.xV for both sources. Now I only have a couple more things to worry about for this part: 1) The opto in CircuitMaker is the 4N25, while I'll actually be using the 4N35, with a higher min CTR(100% vs 20%) and also a higher max VCE(sat)(0.5V vs 0.3V). I'm not sure what CTR is, but the higher VCE(sat) would just mean I get less voltage out of the emitter right(higher Vdrop). Nothing else seems to be different between the 2, so I guess it's a straight plug and play... 2) The value of the pulldown resistors R51-R54 change the Vout dramatically. 330ohm seems like the best value to use, but I didn't do any calculation, the value was chosen by simulation only. Is there anything I'm missing out on, regarding what the value of the resistor affects? 3) R18-19 are chosen to be large values so that the effective resistance of the R-2R circuit doesn't affect the voltage division by any significant amount. This is ok right? 4) Any problems running these 2 voltage through an analog mux? Would I need to boost the current before/after the mux so as to be able to drive the fans? Voltage is already at 12V so I'm guessing no amplification is required. Thanks guys, you've been really helpful.