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

  • \$\begingroup\$ No because I am confused on which pin (5v) to use to power the sensor? \$\endgroup\$ – lucidgold Jan 10 '17 at 21:25
  • \$\begingroup\$ @12Lapointep hooking the circuit up as shown will probably fry the ADC and MCU as it will apply 5V to an IC which is only rated for 3.3V. \$\endgroup\$ – Tom Carpenter Jan 10 '17 at 21:32

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.

  • \$\begingroup\$ Thank you so much for this detailed answer. And I am happy to know that I don't need a 5v pin for now. However, which 5v pin can I use in the future? Please review my question updates. \$\endgroup\$ – lucidgold Jan 10 '17 at 21:42
  • \$\begingroup\$ @lucidgold I answered that in the first paragraph. \$\endgroup\$ – Tom Carpenter Jan 10 '17 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.