Connecting IR Proximetry Detector E18-D80NK

This proximity Sensor is excellent. For my outside app, folks said I would get false detections from sunlight, etc. However, this detector modulates its output signal and will only confirm a reflection if the modulation matches. I have shown it directly into the AZ sun without getting false detections. One consideration is its output is either near zero or 5V, too much for a 3.3V MicroController. I'm inserting a combination Pull-up resistor and voltage divider between the detector and the processor.

Start with a 220k resister between +5 and the signal lead of the detector. Continue the "tree" with a 6700 ohm resistor to the (low active) GPIO input of the processor. Then, finally connect a 22k resistor from there to ground. The processor will see either nearly 0 or 3.39V, both within the safety range. (I have a schematic drawn, but I don't see how to attach it)!

A little lost with your description but you have a max of 5.0 volts from sensor either a True or False (0.0 volt). I would just run with a 2:1 simple divider. Since you mention 220K I would use a pair of 220K resistors like so or a pair of 10 K resistors.

Vdiv

With 5.0 Volts Applied Vout is 2.5 volts which should be a logic high (True) on your uC. Why do you want a pullup in the mix?

Ron

Yes, only a 2-resisor divider will do.
5volt and 3.3volt is a 3:2 ratio. Pick two resistors with that ratio.
R1 = 1k and R2 =2k (2k2) is common for high speed applications.
Could increase that 10x for low speed and/or short wiring.
Data could be corrupted with high resistor values and high bitrates.
Leo..

Edit: Didn't see the previous thread.
An NPN sensor doesn't need a voltage divider, so this and the previous post are irrelevant.
You have wasted out time. Thank you..

Please do not cross post

The pullup is specified by the manufacturer. Without it , the resultant output voltage drops a little to 3.3 from 3.47V in my test setup. That is consistent with the manufacturer saying it's TTL output, but not with them specifying a 10k pullup. They did not say "open collector" which is what I would expect to work with a pullup.

Oops. I thought I was replying to two completely separate conversations.

Subsequently, I took a suggestion and looked at Level-shifting circuit modules. They would be simpler for my case of needing 4 shifts in one application. One version does not have a ground connection for itself as long as both logic level sides share a common ground. And they are cheap!

Using smart IR Proximity Detector E18-D80NK-ETC outdoors. This detector is very sensitive to its own beam, but ignores almost all other light (even direct AZ sunlight). However, it operates at 5V and is advertised to be TTL output. However the data sheet examples all have a 10k pull-up resister on the signal (output) lead. I'm using a three resister "tree" to keep 5V out of vulnerable inputs of 3.3V devices. From +5 to Detector output is 220k. From there to 3.3V input it's 6.7k. From there to ground, it's 22k. Much simpler than the use of level shifting ICs.

According to this data sheet and this one the output of that sensor is open collector NPN, which is quite common for such sensors.

If so, you need only one pullup resistor to 3.3V to interface it with a 3.3V device. That could even be the internal input pullup resistor on Arduino, specified by pinMode(pin, INPUT_PULLUP).

outdoor install, might want to isolate the input..

isolated level shifter..

I would suggest you also add a pull up resistor of about 3K to the 3V3. This will help noise immunity.

Your two or more topics on the same or similar subject have been merged.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you also take a few moments to Learn How To Use The Forum.

It will help you get the best out of the forum in the future.

  • Your OS and version can be valuable information, please include it along with extra security you are using.

  • Always list the version of the IDE you are using and the board version if applicable.

  • Use quote or add error messages as an attachment NOT a picture.

  • How to insert an image into your post. ( Thanks @sterretje )

  • Add your sketch where applicable but please use CODE TAGS ( </> )

  • Add a SCHEMATIC were needed even if it is hand drawn

  • Add working links to any specific hardware as needed (NOT links to similar items)

  • Remember that the people trying to help cannot see your problem so give as much information as you can

COMMON ISSUES

  • Ensure you have FULLY inserted the USB cables.

  • Check you have a COMMON GROUND where required. ( Thanks @Perry)

  • Where possible use USB 2.0 ports or a USB 2.0 POWERED HUB to rule out USB 3.0 issues.

  • Try other computers where possible.

  • Try other USB leads where possible.

  • You may not have the correct driver installed. CH340/341 or CP2102 or FT232 VCP Drivers - FTDI

  • There may be a problem with the board check or remove your wiring first.

  • Remove any items connected to pins 0 and 1.

COMPUTER RELATED

  • Close any other serial programs before opening the IDE.

  • Ensure you turn off any additional security / antivirus just to test.

  • There may be a problem with the PC try RESTARTING it.

  • You may be selecting the wrong COM port.

  • Avoid cloud/network based installations where possible OR ensure your Network/Cloud software is RUNNING.

  • Clear your browsers CACHE.

  • Close the IDE before using any other serial programs.

  • Preferably install IDE’s as ADMINISTRATOR or your OS equivalent

ARDUINO SPECIFIC BOARDS

  • CH340/341 based clones do not report useful information to the “get board info” button.

  • NANO (Old Types) some require you to use the OLD BOOTLOADER option.

  • NANO (ALL Types) See the specific sections lower in the forum.

  • NANO (NEW Types) Install your board CORE’s.

  • Unless using EXTERNAL PROGRAMMERS please leave the IDE selection at default “AVRISP mkII”.

  • Boards using a MICRO usb connector need a cable that is both DATA and CHARGE. Many are CHARGE ONLY.

CREATE editor install locations.

  • On macOs ~/Applications/ArduinoCreateAgent-1.1/ArduinoCreateAgent.app/Contents/MacOS/config.ini

  • On Linux ~/ArduinoCreateAgent-1.1/config.ini

  • On Windows C:\Users[your user]\AppData\Roaming\ArduinoCreateAgent-1.1

Performing the above actions may help resolve your problem without further help.

Language problem ?

Try a language closer to your native language:

Thanks to all those who helped and added to this list.

From the spec page:
"and a 10K Ohm resistor between Brown and Black."
Which tells me that this is an open-collector NPN sensor.

My pea-brain tells me that you don't need a resistor or voltage divider or level shifter.

Measure the output of the sensor with just 5volt/ground connected to the sensor.
No resistor, no Arduino.
If the output is 0volt and stays 0volt, then it's an NPN sensor.

If so, then you can connect the output directly to the 3.3volt-logic pin.
With internal pull up enabled.
pinMode(sensorPin, INPUT_PULLUP);

If... you get false triggers from noise pickup from a long wire, then you could add a 10k resistor between Arduino pin and Arduino 3.3volt VCC, and/or a 10-100n capacitor from pin to ground.
Leo..

Thank you. The first datasheet that you referenced is the one that got me confused. Note in that circuit diagram the 10k resistor labeled "Pull-up" is in series going to D5.
However, another published data sheet (IR Sensor Switch E18-D80NK-N-ETT) specifically says the output is TTL. Hence my confusion. Further, the DEVMO brand sample I bought from Amazon with +5 to the detector V++ and only a 10k PU to 3.3V yields 4.7V out when IR reflection is absent, which is consistent with TTL output rather than Open-Collector NPN.

Button line, different outputs by different manufacturers.

I hope this clears things up, and I will be looking for a model that has Open Collector output going forward.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.