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

Status
Not open for further replies.

richab2

New Member
Hello,

First time posting on the forums, and am hoping I can get some design help for a pretty straight forward 555-based circuit, but I have some tight constraints on how I need it to operate.

The goal of the intended circuit is to use a Flexiforce pressure sensor to modulate the frequency of a 50% duty (t1 = t2) 555 pulse generator. I hope to record the output with the line-input of a soundcard, and so I need to DC offset the output to +/- 0.5. Basically, I want to generate a frequency modulated signal that can be recorded by a computer sound card where frequency will scale with the force applied to the sensor.

Moreover, I need to get a decent estimate of force applied to the sensor at a timescale with approximately 1ms resolution, so the 555 frequency needs to be >2kHz... I'd like to have it scale between 8kHz and 24kHz to avoid any sampling problems. According to the Nyquist theorem, this gives me a padding factor of 4 orders of magnitude for resolution at the low end, and high end (I will sample the signal at 96kHz with the sound card).

As I understand it, I can eliminate R1 because t1=t2 for an equal high/low time. So, the resistivity across R2 has to be modulated by the force on the force sensor. The flexiforce sensors have >5MOhm at rest, and when pressing as hard as I can on the sensor it reduces to 2MOhm. This is obviously not compatible with the requirements for R2 resistivity in a 555 circuit. By my calculations, with a 0.1uF capacitor, to get an output between 8kHz and 24kHz, I need to modulate R2 value between 600Ohm and 1.8kOhm.

Question 1: How can I use resistivity of the flexiforce sensor to scale resistivity across another component?

I'm assuming that using the flexiforce sensor to modulate current flow though Base to Emitter of a transistor could potentially modulate the resistance across the Collector to Emitter. So, I presume the solution would be replacing R2 with the Collector/Emitter ends of a transistor. but how do I do the calculations required to keep this between my goal of 600 and 1800 Ohms? Maybe I'm way off entirely with this idea though.

Furthermore, what would be the best way to offset the output to +/- 0.5V. My device needs to be portable, and will use a 9V batter and 5V regulator. I have some negative charge pumps to generate -5V, but if I can avoid this, and instead use a virtual ground (0-Rx-2.5v-Rx-5v) I'd rather this.

Any suggestions? Thanks in advance.

Brian
 
its continuous... the impedance changes as a function of force. or do you instead mean to ask how fast the force on the sensor is changing? If that's your question, its used to measure time to contact when its being tapped on with your finger, and I need millisecond accuracy for determining contact time. I know there's other ways to measure time of contact, but a pressure sensor is the most suitable for my application for a bunch of reasons. I will do the contact time measurements afterward on the PC with a time-frequency analysis using the recorded waveform.
 
Last edited:
First off, why are you so hung up on feeding a min frequency of 8Khz into the LineIn of a sound card? The frequency response of that input is good down to ~30Hz ( no response down to DC because there is a DC blocking capacitor in the input path).

If you are looking for short duration taps on the sensor, why not just record the base band output directly (with no frequency modulation)?
 
Last edited:
Thanks for your response, Mike. In response to your first concern, im concerned with a fast minimum frequency because of the time required to resolve the frequency. For example, a 30Hz signal takes at best 33ms to resolve. As I stated in my original post, I would like millisecond accuracy in resolving the frequency (ie force), an I'd like to pad it with some extra samples for certainty. In doing a time-frequency analysis, like sliding a windowed FFT, I would like to make sure the measurements are consistent, and avoid signal noise from one period to the next. so to resolve frequency at every millisecond, I'd like to have at least 8 samples to acquire an average period over (ie 8kHz at slowest). That's why I'm hung up on frequency. At the top end of frequency limits, I think I explained it well the first time with referring to the sampling requirements for reproducing a signal (ie nyquist theorem).

Not sure what you mean by recording base band output? Could you explain please.

And yep, I know about the DC blocking capacitor. While I could even measure contact time through analog sampling and looking for voltage spikes, I would also like the possibility of examining peak contact forces. Hadnt originally indicated this, but this is one of the reasons I am using a pressure sensor, not binary on/off contact sensor of sorts.
 
If you use the force sensor to create a voltage that is proportional to its resistance (a single opamp would do that), and you fed that to a normal data acquisition system, as long as you sample at least 2X the highest frequency component in the signal, you can reconstruct the signal, from DC to 1/2 the sampling frequency. This is called Baseband in the trade.

Using a soundcard instead of the a normal data acquisition system means that the signal is differentiated below ~30Hz. The only reason for Frequency Modulating the original signal onto a carrier frequency is if you need the components below 30Hz...
 
Last edited:
Assuming you stick to your original scheme, do you want the frequency to increase or decrease when the sensor resistance increases?
 
Last edited:
Mike, thanks for explainin the baseband terminology. I had already built up an amping circuit with a max410, and yep, that works. But I'm recording with the sound card because the people who will be implementing this project do not have a conventional adc system. Not sure where you're going with this frequency carrier argument, but like I said in my previous post, in a frequency domain waveform analysis on the recorded signal, I want to resolve the frequency with 1ms resolution. Not possible to do so on a slower frequency signal, as I described. I don't want a differentiated signal, because like I said too, it would be good to be able to also measure peak touch force as well.

Ron, the direction in which resistance changes as compared with changes in force is if no matter to me. As long as i have a signal that scales frequency according to force, i can work out a rough calibration and conversion. Thanks for asking.

Appreciate the help so far, and I'm open to ideas to capture force-contingent signal in a simpler way. However, I need to record the signal with a sound card, and think my originally proposed way is likely one of the most straight forward ways to do so, while capturing forces so that time of contact and force scaling info is available to resolve on a finite timescale.
 
Last edited:
I'm working on a circuit that might work. Do you have a way to calibrate it, i.e., do you have a calibrated force generator?
 
Thanks for your time and the help, Ron. It's definitely appreciated. I don't have force generators, but I do have amti or6 force plates in my lab. Can just put the cheap pressure sensors on top of those force plates and press on them a bunch of times and figure out a fequency>force conversion from the two data streams.
 
This circuit converts resistance in the range 2-5Meg to period, with pretty good linearity. The frequency when Rsense=5Meg is about 7.9kHz. When Rsense=2Meg, the frequency is about 18.4kHz.
I have included the .ASC file, in case anyone wants to play with the simulation on LTspice.

I used a rail-to-rail op amp that I had a model for. Others will work, but the input and output ranges should include the positive rail, or nearly so.

I tried the sim at various values of vcc, ranging from 5V to 12V.
 

Attachments

  • resistance to period converter sch.PNG
    24.5 KB · Views: 321
  • force controlled oscillator.asc
    2.4 KB · Views: 143
Hi Ron, this is perfect. And it also finally gave me an excuse to download and play with LTSpice. Thanks for all the help with this project, it certainly saved me a ton of trial and error time. Might have a few more questions one I put this onto a breadboard, but I think this is exactly what I need.

Brian
 
Please keep us informed, even if you have no more questions.
 
Hi again, I've made some progress and mostly learned a lot about how to use SPICE. I managed to use a network of resistors to generate a +/-1v output from this that would be suitable for a sound card in.

One problem though is the op-amp, primarily, I don't have an LT1218. I've put a few on order, but I'm not familiar enough with op-amps to substitute another model that I have around. I've got a few LM741, MAX410, LT1120, and TL082. Is there any way to adjust this circuit to substitute with one of these other op amps. I got most of the spice macromodels to try and simulate their behaviours in this circuit. When I dropped the MAX410 into the circuit the output frequency slid to 24KHz, which is still fine, but there was no shift in output frequency when Rsense was stepped between 2-5MOhm. The voltage of the output of the MAX410 also didn't change with Rsense steps. i tried different configurations of the op amp, but I couldn't seem to get appropriate output from any of the models I have.

Any ideas?
 
You need a rail-to-rail (input and output) op amp. None of the ones you have meet this requirement. LT1120 is not an op amp.
Where do you get your parts? Maybe I can find a substitute.
 
Hi again, I've made some progress and mostly learned a lot about how to use SPICE. I managed to use a network of resistors to generate a +/-1v output from this that would be suitable for a sound card in.
Why don't you just us a series capacitor to couple to the sound card input? With a minimum frequency of 8kHz, you shouldn't have a problem. You can attenuate the signal with a resistor divider to get the 2V p-p signal you need.
 
What is your preferred supply voltage? I would prefer Vcc>9V, but it will work at 5V. This is relevant to the op amp selection, believe it or not.
 
Last edited:
For an interim solution, I can get away with +/12v from a computer power supply. This way I can iron out any bugs and write matlab scripts for the frequency analysis. However, in the end I'd like to stick with 5V, regulated from a 9V battery so that it is easily portable with as few accessories as possible. I know its a bit more of a pain in op amp selection, but the LT1218s are on their way in a sample order from Linear. Otherwise, what other amps would be a good substitute from another manufacturer (cause I can order samples from them too If you can let me know what some good rail-to-rail input/output amps are for 5V and 12V, that'd be great... cause I'm sure I'll use them at some point.

amp selection aside, I've reworked the SPICE schematic and I seem to be getting good results without any op amp. The other things I've changed is the transistor to a 4403, which I have, and modeled the line-out connections and DCoffset as applied through a voltage divider. Also, I'm stepping the Rsense down to 10Meg, because it turns out the sensors have >5Meg at rest. So their response is rather nonlinear until 5Meg, then is pretty consistent between 5Meg and 2Meg. So, there's no output signal at all at rest... but this shouldn't really matter because it will still be providing the correct range of frequencies in the range of force with which i'm concerned. If I need to change this, I can just add a 5Meg resistor in parallel with the Rsense and adjust the 555's tuning as need be.

Is there any reason I should not use this configuration, that is, without an op amp? It seems that including an op amp is getting me slightly more bandwidth in the range of response frequencies... is that the only reason to include an amp? Sorry for questions that are probably basic electronics theory. I really just hobby in electronics and volunteered to do this project out of interest.

fyi, the attached graphic shows the output frequency when stepping Rsense from 2Meg to 10Meg ohm in 1Meg steps. 2Meg produces the faster frequencies.
 

Attachments

  • force-frequency noamp2.asc
    2.6 KB · Views: 156
  • force-frequency noamp2 response spectrum.png
    46.1 KB · Views: 228
IMHO, that is a terrible design, from an engineering standpoint. The transistor collector current determines the frequency. The collector current is beta times the base current. The base current is (Vcc-Vbe)/Rsense, which is fairly stable. However, beta varies widely from one transistor to the next, even within the same part number. Morever, beta varies with temperature. The op amp circuit is designed to minimize the effects of these variations.
Five volts is OK for Vcc. It just forces the transistor to run with low Vcb, but that's OK.
There are lots of 5V rail-to-rail op amps. In fact, there are probably more 5V units than there are those that will work at 12V or more. Unfortunately, many modern op amps are not available in a through-hole package (SMT only). Can you handle SMT?
The part I would choose would probably be MCP6021 from Microchip Corp. Jameco has them for $0.99.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…