Using a 5v sensor with a Teensy 3.1

Status
Not open for further replies.

peanutman

New member
First of all, I'm a total hardware noob so please excuse me for the probably stupid question. I tried searching but didn't really find an answer.

I have a Teensy 3.1 and would like to use a pressure sensor that operates on 5v (both input and output). It probably doesn't matter but this is the sensor datasheet:
http://www.farnell.com/datasheets/8723.pdf

- The Teensy 3.1 runs on 3.3v. Is there any way I can get 5v from it? Perhaps from the USB connection? Or am I going to need an external power supply.

- The website states "All digital pins are 5 volt tolerant on Teensy 3.1. However, the analog-only pins (A10-A14), AREF, Program and Reset are 3.3V only. ". That means I can still use analog pins A0-A9 right? Also, what does it mean that they are "5v tolerant". Does this mean I can read the full 0-5v range from these pins, or does it mean they only do 0-3.3v but it won't blow up if I go up to 5v.

In short, can I use this 5v sensor with a Teensy 3.1? I could get a Teensy 2 to fix the voltage problem but I need the amount of pins the Teensy 3.1 provides.

Any advice would be greatly appreciated!
 
Last edited:
The Teensy's ADC will only convert voltages up to 3.3 V.

You could power the pressure sensor from the 5 VIN applied to the Teensy and use a resistor divider to attenuate the output to an appropriate range. I need to check for you (data sheet isn't clear about the drive strength), but basically I think you can put a 100k between the output and the ADC, a 220k between that point and AGND, and 0.1 uF across the 220k. Your output signal is now scaled by 68.7 %.

Note that these pressure sensors are ratiometric -- the output depends no the value of the 5 V supply also. If you need reasonable accuracy, you'll need to measure the 5 V supply also. You can do this the same way as above (VIN with 100k + 220k//0.1 uF) to another ADC channel. Divide the 1st reading by the 2nd (which will be nearly constant) and multiply by 5.0. This will give a result of 0.0459/kPA.
(i.e. similar to the data sheet of 45.9 mV/kPa).

Given that your resistors will have ~ 2 % tolerance, you'll need to calibrate this.

p.s. I checked with someone who knows and these pressure sensors can drive the 100k+200k load I mentioned above.
 
Last edited:
An alternative, might be to use an i2c ADC (analog-digital converter), such as the ADS1015 (https://www.adafruit.com/product/1083), or the ADS1115 if you need more precision (https://www.adafruit.com/products/1085). You would need to use an i2c level shifter (https://www.adafruit.com/products/757) to convert the Teensy's 3.3v i2c signal to 5v. Assuming you power the Teensy via USB, you can get 5v via the VIN or VUSB pins without getting a 2nd power source, otherwise you would need to cross-connect the ground wires. The ADS1015/ADS1115 would run at 5v, and transmit the values via i2c. This assumes you don't need to read the sensor thousands of times a second, as i2c is a fairly slow protocol.
 
Last edited:
That's probably overkill -- don't confuse accuracy with resolution. The pressure sensor itself is only 1.5 % accurate (7-bits), so the first limitation is the accuracy of the '5 V' supply (probably 5 % ?), not the ADCs. Calibrating the resistors (once) eliminates the 5V impact on error as well as errors in the resistors, and some of the gain error in the pressure sensor also.
 
Status
Not open for further replies.
Back
Top