Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

71%
+3 −0
Q&A Interfacing sensor with TTL output with Microcontroller

In general, when wanting to connect a digital output to a digital input, compare the guaranteed output levels of the output to the guaranteed threshold levels of the input. For example, let's say ...

posted 12mo ago by Olin Lathrop‭  ·  edited 11mo ago by Olin Lathrop‭

Answer
#2: Post edited by user avatar Olin Lathrop‭ · 2025-10-08T19:33:34Z (11 months ago)
  • In general, when wanting to connect a digital output to a digital input, compare the guaranteed output levels of the output to the guaranteed threshold levels of the input.
  • For example, let's say the output is guaranteed to be below 500 mV when low and above 2.5 V when high.
  • Now check the digital input specs. Let's say that's a 3.3 V part with guaranteed input thresholds at 20% and 80% of the power voltage. That would mean the input needs to be below (3.3 V)&sdot;20% = 660 mV to be interpreted as low, and (3.3 V)&sdot;80% = 2.64 V to be interpreted as high. In this example, the low level works directly, but the high level is a little too low.
  • Solutions might be a pullup resistor depending on details of the digital output, a different input of the micro that has different thresholds, or a level converter or transistor between the two devices.
  • You have to read the datasheet of each device carefully.
  • In general, when wanting to connect a digital output to a digital input, compare the guaranteed output levels of the output to the guaranteed threshold levels of the input.
  • For example, let's say the output is guaranteed to be below 500 mV when low and above 2.5 V when high.
  • Now check the digital input specs. Let's say that's a 3.3 V part with guaranteed input thresholds at 20% and 80% of the power voltage. That would mean the input needs to be below (3.3 V)&sdot;20% = 660 mV to be interpreted as low, and above (3.3 V)&sdot;80% = 2.64 V to be interpreted as high. In this example, the low level works directly, but the high output level is a little too low.
  • Solutions might be a pullup resistor depending on details of the digital output, a different input of the micro that has different thresholds, or a level converter or transistor between the two devices.
  • You have to read the datasheet of each device carefully.
#1: Initial revision by user avatar Olin Lathrop‭ · 2025-09-28T14:58:07Z (12 months ago)
In general, when wanting to connect a digital output to a digital input, compare the guaranteed output levels of the output to the guaranteed threshold levels of the input.

For example, let's say the output is guaranteed to be below 500 mV when low and above 2.5 V when high.

Now check the digital input specs.  Let's say that's a 3.3 V part with guaranteed input thresholds at 20% and 80% of the power voltage.  That would mean the input needs to be below (3.3 V)&sdot;20% = 660 mV to be interpreted as low, and (3.3 V)&sdot;80% = 2.64 V to be interpreted as high.  In this example, the low level works directly, but the high level is a little too low.

Solutions might be a pullup resistor depending on details of the digital output, a different input of the micro that has different thresholds, or a level converter or transistor between the two devices.

You have to read the datasheet of each device carefully.