Arızalanan yaklaşım sensörünün yerine yenisini eskisiyle aynı şekilde bağladınız; hedef geçerken sensörün sarı LED'i yanıyor ama PLC girişi gelmiyor. Çoğu zaman ortada bozuk bir parça yoktur: Ya sensörün çıkış tipi o giriş grubuna uymuyordur ya da giriş grubunun ortak ucu (common) beslemenin yanlış kutbuna bağlanmıştır. Bu rehber, standart dijital girişlere bağlanan 24 V DC sensörler için PNP ve NPN çıkışlarını, sink ve source girişlerini, kablo renklerini, 2 telli sensörleri, dönüştürme seçeneklerini ve multimetreyle (avometre) yapılacak kontrolleri ele alıyor. Kapı kilitleme, ışık perdesi gibi emniyet fonksiyonları emniyet sınıfı (safety rated) ürünler gerektirdiği için kapsam dışıdır.
1. PNP ve NPN farkı: sade anlatım
3 telli bir DC sensörün çıkışında elektronik anahtar gibi çalışan bir transistör vardır. İki tip, çıkış teline hangi besleme hattını bağladıklarıyla ayrılır:- PNP (source, akım veren çıkış): Aktif olduğunda çıkışı +24 V hattına bağlar. Yük (PLC girişi) çıkış ile 0 V arasındadır ve akım sensörden dışarı akar.
- NPN (sink, akım çeken çıkış): Aktif olduğunda çıkışı 0 V hattına bağlar. Yük +24 V ile çıkış arasındadır ve akım sensörün içine akar.
Standart bir çıkış pasifken teli karşı hatta çekmez, yalnızca iletimi keser. Tel, PLC girişi onu kendi referansına çekene kadar boşta kalır (açık kollektör, open collector). Bazı sensörler, özellikle IO-Link destekli modeller, push-pull ya da ayarla seçilebilen PNP/NPN çıkış sunar.
Seçim büyük ölçüde alışkanlık meselesidir; elektriksel olarak iki tip de aynı işi görür. Genel bir eğilim olarak Avrupa kökenli makinelerde PNP, Japonya ve diğer Asya ülkelerinden gelen ekipmanlarda ise geleneksel olarak NPN daha yaygındır. Bu yalnızca bir eğilimdir; makinede gerçekte hangi tipin kullanıldığını elektrik projesi ve sensör etiketi söyler. Türkiye'deki tesislerde ikisi de kullanılır, bu yüzden her makineyi ayrıca kontrol edin.
2. Kablo renkleri, NO/NC ve etiket okuma
Yaklaşım sensörü (proximity switch) standardı IEC 60947-5-2, üreticilerin çoğunun kullandığı kablo renklerini tanımlar; M12 pin numaraları da aynı düzeni izler:| Renk | Kod | M12 pini | 3 veya 4 telli DC sensörde görevi |
|---|---|---|---|
| Kahverengi | BN | 1 | Besleme artı (L+), çoğunlukla 10-30 V DC; modelinize bakın |
| Mavi | BU | 3 | Besleme 0 V (L-, M) |
| Siyah | BK | 4 | Anahtarlama çıkışı (çoğunlukla NO); IO-Link sensörlerde C/Q hattı |
| Beyaz | WH | 2 | İkinci çıkış (çoğunlukla tamamlayıcı NC) ya da bazı modellerde teşhis veya öğretme (teach) hattı |
NO mu, NC mi? Normalde açık (NO) çıkış hedef varken, normalde kapalı (NC) çıkış ise hedef yokken aktiftir. 4 telli tamamlayıcı (antivalent) sensörler ikisini birden verir; yaygın düzende siyah NO, beyaz NC'dir.
Sipariş kodlarının yapısı üreticiden üreticiye değişir. Parça numarasından tahmin yürütmek yerine sensör gövdesindeki, etiketindeki ya da katalogdaki bağlantı şemasına bakın: Yük sembolü siyah ile mavi arasına çizilmişse sensör PNP, siyah ile kahverengi arasına çizilmişse NPN'dir.
3. PLC girişleri: sink, source ve IEC 61131-2 tipleri
DC dijital giriş, özünde giriş klemensi ile grubun ortak klemensi arasına bağlanmış, akım sınırlamalı bir optokuplör LED'idir. Yalnızca içinden akım geçtiğinde 1 olur; bu yüzden sensörün anahtarladığı hat ile ortak uç, beslemenin zıt kutuplarında olmalıdır:| Sensör | Giriş tipi (yaygın adlandırma) | Ortak ucun bağlandığı yer | Akım yolu |
|---|---|---|---|
| PNP | Sink giriş, akım çeken (Almanca: P-lesend) | 0 V | Sensör → giriş → ortak → 0 V |
| NPN | Source giriş, akım veren (Almanca: M-lesend) | +24 V | +24 V → ortak → giriş → sensör → 0 V |
IEC 61131-2 giriş tipleri
IEC 61131-2, 24 V DC akım çeken (sink) girişler için üç karakteristik tanımlar. Aşağıdaki tablo standardın 24 V DC sınırlarını özetler; tam tanımlar için standardın kendisine bakın. Girişinizin hangi tipte olduğu modülün teknik verilerinde yazar.| Tip | Kullanım amacı | Sinyal 1 (ON) | 0 okunması garanti edilen en yüksek akım |
|---|---|---|---|
| Tip 1 | Mekanik kontaklar ve 3 telli sensörler | 15-30 V, 2-15 mA | yaklaşık 0,5 mA |
| Tip 2 | 2 telli yarı iletken sensörler, yüksek giriş akımı | 11-30 V, 6-30 mA | yaklaşık 2 mA |
| Tip 3 | 2 ve 3 telli sensörler, Tip 2'den düşük güç | 11-30 V, 2-15 mA | yaklaşık 1,5 mA |
Markalara göre terim tuzakları
- Siemens: "Sinking input" (P-lesend) PNP sensör, "sourcing input" (M-lesend) NPN sensör kabul eder. S7-1200 CPU'larında giriş grubunun ortak ucu 1M klemensidir: PNP sensörler için 0 V'a, NPN sensörler için +24 V'a bağlanır. S7-1500 ve ET 200SP ailesindeki birçok DI modülü yalnızca PNP sensör kabul eder; adında "SRC" (sourcing) geçen varyantlar ise NPN sensörler içindir.
- Mitsubishi FX: Ortak uca S/S denir ve terimler ters yönde kullanılır. Mitsubishi'nin "sink input" bağlantısında S/S 24 V'a bağlanır ve giriş 0 V'a çekildiğinde gelir; yani bu bağlantı NPN sensörler içindir. "Source input" bağlantısında ise S/S 0 V'a bağlanır ve PNP sensör kullanılır.
- Omron ve diğerleri: Ortak klemens çoğunlukla COM adını taşır. Omron'un NX kataloğu DC giriş ünitelerini kabul ettikleri sensör tipine göre NPN, PNP ya da NPN/PNP olarak etiketler; örneğin NX-ID3317 NPN, NX-ID3417 ise PNP olarak listelenir.
4. Bağlantı örnekleri
4.1 PNP sensörün sink girişe bağlanması
Kod:
24 V güç kaynağı PNP sensör (NO) PLC giriş grubu
+24 V o--------------- BN kahverengi (+V)
BK siyah (çıkış) ------> I0.0
0 V o----+---------- BU mavi (0 V)
|
+------------------------------------> 1M / S/S / COM (ortak)
Hedef var: BK yaklaşık +24 V, akım BK -> I0.0 -> ortak -> 0 V, giriş 1.
4.2 NPN sensörün sink/source seçilebilir girişe bağlanması
Kod:
24 V güç kaynağı NPN sensör (NO) PLC giriş grubu
+24 V o----+---------- BN kahverengi (+V)
|
+------------------------------------> 1M / S/S / COM (ortak)
BK siyah (çıkış) ------> I0.1
0 V o--------------- BU mavi (0 V)
Hedef var: BK 0 V, akım +24 V -> ortak -> I0.1 -> BK -> 0 V, giriş 1.
4.3 2 telli DC sensör
Kod:
Sink giriş (ortak 0 V'ta): +24 V -> BN (sensör) BU -> I0.2 ... 1M -> 0 V
Source giriş (ortak +24 V'ta): +24 V -> 1M ... I0.3 -> BN (sensör) BU -> 0 V
Kaçak akım girişin sınırını aşıyorsa girişe paralel bir yük direnci (bleeder resistor) bağlayın. Amaç, sensör kapalıyken giriş gerilimini 5 V'un altında tutmaktır; bunun için R ≤ 5 V ÷ kaçak akım koşulunu sağlayın. Girişin iç direnci bu dirence paralel olduğu için hesaba katmanız gerekmez, yalnızca lehinize çalışır. 0,8 mA için sınır 6,25 kΩ'dur, dolayısıyla 4,7 kΩ uygundur. Sensör açıkken direnç yaklaşık 21 V ÷ 4,7 kΩ ≈ 4,5 mA taşır ve 0,1 W civarında ısı üretir; bu akım sensörün minimum yük akımına ulaşmasına da yardım eder. 0,5 W'lık bir direnç kullanın ve toplam akımı sensörün maksimum yük akımının altında tutun.
4.4 Ara röle ile bağlantı
Kod:
PNP sensör BK ---> K1 bobin A1 K1 kontak 13 <--- +24 V (giriş tarafı)
0 V -------------> K1 bobin A2 K1 kontak 14 ---> PLC girişi (sink)
(bastırma diyotlu röle modülü; bobin akımı sensör çıkışının taşıyabileceği akımın altında)
5. PNP ve NPN tiplerini karıştırmak veya dönüştürmek
| Yöntem | Uygun olduğu durum | Dikkat edilecekler |
|---|---|---|
| Doğru tipte sensör sipariş etmek | Neredeyse her zaman en temiz çözüm | Teslim süresi; depoda iki tipten de yedek tutun |
| Sensörü, ortak ucu öbür kutba bağlı başka bir giriş grubuna taşımak | Her giriş grubunun ayrı ortak ucu olan PLC'ler | Grubun tamamı tip değiştirir; projeyi güncelleyin |
| Ara röle | Galvanik yalıtım, farklı gerilimler, karışık tipler | Yavaş, kontak sıçraması, mekanik ömür |
| PNP/NPN dönüştürücü modül (optokuplörlü; DIN raya takılan ya da kablo arasına giren M12 tip) | Hızlı sinyaller, birkaç istisna sensör | Besleme, frekans sınırı, varsa sinyal ters çevirme ayarı |
| Pull-up veya pull-down direnci | Yavaş ve kritik olmayan sinyallerde geçici çözüm | Ters mantık, ısınma, giriş eşiklerine bağımlılık |
6. Multimetreyle ölçüm ve arıza bulma
Önce makineyi güvenli duruma getirin; durumu değişen bir giriş bir hareketi başlatabilir.- Kahverengi ile mavi arasındaki besleme gerilimini yalnızca güç kaynağında değil, sensörün konnektöründe de ölçün; değer sensörün besleme aralığında olmalıdır.
- PNP: PLC girişi bağlıyken siyah ile mavi arasını ölçün. Hedef varken besleme geriliminden sensörün gerilim düşümü kadar düşük bir değer görmelisiniz (kataloglar bu düşüm için en fazla birkaç volt verir, örneğin ≤ 3 V). Hedef yokken değer 0 V'a yakındır.
- NPN: Kahverengi ile siyah arasını ölçün. Hedef varken yine besleme geriliminden gerilim düşümü kadar düşük bir değer görürsünüz, çünkü siyah tel 0 V'a yakındır. Hedef yokken değer 0 V'a yakındır, çünkü source giriş siyah teli +24 V'a doğru çeker.
- Giriş klemensi ile grubun ortak ucu arasını ölçün. Kesin bir 1 için Tip 1 girişte en az 15 V, Tip 2 ve Tip 3'te en az 11 V gerekir.
- Hiçbir yere bağlı olmayan bir çıkışta görülen birkaç volt (bazen daha fazlası), yüksek iç dirençli ölçü aletinin gerilim olarak okuduğu kaçak akımdır. Yük altında ya da LoZ (düşük empedans) modunda ölçün.
- Arızanın sensörde mi PLC'de mi olduğunu ayırmak için sensörün siyah telini klemensten ayırın, ardından sink girişe sigortalı bir test kablosuyla kısa süre +24 V verin (source girişte 0 V). Giriş LED'i ve program tepki veriyorsa PLC tarafı sağlamdır.
Sensörün PNP mi NPN mi olduğunu ölçerek anlamak
Etiket okunmuyorsa ve katalog bulunamıyorsa çıkış tipini tezgâhta şöyle belirleyebilirsiniz:- Sensörü sigortalı bir 24 V kaynaktan besleyin: kahverengi +24 V'a, mavi 0 V'a.
- Siyah ile mavi arasına 4,7 kΩ, 0,5 W'lık bir direnç bağlayın; hedefi yaklaştırıp uzaklaştırırken direnç üzerindeki gerilimi izleyin (A konumu).
- Direnci siyah ile kahverengi arasına alıp ölçümü tekrarlayın (B konumu).
- Gerilim yalnızca A konumunda yaklaşık 24 V ile 0 V arasında değişiyorsa çıkış PNP, yalnızca B konumunda değişiyorsa NPN'dir. İki konumda da tam değişim görüyorsanız çıkış push-pull tiptedir.
- A konumunda (NPN için B konumunda) yaklaşık 24 V hedef varken görülüyorsa çıkış NO, hedef yokken görülüyorsa NC'dir.
| Belirti | Olası nedenler | Kontrol |
|---|---|---|
| Sensör LED'i yanıyor, PLC girişi gelmiyor | Sensör tipi ortak uca uymuyor; ortak uç bağlanmamış ya da yanlış kutupta; sensör, 0 V'u giriş devresinin 0 V'una bağlanmamış ikinci bir kaynaktan besleniyor; siyah tel kopuk | Çıkış gerilimi; giriş ile ortak uç arası gerilim; panonun topraklama konseptine göre 0 V bağlantıları |
| Giriş LED'i yanıyor, program 0 görüyor | Yanlış adres, modül yapılandırılmamış ya da arızalı, değer forse edilmiş, CPU STOP'ta | Donanım yapılandırması, I/O adresleri, forse tablosu, tanılama arabelleği (diagnostic buffer) |
| Giriş sürekli 1 | NC model takılmış; siyah yerine beyaz tel bağlanmış; Tip 1 girişte 2 telli sensör kaçağı; sinyal teli +24 V'a (PNP) ya da 0 V'a (NPN) kısa devre; sensör kendi braketini algılıyor | Parça numarası ve tel renkleri; sensörü söküp girişi izleyin; gömülü ya da gömülü olmayan montaj |
| Kesik kesik sinyal | Hedef algılama sınırında; titreşim; gevşek M12 rakoru; kablo zincirinde hasarlı kablo; motor ya da sürücü kablolarından gürültü; giriş filtre süresinden ya da PLC çevrim süresinden kısa darbeler | Sa'ya göre mesafe, kablo güzergâhı, konnektör, filtre ayarı; kısa darbeler için hızlı giriş ya da sayıcı |
| Kısa devreden sonra çıkış hiç anahtarlamıyor | Enerjinin kesilip verilmesini bekleyen kilitlemeli koruma ya da korumasız bir modelde yanmış çıkış katı | Enerjiyi kesip verin; katalogdaki kısa devre koruması bilgisini okuyun; yeni sensörü takmadan önce ezilmiş kabloyu bulun |
| Bir gruptaki bazı sensörler hiç çalışmıyor | Aynı ortak uçta PNP ve NPN karışık | Yeniden gruplayın ya da istisnaları dönüştürün (bölüm 5) |
7. Sensör seçimi kontrol listesi
- Çıkış tipi: Ortak ucu 0 V'ta olan gruba PNP, +24 V'ta olana NPN. Her makinede tek bir tipi standart olarak seçin ve bunu I/O listesine yazın.
- NO, NC veya tamamlayıcı: Kablo koptuğunda programın ne görmesi gerektiğine göre seçin.
- Besleme ve çıkış: Gerilim aralığı, çıkış akımı, gerilim düşümü, anahtarlama frekansı, kaçak akım (2 telli tiplerde), ters polarite ve kısa devre koruması.
- Algılama mesafesi: Nominal algılama mesafesi Sn, standart bir hedefle ölçülür. Bu hedef 1 mm kalınlığında, yumuşak çelikten kare bir levhadır; kenarı, algılama yüzeyinin çapına ya da 3 × Sn değerine (hangisi büyükse) eşittir. Tasarımı güvenli çalışma mesafesi Sa = 0,81 × Sn değerine göre yapın, ardından malzeme katsayısını uygulayın.
- Hedef malzemesi: Yayımlanan tipik katsayılar çeliğe göre paslanmaz çelikte yaklaşık 0,6-1,0, pirinçte 0,35-0,5, alüminyumda 0,3-0,5, bakırda 0,2-0,45 arasındadır. Geçerli olan sensörünüzün kataloğudur; karışık metaller için "faktör 1" sensörler de vardır.
- Montaj: Gömülü (flush) tipler metal bir yuvaya yüzeyle aynı hizada monte edilebilir; gömülü olmayan (non-flush) tipler daha uzağı algılar ama algılama yüzeyinin çevresinde metalsiz bir bölge ister.
- Hız: Anahtarlama frekansını makine hızı, giriş filtresi ve PLC çevrim süresiyle (scan time) karşılaştırın.
- Bağlantı ve ortam: M8 ya da M12 konnektör veya sabit kablo; yağ ve kablo zinciri için PUR kablo; temel seviye olarak IP67, yüksek basınçlı yıkama için IP69K.
- Kablo uzunluğu: Sinyal kablolarını motor kablolarından uzak tutun. IO-Link bağlantısı en fazla 20 m olabilir; bazı kataloglar kendi üst sınırını ayrıca verir.
Sık sorulan sorular
NPN sensörü PNP (sink) girişe bağlayabilir miyim?Doğrudan bağlayamazsınız. Giriş sink/source seçilebiliyorsa ve gruptaki tüm sensörler NPN olacaksa grubun ortak ucunu +24 V'a alın; değilse dönüştürücü modül ya da ara röle kullanın veya sensörü değiştirin. Pull-up direnci yalnızca geçici bir çözümdür ve mantığı ters çevirir.
PNP, NPN'den daha mı iyi?
Elektriksel olarak hayır. PNP lehine sık söylenen gerekçe şudur: 0 V'u topraklanmış sistemlerde makine gövdesine kısa devre olan bir sinyal teli, PNP bağlantıdaki girişi 0'da bırakır, NPN bağlantıdaki girişi ise 1 yapar. Aynı makine içinde tutarlılık daha önemlidir.
4 telli sensördeki beyaz kabloyu ne yapmalıyım?
Kataloğa bakın; genellikle tamamlayıcı çıkış ya da teşhis hattıdır. Kullanmıyorsanız ucunu yalıtın ve katalog aksini söylemedikçe besleme hatlarına bağlamayın, çünkü bazı modellerde bu tel öğretme (teach) ya da test girişidir.
3 telli sensörün yerine 2 telli sensör takabilir miyim?
Evet, ama bağlantı değişir: 2 telli sensör girişle seri bağlanır (bölüm 4.3). Giriş Tip 2 veya Tip 3 olmalı ya da teknik verileri sensörün kaçak akımına izin vermelidir; değilse bleeder direnci ekleyin. Ayrıca giriş, sensörün minimum yük akımından fazlasını çekmeli ve artık gerilim düştükten sonra girişte geçerli bir 1 gerilimi kalmalıdır.
Sensör kapalıyken multimetre çıkışta neden gerilim gösteriyor?
Kapalı çıkış boşta kalır ve yüksek iç dirençli ölçü aleti çok küçük bir kaçak akımı gerilim olarak okur. PLC girişi bağlıyken ya da LoZ modunda ölçün.
Sonuç ve sonraki adımlar
PNP ile NPN arasındaki seçim bir kalite meselesi değil, eşleştirme meselesidir: Sensör bir kutbu anahtarlar, girişin ortak ucu ise öbür kutupta durur. Parça değiştirmeden önce bağlantı şemasını okuyun, ortak ucun nereye bağlandığına bakın ve iki gerilim ölçümü yapın. Ardından elektrik projelerinde her giriş grubunun ortak kutbunu ve kabul ettiği sensör tipini işaretleyin, iki çıkış tipinden de yedek bulundurun ve her yeni I/O listesine PNP/NPN sütunu ekleyin. Karışık ekipmanlı bir hatta I/O planlaması ya da devreye alma yapacaksanız, AIOR'un PLC otomasyon ve endüstriyel kontrol hizmeti I/O listelerini, saha testlerini ve devreye almayı kapsar.A replacement proximity sensor is wired like the old one, its yellow LED lights when the target passes, yet the PLC input stays dark. Usually nothing is broken: the sensor has the wrong output type for that input group, or the input common is on the wrong side of the supply. This guide covers PNP and NPN outputs, sinking and sourcing inputs, wire colours, 2-wire sensors, conversion options and multimeter checks for 24 V DC sensors on standard digital inputs. Safety functions such as guard locking and light curtains need safety-rated parts and are out of scope.
1. PNP vs NPN in plain language
A 3-wire DC sensor has a transistor output that acts as an electronic switch. The two types differ in which supply rail they connect to the output wire:- PNP (sourcing output): when active, it connects the output to +24 V. The load (the PLC input) sits between the output and 0 V, and current flows out of the sensor.
- NPN (sinking output): when active, it connects the output to 0 V. The load sits between +24 V and the output, and current flows into the sensor.
When off, a standard output does not drive the wire to the other rail. It stops conducting and the wire floats (open collector) until the PLC input pulls it to its own reference. Some sensors, often IO-Link models, offer push-pull or selectable PNP/NPN outputs.
The choice is mostly convention; electrically, both types do the same job. As a tendency, European machines mostly use PNP, while NPN has traditionally been more common on Japanese and other Asian equipment. Treat that only as a tendency: the machine's electrical drawings and the sensor label tell you what is actually fitted. Turkish plants use both, so check every machine.
2. Wire colours, NO/NC and reading the label
IEC 60947-5-2, the proximity switch standard, defines the wire colours most manufacturers use, and M12 pin numbers follow the same pattern:| Colour | Code | M12 pin | Function on a 3- or 4-wire DC sensor |
|---|---|---|---|
| Brown | BN | 1 | Supply + (L+), often 10-30 V DC; check your model |
| Blue | BU | 3 | Supply 0 V (L-, M) |
| Black | BK | 4 | Switching output (often NO); C/Q line on IO-Link sensors |
| White | WH | 2 | Second output (often the complementary NC), or a diagnostic or teach line on some models |
NO or NC: a normally open (NO) output is active when the target is present, a normally closed (NC) output when it is absent. Complementary (antivalent) 4-wire sensors give both, usually black as NO and white as NC.
Order codes are structured differently by each manufacturer, so instead of guessing from the part number, read the connection diagram on the housing, the label or the datasheet: a load drawn between black and blue means PNP, a load between black and brown means NPN.
3. PLC inputs: sinking, sourcing and IEC 61131-2 types
A DC digital input is essentially an optocoupler LED with a current limiter, connected between the input terminal and the group's common terminal. It turns on only when current flows through it, so the sensor's switched rail and the common must be on opposite sides of the supply:| Sensor | Input type (usual naming) | Input common goes to | Current path |
|---|---|---|---|
| PNP | Sinking input (German: P-lesend) | 0 V | Sensor → input → common → 0 V |
| NPN | Sourcing input (German: M-lesend) | +24 V | +24 V → common → input → sensor → 0 V |
IEC 61131-2 input types
IEC 61131-2 defines three characteristics for 24 V DC current-sinking inputs. The table summarises the standard's 24 V DC limits; see the standard itself for the full definitions. Your module's technical data states which type it is.| Type | Intended for | Signal 1 (ON) | Highest current guaranteed to read 0 |
|---|---|---|---|
| Type 1 | Mechanical contacts and 3-wire sensors | 15-30 V, 2-15 mA | about 0.5 mA |
| Type 2 | 2-wire semiconductor sensors, higher input current | 11-30 V, 6-30 mA | about 2 mA |
| Type 3 | 2- and 3-wire sensors, lower power than Type 2 | 11-30 V, 2-15 mA | about 1.5 mA |
Brand terminology traps
- Siemens: a "sinking input" (P-lesend) takes PNP sensors and a "sourcing input" (M-lesend) takes NPN sensors. On S7-1200 CPUs the group common is 1M: wire it to 0 V for PNP or to +24 V for NPN. Many S7-1500 and ET 200SP DI modules accept only PNP sensors; variants with "SRC" (sourcing) in the name are for NPN sensors.
- Mitsubishi FX: the common is S/S and the terms are reversed. Mitsubishi's "sink input" ties S/S to 24 V and turns on when the input is switched to 0 V, so it takes NPN sensors; its "source input" ties S/S to 0 V and takes PNP sensors.
- Omron and others: the common is usually COM. Omron's NX catalogue labels DC input units NPN, PNP or NPN/PNP by the sensor type they accept, for example NX-ID3317 as NPN and NX-ID3417 as PNP.
4. Wiring examples
4.1 PNP sensor on a sinking input
Kod:
24 V PSU PNP sensor (NO) PLC input group
+24 V o--------------- BN brown (+V)
BK black (output) ------> I0.0
0 V o----+---------- BU blue (0 V)
|
+----------------------------------> 1M / S/S / COM (common)
Target present: BK = about +24 V, current BK -> I0.0 -> common -> 0 V, input ON.
4.2 NPN sensor on a sink/source-selectable input
Kod:
24 V PSU NPN sensor (NO) PLC input group
+24 V o----+---------- BN brown (+V)
|
+----------------------------------> 1M / S/S / COM (common)
BK black (output) ------> I0.1
0 V o--------------- BU blue (0 V)
Target present: BK = 0 V, current +24 V -> common -> I0.1 -> BK -> 0 V, input ON.
4.3 2-wire DC sensor
Kod:
Sinking input (common at 0 V): +24 V -> BN (sensor) BU -> I0.2 ... 1M -> 0 V
Sourcing input (common at +24 V): +24 V -> 1M ... I0.3 -> BN (sensor) BU -> 0 V
If the leakage exceeds the input's limit, fit a bleeder resistor across the input. The goal is to keep the input below 5 V while the sensor is off, so choose R ≤ 5 V ÷ leakage current. You can ignore the input's own resistance: it sits in parallel with the resistor and only helps. That gives 6.25 kΩ for 0.8 mA, so 4.7 kΩ works. With the sensor on, the resistor carries about 21 V ÷ 4.7 kΩ ≈ 4.5 mA and dissipates about 0.1 W; that current also helps the sensor reach its minimum load current. Use a 0.5 W part and keep the total below the sensor's maximum load current.
4.4 Relay interface
Kod:
PNP sensor BK ---> K1 coil A1 K1 contact 13 <--- +24 V (input side)
0 V -------------> K1 coil A2 K1 contact 14 ---> PLC input (sinking)
(relay module with suppression diode; coil current within sensor rating)
5. Mixing or converting PNP and NPN
| Method | Good for | Watch out for |
|---|---|---|
| Order the correct sensor type | Almost always the cleanest fix | Lead time; keep spares of both types |
| Move the sensor to a group whose common is wired the other way | PLCs with a separate common per group | The whole group changes type; update the drawings |
| Interface relay | Isolation, different voltages, mixed types | Slow, contact bounce, mechanical life |
| PNP/NPN converter module (optocoupler based, DIN rail or inline M12) | Fast signals, a few odd sensors | Supply, frequency limit, inversion setting if present |
| Pull-up or pull-down resistor | Temporary fix on slow, non-critical signals | Inverted logic, heat, depends on input thresholds |
6. Measuring and troubleshooting with a multimeter
First put the machine in a safe state, because a changing input can start motion.- Measure the supply between brown and blue at the sensor connector, not only at the power supply; it must be within the sensor's supply range.
- PNP: measure black to blue with the PLC input connected. Target present: the supply minus the sensor's voltage drop (datasheets quote a few volts at most, for example ≤ 3 V). Target absent: near 0 V.
- NPN: measure brown to black. Target present: the supply minus the voltage drop, because black is near 0 V. Target absent: near 0 V, because the sourcing input pulls black towards +24 V.
- Measure the input terminal against its common. A guaranteed ON needs at least 15 V on a Type 1 input and 11 V on Types 2 and 3.
- A few volts (sometimes more) on an unconnected output is leakage read by a high-impedance meter. Measure under load or in LoZ (low-impedance) mode.
- To separate sensor and PLC faults, disconnect the sensor's black wire from the terminal, then touch a sinking input briefly with a fused test lead from +24 V (a sourcing input from 0 V). If the input LED and the program respond, the PLC side is fine.
How to tell if a sensor is PNP or NPN by measurement
If the label is unreadable and no datasheet can be found, identify the output on the bench:- Feed the sensor from a fused 24 V supply: brown to +24 V, blue to 0 V.
- Connect a 4.7 kΩ, 0.5 W resistor between black and blue, then watch the voltage across it while you move a target towards and away from the sensing face (position A).
- Move the resistor between black and brown and repeat (position B).
- A swing between about 24 V and 0 V only in position A means PNP; only in position B, NPN. A full swing in both positions means push-pull.
- If the 24 V reading in position A (position B for NPN) appears with the target present, the output is NO; if it appears with the target absent, it is NC.
| Symptom | Likely causes | What to check |
|---|---|---|
| Sensor LED on, PLC input off | Sensor type does not match the common; common missing or on the wrong rail; sensor fed from a second supply whose 0 V is not linked to the 0 V of the input circuit; broken black wire | Output voltage; input-to-common voltage; 0 V links according to the panel's earthing concept |
| Input LED on, program sees 0 | Wrong address, module not configured or faulty, value forced, CPU in STOP | Hardware configuration, I/O addresses, force table, diagnostic buffer |
| Input always on | NC variant fitted; white wire used instead of black; 2-wire leakage on a Type 1 input; signal wire shorted to +24 V (PNP) or 0 V (NPN); sensor detects its own bracket | Part number and wire colours; unplug the sensor and watch the input; flush or non-flush mounting |
| Intermittent signal | Target at the edge of the range; vibration; loose M12 coupling nut; damaged drag-chain cable; noise from motor or drive cables; pulses shorter than the input filter or scan time | Distance against Sa, cable route, connector, filter setting; fast inputs or counters for short pulses |
| Output dead after a short circuit | Latching protection waiting for a power cycle, or an unprotected output stage destroyed | Cycle the power; read the datasheet's short-circuit protection entry; find the pinched cable before fitting a new sensor |
| Some sensors in a group never work | PNP and NPN mixed on one common | Regroup, or convert the odd ones (section 5) |
7. Selection checklist
- Output type: PNP for a common at 0 V, NPN for a common at +24 V. Standardise on one type per machine and record it in the I/O list.
- NO, NC or complementary: decide what a broken cable should look like to the program.
- Supply and output: voltage range, output current, voltage drop, switching frequency, leakage current (2-wire types), reverse-polarity and short-circuit protection.
- Sensing distance: the rated distance Sn is measured on a standard target, a 1 mm mild steel square whose side equals the sensing-face diameter or 3 × Sn, whichever is larger. Design to the assured operating distance Sa = 0.81 × Sn, then apply the material factor.
- Target material: typical published factors relative to steel are about 0.6-1.0 for stainless steel, 0.35-0.5 for brass, 0.3-0.5 for aluminium and 0.2-0.45 for copper. Your datasheet's values are the ones that count; "factor 1" sensors exist for mixed metals.
- Mounting: flush (embeddable) heads tolerate surrounding metal; non-flush heads reach further but need a metal-free zone around the face.
- Speed: compare the switching frequency with the machine speed, the input filter and the scan time.
- Connection and environment: M8 or M12 connector or fixed cable; PUR cable for oil and drag chains; IP67 as a baseline, IP69K for high-pressure washdown.
- Cable length: keep signal cables away from motor cables. IO-Link connections are limited to 20 m, and some datasheets set their own maximum.
FAQ
Can I connect an NPN sensor to a PNP (sinking) input?Not directly. If the input is sink/source-selectable and every sensor on that group will be NPN, move the group common to +24 V; otherwise use a converter module or an interface relay, or replace the sensor. A pull-up resistor is only a temporary fix, and it inverts the logic.
Is PNP better than NPN?
Electrically, no. A common argument for PNP is that with an earthed 0 V, a signal wire shorted to the machine frame leaves a PNP input OFF but turns an NPN input ON. Consistency within a machine matters more.
What do I do with the white wire on a 4-wire sensor?
Check the datasheet; it is usually a complementary output or a diagnostic line. If you do not use it, insulate the end and keep it off the supply rails unless the datasheet says otherwise, since on some models it is a teach or test input.
Can a 2-wire sensor replace a 3-wire one?
Yes, but the wiring changes: a 2-wire sensor goes in series with the input (section 4.3). The input should be Type 2 or Type 3, or its datasheet must allow the sensor's leakage current; otherwise add a bleeder resistor. The input must also draw more than the sensor's minimum load current and still see a valid ON voltage after the residual voltage drop.
Why does my multimeter show a voltage on the output when the sensor is off?
An output that is off floats, and a high-impedance meter reads a tiny leakage current as a voltage. Measure with the PLC input connected or in LoZ mode.