Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Which approach is better with a Teensy 3.1?

  1. #1
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408

    Which approach is better with a Teensy 3.1?

    So I am considering the use of a DS18B20 one-wire temp sensor with a Teensy 3.1. There are many ways to power the sensor and the attendant tradeoffs. The sensor can operate with a power supply from 3-5.5VDC. Due to its location, using 5VDC would be advantageous (very short line to power) while there are also other options (like powering it from the Teensy by pulling a pin high). The maximum power dray of a DS18B20 is 4mA, i.e. within spec for the amount of power a digital pin can supply.

    What I wonder about is which approach is best, from a long-term, happiness point of view on the MK20 chip on the Teensy 3.1 itself. Would the MK20 be happier supplying power and having all logic levels for the DS18B20 run at around 3.3V or is having 5V signals on a digital pin preferable?

    What if the 5V signal (coming raw from a wall wart, USB bus, etc.) wobbles, as they are wont to? I see that I'm talking myself into a 3.3V-only solution but wonder if the parasitic or two-pin option (i.e. one supplying power, the other communicating with the MK20) is viable and/or preferable.

    I expect any of these approaches to work, what I want to ensure is that the Teensy 3.1 chip life expectancy is maximized.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,383
    Quote Originally Posted by Constantin View Post
    What I wonder about is which approach is best, from a long-term, happiness point of view on the MK20 chip on the Teensy 3.1 itself.
    Either is probably fine.

    Would the MK20 be happier supplying power and having all logic levels for the DS18B20 run at around 3.3V or is having 5V signals on a digital pin preferable?
    Even though 3.1 is 5V tolerant, I'm not understanding how 5V gets onto the Teensy 3.1 pin in this usage?

    The DS18B20 has 3 pins, power, signal and ground. The signal is an open collector type. You'd connect the 4.7K resistor from the signal to the 3.3V power on Teensy 3.1, even if the chip is externally powered from 5V.

  3. #3
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Dear Paul,

    Many thanks for the reply - it just goes to show how ignorant I am regarding the many different ways that chips can communicate. The open-collector approach is really clever, allowing the DS18B20 to be powered at one voltage while allowing the signals going back and forth to run at a different voltage level. Hence also the need for a pullup (mine was originally tied to 5V, just like the power source, not 3.3V).

    I have since revised the board to power the DS18B20 with 4.7-5VDC while using a digital pin on the K20 to provide the pullup power supply for the 1-Wire interface. The limits the amount of power needed (<1mA) hopefully keeping the Teensy MCU very happy.

    Many thanks again for your reply! Constantin
    Last edited by Constantin; 03-04-2014 at 05:35 PM. Reason: Board revision...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •