Teensy-LC 5v Pin?

Status
Not open for further replies.

vivi

Member
I want to connect a sensor (QRD1114 - requires 5v) to a Teensy-LC. I am a little confused as to which pin to use for 5v input.

Below image shows how the sensor is connected to an Arduino UNO (right-side). However, I show on the left-side what I think the connections should be to a Teensy-LC?

Am I using the correct 5v pin to power the sensor? I am confused because it is labeled as "vin", so then how do I externally power the board (without using USB connection) use pin 17?
gWz4Z.png

Now, according to Teensy-LC docs they state:

Teensy-LC provides a 5V output to directly drive WS2812/NeoPixel LEDs.
With the connection shown here:
EtEtp.jpg
 
If you are powering your Teensy via USB, that provides 5v and you can get the 5v from the VIN pin. Alternatively, you can apply power to VIN (and ground) to power the Teensy without a USB power source.

I believe the LC has a fuse on the Vusb->Vin connection which means you can use up to about 350 mA of 5v power (minus whatever the Teensy is using) for your device.

The pin on the back is to allow you to use pin 17 (A3) to send out VIN when you do a digitalWrite (17, HIGH). You can only draw about 8mA from this signal. It is meant for things like WS2812B/Neopixel LEDs, where you power the LED string with a connection to VIN, and you use pin 17 to send signals to the LED microprocessor so it controls the 3 lamps in the LED whether they go on/off (and successive LEDs in the chain).

Note, it is only guaranteed to emit exactly 5v if the input power source is 5v. If you only use USB (either via computer, wall wart, or battery that provides USB power), then that power source is 5v (with a small plus/minus). If you are planning to power the Teensy from another power source, you may need to use a boost or buck converter to get 5v depending on whether your input source is below 5v or above 5v (or a buck/boost converter that will boost the current or drop it depending on the input voltage).

IMPORTANT
If your device returns information to the Teensy, you must lower the voltage of the return signal to 3.3v. If you feed 5v input from the device to your Teensy, you may fry it.

<edit #1>
After posting the initial article, I see that it is an analog sensor (returns 0..5v depending on the light conditions). You do not want to use a normal level shifter meant for digital signals. Instead, you will need to use a voltage divider that reduces the signal by a given percentage so that if the 5v is returned by the device, only 3.3v is returned to the Teensy. The simplest voltage divider would simply divide the voltage in half (i.e. 0..2.5v). That means the analogRead function would only return numbers in the range 0..730 instead of 0..1023. Perhaps that will be enough. If not, you would need to figure out the appropriate resistors to use so that you get the full range:

If you haven't bought the sensor, it is generally better to see if you get an equivalent sensor that works on 3.3v power. In that case, you would power the device from one of the two 3.3v power pins. If you are powering it from 3.3v, you don't need a voltage divider. You can draw about 120 mA from the power pins (modulo whatever the Teensy needs).

<edit #2>
However according to this hookup guide from Sparkfun, you can power it from 3.3v as well as 5v, providing you use the 330 ohm current limiting resistor (and the 10k ohm pull-up resistor):
 
Last edited:
Status
Not open for further replies.
Back
Top