İçeriğe geç
KURUMSAL Kurumsal teknoloji · İşletmenize özel mühendislik Kurumsal Yazılım · Yönetilen Sunucular · Kurumsal E-posta · LiteSpeed + CloudLinux · Imunify360 Güvenlik · cPanel Yönetim · Uygun pakette 3 Gbps'ye kadar ağ profili
AIOR

PNP ve NPN Farkı: Sensör Bağlantısı ve PLC Sink/Source Girişleri

  • Konu başlatıcısı Konu başlatıcısı Aior
  • Başlangıç tarihi Başlangıç tarihi

Aior

Administrator

Yetkili üye
Katıldı
2 Nis 2023
Mesajlar
929
Tepki puanı
2
Puan
18
Yaş
41
Konum
Turkey
Web sitesi
aior.com
Konu sahibi

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.
Akılda tutmak için ilk harfe bakın, anahtarlanan hattı o söyler: PNP'de Pozitif, NPN'de Negatif (0 V). Başka bir deyişle PNP sensör yükün artı tarafındaki, NPN sensör ise eksi tarafındaki anahtardır.

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:
RenkKodM12 pini3 veya 4 telli DC sensörde görevi
KahverengiBN1Besleme artı (L+), çoğunlukla 10-30 V DC; modelinize bakın
MaviBU3Besleme 0 V (L-, M)
SiyahBK4Anahtarlama çıkışı (çoğunlukla NO); IO-Link sensörlerde C/Q hattı
BeyazWH2İkinci çıkış (çoğunlukla tamamlayıcı NC) ya da bazı modellerde teşhis veya öğretme (teach) hattı
3 pinli M8 konnektörlerde aynı görevler için 1, 3 ve 4 numaralı pinler kullanılır. 2 telli DC sensörlerde yalnızca kahverengi ve mavi tel bulunur; bazılarında kutup yönü önemli değildir, bazıları ise kahverengi telin artı tarafa bağlanmasını ister.

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örGiriş tipi (yaygın adlandırma)Ortak ucun bağlandığı yerAkım yolu
PNPSink giriş, akım çeken (Almanca: P-lesend)0 VSensör → giriş → ortak → 0 V
NPNSource giriş, akım veren (Almanca: M-lesend)+24 V+24 V → ortak → giriş → sensör → 0 V
Akılda tutulacak tek kural: Ortak uç 0 V'taysa PNP sensör, +24 V'taysa NPN sensör bağlanır; kılavuz o girişe hangi adı verirse versin. Tip uyuşmazlığı çoğu zaman bir şeyi bozmaz; sadece giriş hiç 1 olmaz.

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.
TipKullanım amacıSinyal 1 (ON)0 okunması garanti edilen en yüksek akım
Tip 1Mekanik kontaklar ve 3 telli sensörler15-30 V, 2-15 mAyaklaşık 0,5 mA
Tip 22 telli yarı iletken sensörler, yüksek giriş akımı11-30 V, 6-30 mAyaklaşık 2 mA
Tip 32 ve 3 telli sensörler, Tip 2'den düşük güç11-30 V, 2-15 mAyaklaşık 1,5 mA
5 V'un altındaki gerilim her tipte 0 okunur. Son sütun, kapalıyken de az miktarda kaçak akım geçiren 2 telli sensörler için önemlidir. Siemens'in IEC 61131-2 SSS dokümanına göre Tip 1 girişler 2 telli yarı iletken sensörlere uygun değildir. Siemens modüllerinin teknik verilerinde bu sınır "permissible quiescent current (2-wire sensors)", yani 2 telli sensörler için izin verilen bekleme akımı satırında verilir.

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.
Bu örnekleri kendi modelinizin kılavuzunda doğrulayın. Etiketler çeliştiğinde ortak ucun hangi kutba bağlı olduğuna bakın. Henüz PLC seçimi aşamasındaysanız PLC platform seçimi konumuz bu kararın bakım tarafını ele alıyor.

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.
Bu ortak ucu paylaşan her girişe artık NPN sensör ya da 0 V'a anahtarlanan kuru kontak bağlanmalıdır.

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
2 telli sensör çalışma akımını yükün üzerinden çeker. Kaçak akımı (leakage current) sensör kapalıyken de girişten geçer; girişin 0 sınırını aşarsa giriş sürekli 1 kalır ya da titrer. Sensör açıkken giriş en az sensörün minimum yük akımını çekmelidir; ayrıca sensörün üzerinde düşen artık gerilim yüzünden girişe beslemenin tamamı ulaşmaz. Örneğin yaygın kullanılan 2 telli bir DC sensörün kataloğunda 0,8 mA kaçak akım, 3 V artık gerilim ve 3-100 mA yük akımı aralığı yazar. Bu kaçak akım Tip 3 sınırının altında, Tip 1 sınırının ise üstündedir; giriş de en az 3 mA çekmelidir.

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)
Kuru kontak her iki giriş tipini, hatta farklı bir besleme gerilimindeki bir girişi sürebilir. Bedeli birkaç milisaniyelik gecikme, kontak sıçraması (bounce) ve aşınmadır; röleyi sayma ve hızlı sinyallerden uzak tutun.

5. PNP ve NPN tiplerini karıştırmak veya dönüştürmek​

YöntemUygun olduğu durumDikkat edilecekler
Doğru tipte sensör sipariş etmekNeredeyse her zaman en temiz çözümTeslim süresi; depoda iki tipten de yedek tutun
Sensörü, ortak ucu öbür kutba bağlı başka bir giriş grubuna taşımakHer giriş grubunun ayrı ortak ucu olan PLC'lerGrubun tamamı tip değiştirir; projeyi güncelleyin
Ara röleGalvanik yalıtım, farklı gerilimler, karışık tiplerYavaş, 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örBesleme, frekans sınırı, varsa sinyal ters çevirme ayarı
Pull-up veya pull-down direnciYavaş ve kritik olmayan sinyallerde geçici çözümTers mantık, ısınma, giriş eşiklerine bağımlılık
Direnç yöntemi neden son çaredir? NPN sensör teli yalnızca 0 V'a çekebildiği için sink girişi tek başına süremez. Siyah tel ile +24 V arasına bir pull-up (yukarı çekme) direnci koyarsanız, sensör kapalıyken direnç girişi 1 yapar; sensör iletime geçince tel 0 V'a düşer ve giriş 0 olur. Sinyal ters döner (NO sensör NC gibi davranır); bunu programda düzeltin ya da NC varyantı sipariş edin. Pull-up direnci, girişle oluşturduğu gerilim bölücüde geçerli bir ON gerilimi bırakacak kadar küçük olmalıdır ve sensör her iletime geçtiğinde güç harcar. Örnek: 24 V'ta yaklaşık 4 mA çeken bir giriş kabaca 6 kΩ gibi davranır. 1,5 kΩ'luk pull-up ile girişe yaklaşık 24 × 6 / 7,5 ≈ 19 V düşer ve direnç 24² / 1500 ≈ 0,38 W harcar; en az 1 W'lık direnç kullanın. Akım sınırlamalı girişler basit bir direnç gibi davranmaz, sonucu mutlaka ölçün. PNP sensörün source girişe bağlanması bunun ayna görüntüsüdür: 0 V'a bir pull-down direnci gerekir ve sinyal yine ters döner.

6. Multimetreyle ölçüm ve arıza bulma​

Önce makineyi güvenli duruma getirin; durumu değişen bir giriş bir hareketi başlatabilir.
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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:
  1. Sensörü sigortalı bir 24 V kaynaktan besleyin: kahverengi +24 V'a, mavi 0 V'a.
  2. 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).
  3. Direnci siyah ile kahverengi arasına alıp ölçümü tekrarlayın (B konumu).
  4. 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.
  5. 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.

BelirtiOlası nedenlerKontrol
Sensör LED'i yanıyor, PLC girişi gelmiyorSensö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üyorYanlış adres, modül yapılandırılmamış ya da arızalı, değer forse edilmiş, CPU STOP'taDonanım yapılandırması, I/O adresleri, forse tablosu, tanılama arabelleği (diagnostic buffer)
Giriş sürekli 1NC 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ıyorParç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 sinyalHedef 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 darbelerSa'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ıyorEnerjinin 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ıyorAynı ortak uçta PNP ve NPN karışıkYeniden gruplayın ya da istisnaları dönüştürün (bölüm 5)
Ayrıca birçok PLC, dijital girişleri varsayılan olarak birkaç milisaniyelik bir filtreden geçirir (S7-1200'de 6,4 ms); hızlı bir konveyörün kısa darbeleri, bağlantı kusursuz olsa bile kaçabilir. Devreye alma sırasında panoda karşılaşılan diğer sorunlar için saha devreye alma notlarımıza göz atın.

7. Sensör seçimi kontrol listesi​

  1. Çı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.
  2. NO, NC veya tamamlayıcı: Kablo koptuğunda programın ne görmesi gerektiğine göre seçin.
  3. 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ı.
  4. 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.
  5. 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.
  6. 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.
  7. Hız: Anahtarlama frekansını makine hızı, giriş filtresi ve PLC çevrim süresiyle (scan time) karşılaştırın.
  8. 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.
  9. 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.
Hesap örneği: Sn = 12 mm olan, gömülü olmayan bir M18 sensörde çelik için Sa ≈ 9,7 mm'dir. Katalog alüminyum için 0,4 veriyorsa alüminyum bir bayrakta güvenilir mesafe yaklaşık 3,9 mm olur; sensörü çelik için hesaplanan mesafeye değil, 3 mm civarına monte edin. Açık/kapalı sinyallerin ötesindeki sensör spesifikasyonu için endüstriyel sensör spesifikasyonu konumuza bakın. Patlayıcı ortamlarda (Ex) sık kullanılan NAMUR sensörler (IEC 60947-5-6) ise ayrı, düşük akımlı bir arayüz kullanır; ne PNP ne de NPN'dir ve bir anahtarlama yükselticisi (switching amplifier) ister.

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.
Memory aid: the first letter names the switched rail, Positive for PNP and Negative (0 V) for NPN. A PNP sensor is a switch on the plus side of the load, an NPN sensor a switch on the minus side.

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:
ColourCodeM12 pinFunction on a 3- or 4-wire DC sensor
BrownBN1Supply + (L+), often 10-30 V DC; check your model
BlueBU3Supply 0 V (L-, M)
BlackBK4Switching output (often NO); C/Q line on IO-Link sensors
WhiteWH2Second output (often the complementary NC), or a diagnostic or teach line on some models
3-pin M8 connectors use pins 1, 3 and 4 for the same functions. 2-wire DC sensors have only brown and blue; some are polarity-independent, others need brown on the positive side.

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:
SensorInput type (usual naming)Input common goes toCurrent path
PNPSinking input (German: P-lesend)0 VSensor → input → common → 0 V
NPNSourcing input (German: M-lesend)+24 V+24 V → common → input → sensor → 0 V
The one rule to remember: a common at 0 V takes PNP sensors, a common at +24 V takes NPN sensors, whatever the manual calls the input. A mismatch rarely damages anything; the input simply never turns on.

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.
TypeIntended forSignal 1 (ON)Highest current guaranteed to read 0
Type 1Mechanical contacts and 3-wire sensors15-30 V, 2-15 mAabout 0.5 mA
Type 22-wire semiconductor sensors, higher input current11-30 V, 6-30 mAabout 2 mA
Type 32- and 3-wire sensors, lower power than Type 211-30 V, 2-15 mAabout 1.5 mA
Below 5 V every type reads 0. The last column matters for 2-wire sensors, which leak a little current even when off. According to Siemens' FAQ on IEC 61131-2, Type 1 inputs are not suitable for 2-wire semiconductor sensors, and Siemens module datasheets give the limit as "permissible quiescent current (2-wire sensors)".

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.
Verify these examples in the manual for your exact model. When labels conflict, check which rail the common is wired to. If you are still choosing a controller, our PLC platform selection thread covers the maintenance side of that decision.

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.
Every input on this common must now be an NPN sensor or a dry contact switched to 0 V.

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
A 2-wire sensor draws its operating current through the load. Its leakage current flows through the input even when the sensor is off; above the input's off-state limit, the input stays on or flickers. When the sensor is on, the input must draw at least its minimum load current, and the sensor's residual voltage leaves the input with less than the full supply. For example, one widely used 2-wire DC sensor lists 0.8 mA leakage, 3 V residual voltage and a 3-100 mA load current range. That leakage is under the Type 3 limit but over the Type 1 limit, and the input must draw at least 3 mA.

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)
The dry contact can feed either input type or an input on another supply voltage. The cost is a few milliseconds of delay, contact bounce and wear, so keep relays away from counting and fast signals.

5. Mixing or converting PNP and NPN​

MethodGood forWatch out for
Order the correct sensor typeAlmost always the cleanest fixLead time; keep spares of both types
Move the sensor to a group whose common is wired the other wayPLCs with a separate common per groupThe whole group changes type; update the drawings
Interface relayIsolation, different voltages, mixed typesSlow, contact bounce, mechanical life
PNP/NPN converter module (optocoupler based, DIN rail or inline M12)Fast signals, a few odd sensorsSupply, frequency limit, inversion setting if present
Pull-up or pull-down resistorTemporary fix on slow, non-critical signalsInverted logic, heat, depends on input thresholds
Why the resistor method is a last resort: an NPN sensor can only pull a wire to 0 V, so it cannot turn on a sinking input by itself. A pull-up resistor from black to +24 V turns the input on while the sensor is off; when the sensor conducts, the wire drops to 0 V and the input turns off. The signal is inverted (NO behaves as NC), so handle it in the program or order the NC variant. The pull-up must be small enough to leave a valid ON voltage in the divider it forms with the input, and it dissipates power whenever the sensor conducts. Example: an input rated at about 4 mA at 24 V looks roughly like 6 kΩ. A 1.5 kΩ pull-up then gives about 24 × 6 / 7.5 ≈ 19 V at the input and dissipates 24² / 1500 ≈ 0.38 W, so use at least a 1 W resistor. Current-limited inputs are not plain resistors, so measure the result. A PNP sensor on a sourcing input is the mirror image: a pull-down resistor to 0 V, with the same inversion.

6. Measuring and troubleshooting with a multimeter​

First put the machine in a safe state, because a changing input can start motion.
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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:
  1. Feed the sensor from a fused 24 V supply: brown to +24 V, blue to 0 V.
  2. 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).
  3. Move the resistor between black and brown and repeat (position B).
  4. 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.
  5. 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.

SymptomLikely causesWhat to check
Sensor LED on, PLC input offSensor 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 wireOutput voltage; input-to-common voltage; 0 V links according to the panel's earthing concept
Input LED on, program sees 0Wrong address, module not configured or faulty, value forced, CPU in STOPHardware configuration, I/O addresses, force table, diagnostic buffer
Input always onNC 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 bracketPart number and wire colours; unplug the sensor and watch the input; flush or non-flush mounting
Intermittent signalTarget 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 timeDistance against Sa, cable route, connector, filter setting; fast inputs or counters for short pulses
Output dead after a short circuitLatching protection waiting for a power cycle, or an unprotected output stage destroyedCycle 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 workPNP and NPN mixed on one commonRegroup, or convert the odd ones (section 5)
Many PLCs also filter digital inputs by a few milliseconds by default (6.4 ms on the S7-1200), so short pulses from a fast conveyor can be missed even with perfect wiring. For other problems that turn up in the cabinet during commissioning, see our field commissioning notes.

7. Selection checklist​

  1. 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.
  2. NO, NC or complementary: decide what a broken cable should look like to the program.
  3. Supply and output: voltage range, output current, voltage drop, switching frequency, leakage current (2-wire types), reverse-polarity and short-circuit protection.
  4. 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.
  5. 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.
  6. Mounting: flush (embeddable) heads tolerate surrounding metal; non-flush heads reach further but need a metal-free zone around the face.
  7. Speed: compare the switching frequency with the machine speed, the input filter and the scan time.
  8. 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.
  9. Cable length: keep signal cables away from motor cables. IO-Link connections are limited to 20 m, and some datasheets set their own maximum.
Worked example: an M18 non-flush sensor with Sn = 12 mm has Sa ≈ 9.7 mm on steel. If the datasheet gives 0.4 for aluminium, the reliable range on an aluminium flag is about 3.9 mm, so mount it at around 3 mm, not at the steel figure. For specifying sensors beyond on/off signals, see our guide to specifying industrial sensors. NAMUR sensors (IEC 60947-5-6), common in hazardous (Ex) areas, are a separate low-current interface; they are neither PNP nor NPN and need a switching amplifier.

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.

Conclusion and next steps​

PNP versus NPN is a matching problem, not a quality choice: the sensor switches one rail, and the input common belongs on the other. Before replacing parts, read the connection diagram, check where the common is wired and take two voltage readings. Then mark each input group's common polarity and accepted sensor type in your drawings, keep spares of both output types, and add a PNP/NPN column to every new I/O list. For I/O planning or commissioning on a line with mixed equipment, AIOR's PLC automation and industrial control service covers I/O lists, field testing and commissioning.
 

Forum istatistikleri

Konular
925
Mesajlar
932
Üyeler
26
En son üye
Jessicawatson

Çevrimiçi üyeler

Şu anda çevrimiçi üye yok.

Öne çıkan içerik

AIOR
AIOR TEKNOLOJİ

Tüm ihtiyaçlarınız için Teklif alın

Hosting · Domain · Sunucu · Tasarım · Yazılım · Mühendislik · Sektörel Çözümler

Teklif al

7/24 Destek · Anında yanıt

Geri
Üst