555 design - output to soundcard line-in, and modulating R2

Status
Not open for further replies.
I can respect that it is a bad design, thanks for explaining why. Just out of interest, could I trouble you to briefly explain why an op amp reduces the effects of fluctuations in the transistor's beta? I've ordered some samples of the mcp6021, hopefully they won't take too long.

Perhaps this is also a silly question, since you already said that I needed a rail-to-rail input/output amp. Until I receive them in the mail, I was wondering about an alternative way to use the TL082. If I use a +/-12V supply, is it possible to have the TL082 output set close to 5V? I'm wondering basically if it the TL082 is running at +/-12V, then the outputs/inputs don't have to be close to either rail. I think this is theoretically suitable for gating the timing parts of the circuit, is that correct? I'm assuming that I can then still run the 555 and flipflop @ 5V using a regulator and keep that part of the circuit the same. Is this a feasible work around until I get the proper amps?
 
Here is an explanation of how the circuit works (refer to schematic in post #11):

*************************************************
V(R3) = Vcc*(R3/(R3+Rsense))
V(R2) = V(R3)
I(R2) = V(R2)/R2 = V(R3)/R2, due to op amp feedback
Substituting, I(R2) = Vcc*(R3/R2)/(R3+Rsense)
But Rsense >> R3
Therefore, I(R2) ≈ Vcc*R3/(R2*Rsense)
IE(Q1) = I(R2)
IC(Q1) ≈ IE(Q1) (e.g., if beta = 200, then IC(Q1) = 0.995*IE(Q1))
Therefore, IC(Q1) ≈ Vcc*R3/(R2*Rsense)
The waveform at pin 6 of of the 555 is a sawtooth.
The width of the rising ramp is
t1=(Vcc/3)*C1/IC(Q1)
The width of the falling edge is
t2=0.693*R1*C1
T=t1+t2

Let Vcc=5, Rsense=5Meg, R3=100k, R2=750, R1=470, C1=4.7nF
IC(Q1) ≈ 5*100k/(750*5Meg)
IC(Q1) ≈ 133uA
t1 = (5/3)*4.7e-9/133e-6
t1 = 58.75uS
t2 = 0.693+470*4.7e-9
t2 = 1.55uS
T = t1+t2 = 60.3uS
Fosc = 1/T = 16.6kHz
Fout = Fosc/2 = 8.3kHz
*************************************************

The actual frequency will be a little less, due to the approximations made, and to the switching delay times of the Schmitt trigger internal to the 555.
 
You can use a TL082 by connecting V+ to 12V, and V- to GND. Add a 1N4148 from base to emitter of the PNP, anode to base.
Vcc for the rest of the circuit can be 5V.
For all circuits, add a 100nF cap from the op amp's +V pin to ground. If you are using a bipolar 555, add a large value cap (10-100uF) from the 555 +V pin to ground, in parallel with 100nF. If you are using a CMOS 555, the big cap is optional, but still a good idea.
 
Last edited:
Guess I'm still a little confused about the AC coupling. Thought the line-in of the soundcard was already AC coupled, but that I had to use a divider to reduce the amplitude AC fluctuations. Did I get the AC coupling correct in the attached SPICE schematic?

Also, I added the tl082, is this the type of setup you were suggesting?

Thanks for the explanation of the circuit. Still kind of foggy as to how the op amp compensates for the changes in transistor's beta. Is it because you're feeding back the op amp from the emitter, and not directly from the op amp out (i.e. from the transistor's base)?
 

Attachments

  • force-frequency tl082.asc
    3.3 KB · Views: 166
I think you're correct about the input being AC-coupled. Brain fart on my part.
Your attenuator will work, if you're sure the input resistance is 100k. I did a little searching and the consensus was that the input resistance depends on the mfr, and can be as low as 1k, or as high as 100k.
The other end of the 100k needs to be connected to ground. What is the 47pF supposed to represent? If it's the shunt input capacitance, it needs to be in parallel with the 100k, not in series.
If you're not sure of the input resistance, we can come up with a circuit that can work.
In your TL082 circuit, your diode is backward. Your supply will work, but stacking 7V on top of 5V is a little strange. I suppose you did it because you plan to use a 5V regulator.
 
In regard to previous post, yep, thanks for pointing out the diode was backward. by the way, what is the point of this diode? I don't have any high speed switching diodes around, but I do have a few zeners (4733, 5242B, 4755) and a germanium diode (1n34a), would they be appropriate substitutes at all?

yea.. stacking the supplies is a bit ugly on the schematic, but I didn't want to bother adding a regulator. So the 5V battery does just represent the output from a 5V regulator operating on the larger 12V source.

as for the 47pF cap in series with the circuit ground and line-out ground, I don't know why I put it there. Putting a cap there was the only way I could generate a +/-1V signal without a voltage divider. Obviously that's not a good idea, because you keep indicating that the ground of the line-out should be directly connected to the circuit ground. So, there's obviously something I'm still not getting about the output>sound card design. If the line-in ground is attached to the 555's circuit ground, how will it possibly generate a signal that varies between +1 and -1V? How does the -1V come about if the lowest potential is the circuit ground?

I've corrected the diode orientation, and uploaded the most recent schematic with this post. Perhaps I could trouble you to amend this schematic to add the line-outputs as you see fit?

I have measured the impedance of the line-in, and it is 10k (not 100k, I misread my multimeter previously) on my laptop. The other thing that puzzles me is the coupling capacitor on the inside of the line-inputs (on the sound card). Like we previously agreed, the audio line-inputs on a sound card are AC coupled.. But this means that the capacitor can't be in series with the line-in-signal lead, and the line-in-ground lead. If it was in series, there would be no conductance between line in ground and line in signal leads, but there is, its got a 10k impedance. So is the AC coupling cap inside the audio line-input in parallel to the 10k resistor? Moreover, I can't even find any information online that says how big that coupling cap is. Some audio forms talk about 4.7uF, others 1uF, others 0.1uF...

Either way, could you please amend the attached schematic to generate an appropriate +/-1V signal. Thanks again, Ron.
 

Attachments

  • force-frequency tl082 v2.asc
    2.9 KB · Views: 148
If you are reading 10k input resistance with a multimeter, the AC input impedance is guaranteed to be lower, but it is difficult to measure without an oscilloscope.
Attached is probably how I would approach a driver for an unknown input impedance which is probably greater than 1kΩ.
The diode type is not too critical, and is there to protect the base-emitter junction from reverse breakdown during the short time that the power supplies are coming up. it may or may not be needed. I wouldn't use germanium. A zener would be OK, I guess. You should get some 1N4148's or 1N914's (basically the same part). They are really cheap, and universally available.
 

Attachments

  • force-frequency.asc
    4 KB · Views: 162
Okay.. I see how the internal organization of a line-in works now. I'm guessing that the actual ADC would be represented by R8, or at least is in series with R8?

Also, is the cap inside the line-in actually a 100u? I couldn't find that info online... the AC signal becomes stationary a lot quicker if this cap had a lower capacitance. Can't change it either way, and regardless of value the signal becomes stationary. I'm just interested in knowing for my own technical knowledge.

On the right side of C2, I can see that the voltage settles to +/-1V after about 350ms or so. However, until the AC signal settles and becomes stationary about 0, there is initially a 2V potential against GND. Would that not be a possible source of damaging the card? However, even in the first 350ms, regardless of the DC offset, I understand the AC peaks of the signal don't exceed +/-1V relative to the mean potential, so perhaps that's all that really matters. I could see why this design would then be considered safe. However, I just wanted to make sure since the potential on the right side of C2 is still actually 2V against the circuit GND for a significant period of time. Again, I obviously trust your design, just want to clarify the theory of operation.

Found out this week that the Kinesiology department where my lab is located has a workshop, and it is stocked quite lavishly with electronic components, and also a few oscilloscopes. There's a workshop supervisor, and he's going to help me run this through with the oscilloscope today, then I'll hook it up to the sound card and see what how it works. I'll post some of the data I capture through the sound card (the resolved peak frequencies) that I'll collect while I'm pressing on the sensor while it is set on top of one of our AMTI OR6 force plates. I'll include the real force data as well, I can easily handle the calibration, but it may be of interest to someone else browsing the forums in the future.
 
Okay.. I see how the internal organization of a line-in works now. I'm guessing that the actual ADC would be represented by R8, or at least is in series with R8?
The ADC input would be connected to R8, possibly after some conditioning circuitry.

I don't know the cap value. It is probably much lower. I also don't know the value of R8. It may be much higher. In order to get low frequency response down to 20Hz (sort of a de facto audio standard), the C2 * R8 time constant must be greater than 8 milliseconds, e.g., if R8=1k, C2>8uF. If R8=100k, C2>80nF. R8 represents a resistor in parallel with whatever connects to it (ADC, signal conditioning circuit, whatever).

I'm pretty sure that sound cards have some sort of overvoltage protection, which I did not attempt to model. The mfrs have to make their boards, if not idiot-proof, at least retarded-proof.

 
Things are going pretty well with the project. I actually just received some MCP6021s, so I've used that in place of the LT1218s originally suggested. I've got it assembled, powered by a 9V battery and 5V regulator, and its doing pretty much what I'm expecting. I've made one other change, I've put in a 30k resistor between Vcc and the collector of the PNP that regulates the 555 timing. The reason for doing so is that my sensors are actually closer to infinite resistance at rest, not 5MOhm. This resistor let's the circuit rest at 4kHz when there's no force applied to the sensor.

However, the whole circuit is very sensitive to feedback from my computer. I've got it hooked up to my laptop audio line-ins, and there's two types of feedback I'm noticing. 1. When the laptop is plugged into the AC mains, the frequency of the 555 jumps up. 2. whenever I touch the cursor touch pad on my laptop, the frequency jumps up even more significantly. What's interesting is that, if I'm also touching the circuit ground, the effect is mostly blunted.

Not sure why this is happening, but I have a hunch that the ground potential is being lifted and hence the capacitance at C1 is decreased. Maybe that's not the case, but regardless, is there any way to better isolate the circuit from these effects?

EDIT:
the problems is less prominent with the TL082 in the circuit, so I've kept it in there for now. When the circuit is hooked to my laptop and my laptop is running on battery power, the output of the timing circuit is near perfect! It also seems pretty immune to any feedback from me touching the laptop. The problem seems to be a 60Hz inductance, because, if the laptop is on my lap, and I even so much as touch the ground of the laptop AC adapter before plugging it in, the circuit output gets very noisy. I captured a few seconds of data on from the sound card, and sure enough, looking at the waveform it seems that the frequency of the timer output is biased up and down about 60x per second.

Would an audio isolation transformer fix the problem? I know they're used to avoid ground loops, but I might just get a backward inductance of the 60Hz noise with the trasnformer, is that likely? Also, I don't have any around, and while I could probably go buy one, is there another solution to filter out the fluctuations in the ground potential? I mean, there's gotta be another way, because this problem doesn't happen why my ipod is hooked up to my laptop, and I find it hard to believe that there's an isolation transformer in my ipod.
 
Last edited:
You wrote:
I've got it hooked up to my laptop audio line-ins
I assume your sound card has stereo inputs. Are you using both of them? Describe how you have the circuit connected to your laptop.
 
Using the transistor switching in the posted schematics. Yep, card is stereo, I've tried most permutations of hooking up the two channel lines and ground: 1, both channels tied to transistor and ground to ground; 2, only one channel line tied to transistor, the other not attached to anything, and ground to ground; 3, one channel tied to transistor and othe channel and ground both connected to ground.

I think I may go out and get a high speed opto isolator and just hook up a second battery to power the line out only. Other than digital isolators like the iCoupler etc, which I don't know where to get locally, optocoupled with an independent power source may be the easiest. That make sense?
 
I can't remember if I told you to add a 100nF decoupling cap from each IC power pin to ground. This is very important.
Put them as close to the ICs as possible, and keep the leads short. You should also have a 10-100uF cap from +5V to ground.
 
Is the force sense resistor remote from the rest of the circuit? If so, how far away is it, and how do you have it connected?
 
yea... the sensor leads are connected with some long leads that span the circuit, kind of dirty at the moment. It is still on a solderless breadboard. But I don't think that's the source of the issue, because the problem persists even when the sensor isn't connected, and the non-inverting input is just tied through the 100k resistor to the positive rail.
 
Maybe the emitter follower (the NPN) is oscillating. Try adding 100 ohms in series between the emitter and the cable (or whatever you used to connect to the sound card). Keep the resistor as close to the emitter as possible.
Emitter followers are notorious for oscillating when they have capacitive loads. A cable is a capacitive load.
 
Maybe you have a ground loop.Is the circuit's power supply plugged into the same outlet as the computer?
 
no ground loop, its powered by batteries.. I've even tried an optoisolator, with a separate 1.5v battery running the outputs (CNY17-4)... no luck, frequency output still gets dirty when the laptop is plugged into the AC outlet
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…