Teensy 3.6 to try to hear osteoarthritis

Status
Not open for further replies.

Polly

Member
Hey,

I'm in the first year of my PhD, I've got a couple of Teensy 3.6 and am looking at taking an analog input of ultrasound wavestreams and converting them (ADC) to be stored on an SD card for later interpretation. I'm currently trying to figure out things like sampling rate of the signal and how fast the teensy can convert ADC for storage later.
I'm quite new to this, I've not used microcontrollers before :confused: and was hoping for some advise just about where there may be problems or what to look out for. Also any recommended reading would be greatly appreciated :eek:

Many thanks
Polly
 
Hi both,

Thanks, I've been looking at that project :) I'm trying to find out the maximum ADC speed of the teensy, do you happen to know if there is any technical specs about for the 3.6?

Hopefully I'll be able to show if it's working soon! :eek:

Polly
 
So.. quick update for anyone who is following this very slow progress of mine :)

Been trying to get my filtering and amplification of my signal correct.
I am thinking about using a charge amplifier but am struggling to find the right op amp at the moment :confused: got some great help from the electronics lab here, but we were all struggling with this problem.

Any help appreciated.

Want a Bandpass filter so my signal is between 20kHz and 300kHz
And amplification from +/- 10mV up to between 0 to + 3 V

Charge amplifiers have a filter as part of the circuitry so its the balance of getting the right charge amplifier without filter the whole signal away :p

Polly
 
I would design this in 3 stages, at least for a first attempt. If you plan to mass produce this as a commercial product, you can always try to optimize later. Don't be shy about using more parts and not having the most optimal, lowest cost or lowest power consuming solution from the start. Optimizing makes everything so much harder. Do it the simple way first.

I'd design this as 3 separate circuits.

1: An amplifier with gain of 300. I'd first do this as 2 amplifiers with a gain of 17.32. Then you can use fairly ordinary opamps and the normal circuit with just 2 resistors to set the gain.

2: A low-pass filter (with passband gain of 1) which removes the spectrum above 300 kHz.

3: A high-pass filter (with passband gain of 1) which removes the stuff under 20 kHz.

Build each part so it can be easily tested separately!

For both of these filters, you can use the normal Sallen-Key circuit, probably using the same type of opamp. There are lots of website with calculator tools for these types of filters. Here's one:

http://sim.okawa-denshi.jp/en/OPseikiLowkeisan.htm

Scroll down to the 2nd part "Calculate the R and C values for the Sallen-Key filter at a given frequency and Q factor". I tried it just now for 20000 Hz, and it recommended 8.2K resistors and 1nF capacitors. That's probably a decent starting point.

Here's another page with a tool for high-pass filters.

https://daycounter.com/Filters/Sallen-Key-HP-Calculator.phtml

One final trick you might wish to consider, is how to get the proper DC bias. If do to the high pass filter last, you can just modify this circuit slightly.

Sallen-Key-HP-Filter-Schematic.gif

Instead of connecting R2 to GND, you would connect R2 to 1.65 volts. That will cause the high-pass filter to shift your filtered signal into the right voltage range for Teensy's 0-3.3V ADC to properly measure.

The simplest way to get 1.65V is with a resistor divider, plus capacitors. I'd use 1K resistors. Two of them in series will draw 1.65 mA current when placed across the 3.3V power and GND. You will also need capacitors from the 1.65V middle point to GND. Use a 0.1uF and also a 10uF. The capacitors cause the impedance seen by the filter to be very close to zero, so you don't unintentionally add more resistance in series with R2 from the filter.


Choosing the opamp can be tricky. You're going to need something with at least 10 to 15 MHz gain-bandwidth product, so check that spec carefully. Avoid the really low power opamps, since they usually have ~1 MHz gain-bandwidth, which isn't enough. Unless you get opamps that are rail-to-rail on both input and output (check carefully - many that say rail-to-rail are only one but not both), you'll need special power so the opamp is able to handle your desired signal range.

As one final precaution, I'd recommend you connect a resistor between the final opamp and Teensy's ADC pin. A value in the 220 to 1K range is fine. Some opamps, especially the higher bandwidth types, can be sensitive to the switched capacitor behavior of the ADC. Adding a capacitor directly from the ADC pin to AGND also helps. Opamps love driving resistors and hate directly driving capacitors, and the ADC loves having an extra capacitor... this this arrangement gives both what they like most. Capacitors in the range of 100pF to 1nF are fine. But be careful not to use too much, since this cap and the resistor form another low-pass filter. If you use 330 ohms and 470 pF as the final parts between the opamp and Teensy, that will pass everything below 1 MHz, so your 300 kHz won't get attenuated much.

Analog circuit design can be tough. I highly recommend building each piece as a separate unit, so you can easily troubleshoot each one. If you do testing with a signal generator and oscilloscope, remember to test with pulses or other waveforms other than a pure sine wave. Sine waves are great for testing frequency response, but filters also change the phase of your waveforms, not only the frequency. Don't make the rookie mistake of looking only at frequencies with sine waves, then later discover your filter has terrible time settling time response (or even sustained resonance) to pulses.
 
Status
Not open for further replies.
Back
Top