Electronic – Teensy-LC 5v Pin

proximity-sensorteensy

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?

enter image description here

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:

enter image description here

Best Answer

The pin marked Vin on the TeensyLC board is equivalent to the Vin pin on the Arduino. The pin is designed to be used to supply power to the Teensy board. However based on the description page to which you have linked, it appears that the Vin pin can also be used to supply 5V to an external circuit when the USB port is connected. As far as I can tell (and you could check with a DMM in continuity mode), the Vin pin is tied directly to the USB 5V pin.

It is important to note that the TeensyLC runs at 3.3V. None if its I/O pins are not 5V tolerant - in other words hooking up a 5V output directly will damage it. There is one output-only digital pin on the board (D17) which has a level shifter on-board so that it can provide a 5V level logic output signal (not power).

You will need to ensure that the output of your sensor is correctly limited to 3.3V to avoid damage. This can be very easily be done with the sensor you have. Your sensor does not require 5V, in fact one side is an LED which has a forward voltage of 1.5V at 20mA, and the second side is a photo transistor with a pull up resistor. You can simply hook sensor circuit you show to the 3.3V supply instead of to 5V and it should function correctly. You may need to reduce the 200R resistor down to something closer to 100R to account for the lower supply voltage.