Teensy 3.1: 5V Output (USB) & Negative Voltage Input (ADC)

Status
Not open for further replies.

Chopsticks

Active member
Hi there,

I've been watching the schematics and specification/datasheet from the Teensy 3.1, and I have two questions about the voltage output and ADC Input

Q1
The USB input gives a 5V Out, I figured out that there is a 5V output line.. actually two, but one out(VIN) can be used for external voltages.
For my project i need 5V Out, but is this line (VUSB) protected when the circuit accidentally shorts? Because I don't want to destroy my USB interface on my laptop.

Q2
My measured signal (sensor output) has negative voltage output(± 5V and/or ± 2.5V). Can a negative voltage be measured in the single/differential mode? Or do i need to lift the voltage to a positive range?

Friendly regards,

Klaas
 
Last edited:
Re Q2:

You'll need to "level shift" that signal into the 0 - 2.5V range. I would use an opamp circuit for the purpose. Depending on inverting/non-inverting configuration used, put the one leg at midway between 0-2.5V (1.25V). That way, when opamp's other input (your analog input) is at 0V, the opamp output (supplied from +/- 2.5V), should read about 1.25V. When the opamp input is negative, it will read in the 0 to 1.25V range at the output (input to teensy).

You'll want an opamp that works well with "rail to rail" levels for best results (opamp supplied with +/- 2.5V). If the range of input signal is larger than the range that the teensy wants, calculate a negative (less than unity) gain for the opamp. There should be plenty of web resources for this kind of opamp circuit design.
 
Hi there,

I've been watching the schematics and specification/datasheet from the Teensy 3.1, and I have two questions about the voltage output and ADC Input

Q1
The USB input gives a 5V Out, I figured out that there is a 5V output line.. actually two, but one out(VIN) can be used for external voltages.
For my project i need 5V Out, but is this line (VUSB) protected when the circuit accidentally shorts? Because I don't want to destroy my USB interface on my laptop.

Q2
My measured signal (sensor output) has negative voltage output(± 5V and/or ± 2.5V). Can a negative voltage be measured in the single/differential mode? Or do i need to lift the voltage to a positive range?

Friendly regards,

Klaas

The 5 V USB Line feeds through the Teensy, although there is a location on the bottom of the PCB where you can disconnect this. If you short it to GND, the USB port should current limit (its in the USB spec) and protect itself. Cheap laptops will limit at about 2 A before shutting down the USB port after an overload; it should recover.

How does your sensor get its negative supply for -2.5 V ?

If it can generate a 'strong' signal, for initial testing, you could just connect a resistor (say 10k) from its output to the ADC input, and another (also 10k) from that pin to the Teensy's 3.3 V Teensy's 3.3 V pin. That would work reasonably well as a level shifter (and attenuator). In case of a -5 V sensor, you could use 20k and 10k.
 
The 5 V USB Line feeds through the Teensy, although there is a location on the bottom of the PCB where you can disconnect this. If you short it to GND, the USB port should current limit (its in the USB spec) and protect itself. Cheap laptops will limit at about 2 A before shutting down the USB port after an overload; it should recover.

Do you know what location? is it those 2 pads, which can be cut? As far I see in this picture http://www.pjrc.com/teensy/schematic3.gif there are two pins (VUSB and VIN) and in between two pads which can be cut. but as far i see there is no protection? only the 500mA fuse.

How does your sensor get its negative supply for -2.5 V ?
The sensor can measure the electrical field with a range from -2,5 to 2,5V. Eventually, I need to subtract Sensor B from A (A-B) to get a differential signal. To get a diff signal a simple differential amplifier is used and/or can be done digitally. The sensor itself is supplied with 5V and GND.

If it can generate a 'strong' signal, for initial testing, you could just connect a resistor (say 10k) from its output to the ADC input, and another (also 10k) from that pin to the Teensy's 3.3 V Teensy's 3.3 V pin. That would work reasonably well as a level shifter (and attenuator). In case of a -5 V sensor, you could use 20k and 10k.

The ± 2.5V is the highest amplitude that I get, the signal which i'm measuring lays around 30-50 mV's. Is it possible to measure that with your solution? I came up with this solution using an summing amplifying(x1) and inverted opamp(x1):
LevelShifterOpamp.jpg
 
Last edited:
I've read about the internal voltage (3.3V)?

But what about measuring signals above that reference? Let's asume my sensor signal is 2,5V, with an level shifter (3.3V for example) it's gonna be: 3.3+2.5 = 5.8V.
Can the ADC deal with that? And what happens to an adc when the input reaches their limits or is higher then the limit? or the output on the adc is negative?
 
Last edited:
That's why, IMO, that you should use an opamp circuit with a feedback resistor to control its gain. By applying an offset to one opamp leg, you get the level shift you need. Additionally by choosing your resistor in the feedback loop, you can control the opamp gain. If your +/- input range is too large, then by employing a less than unity gain, you can make it fit safely into the target ADC range.
 
The circuit's output is (V3 + V4) /2 -- If your inputs are -2.5 to + 5 V, you'll need to attenuate the signal.

What exactly is your sensor ?
 
The circuit's output is (V3 + V4) /2 -- If your inputs are -2.5 to + 5 V, you'll need to attenuate the signal.

What exactly is your sensor ?
I'm using an Plessey EPIC Sensor (PS25201). For measuring ECG signals. Those signals are very weak. The sensor itself generates approx. max ± 2.5V at the output.
i came across this solution:

Schematic:
LevelShifterResistors.jpg

Simulation:
Simulation Level Shift Resistor.jpg

Output is still divided by approx a half but in the µC could amplify the signal. A positive fact is that the the range doesnt get above 3.3V and doesnt get below 0V.
 
That's why, IMO, that you should use an opamp circuit with a feedback resistor to control its gain. By applying an offset to one opamp leg, you get the level shift you need. Additionally by choosing your resistor in the feedback loop, you can control the opamp gain. If your +/- input range is too large, then by employing a less than unity gain, you can make it fit safely into the target ADC range.

There are many opamp circuits available ofcourse, but the offset shall be less then 3.3V tho? Any schematic available?
 
So you have a small signal superimposed on a large, and variable, common mode signal. It would seem preferable to filter out the common mode signal as much as possible before digitizing it.

Is it possible to use a second sensor which doesn't pick up the signal you are measuring but picks up the same or similar common mode signal?

If its a small signal with large and irrelevant spikes then one option is to amplify it quite a lot, then clamp the (even larger) spikes with diodes.
 
Looking at the datasheet the sensor requires a bipolar supply of ±2.4V to ±5.5V. It has a gain of 50, a typical input to the sensor is stated to be 1mv p-p so the output should be around 50mV p-p. Its AC coupled with a frequency response from 0.2Hz to 10kHz. So there should not be a significant DC offset and i can't see a way that it could produce a 2.5V or -2.5V output except in the most general sense that any active circuitry may, in a startup or fault condition, briefly go to one or other supply rail.

The datasheet shows (page 5) using two sensors in a differential mode. That seems like a good option. Two sensors plus an instrmentation amplifier would get rid of most common mode signal and amplify up the actual signal of interest to take up the full range of the ADC.

If that isn't an option, then for a bipolar signal with around 60mV p-p you could either add in a DC offset of 30mV, or use a high-pass filter with a -3dB point below 0.2Hz, to remove the offset in the actual signal of interest. Then amplify it up by around 50 to get it into the 3V range and either clamp with diodes to remove any out of range peaks, or use a rail to rail op-amp for the 50x running on a single rail 0V to 3.3V supply. If you are using the internal Vref you would need a lower gain, 20x.

The op-amps should be low current and voltage noise and low input offset voltage. Low drift and low temperature drift are other desireable characteristics.
 
Last edited:
The skin has high-impedance.
I would also not do this unless you were running off batteries.
The differential ADC should help a lot.
 
Is it possible to use a second sensor which doesn't pick up the signal you are measuring but picks up the same or similar common mode signal?
For that my friend, is needed a Driven Right Leg circuit. Which i also have included within my design. It basically a ground plane with an inverted signal on the human body. For example: the sensors output is 1V, the Driven Right Leg output is -1V to compensate the noise ratio etc.

Looking at the datasheet the sensor requires a bipolar supply of ±2.4V to ±5.5V. It has a gain of 50, a typical input to the sensor is stated to be 1mv p-p so the output should be around 50mV p-p. Its AC coupled with a frequency response from 0.2Hz to 10kHz. So there should not be a significant DC offset and i can't see a way that it could produce a 2.5V or -2.5V output except in the most general sense that any active circuitry may, in a startup or fault condition, briefly go to one or other supply rail.

The datasheet shows (page 5) using two sensors in a differential mode. That seems like a good option. Two sensors plus an instrmentation amplifier would get rid of most common mode signal and amplify up the actual signal of interest to take up the full range of the ADC.
True, true...
I'm using two sensors, with a differential amplifier, and a low-pass filter to get 0,5Hz to 20 Hz. All above is useless for me. I'm measuring an ECG signal. I've been testing on the sensors and I'm currently testing with the Plessey Demo Box. It seems that the output reacts on disturbance in the electrical field. How higher the disturbance how higher the output signal. I've been recording my measurement for 1 hour.. The maximum output (without any filters etc) gave me a max output at 2,5V and -2,5V. That also depends on which sensor you use. We have the PS25201 for example. But Plessey got several sensors whit different purpose.

Analyzing the demo box actually gives me a gain amplifier and after the gain amplifier an differential amplifier. But the demo box measures the two sensor outputs and the differential output. But i'm interested in both signals for digital signal processing. But instead of using an expensive box, making use of Teensy. At this moment it actually only needs to record incoming data to be saved on an sdcard. I'll do signal processing by using LabVIEW.

Teensy only needs to read the ADC, save data to sd-card and controlling the driven right leg whit a digital potentiometer. But that's offtopic, Ghehe.
 
Status
Not open for further replies.
Back
Top