Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›E3F-DS30 and E3F1-DS5 Photoelectric Switches

Component guide · Intermediate · 6 min read

E3F-DS30 and E3F1-DS5 Photoelectric Switches

NPN, PNP and AC) and Aotoro ED30, ER18, EK51 Photoelectric Sensors

By Geekobot Learning Team · Updated 29 Oct 2026

On this page
Short answerWhat the E3F-DS30 and Aotoro photoelectric switches (M18, M30 and square) isE3F-DS30 and Aotoro photoelectric switches (M18, M30 and square) pinoutWiring the E3F-DS30 and Aotoro photoelectric switches (M18, M30 and square)Example codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Short answer

The E3F family are low-cost M18 photoelectric switches used in counters, conveyors and DIY automation. E3F-DS30 models are diffuse with up to 30 cm range; the suffix tells the output: C4 is NPN NO, P1 PNP NO, P2 PNP NC and Y1 or Y2 are AC two-wire. Aotoro ED30, ER18 and EK51 sensors cover diffuse and retro-reflective versions in M30, M18 and square bodies.

Key specs at a glance

Body
M18 threaded (E3F, ER18), M30 (ED30), square (EK51, CDD)
Range
5 cm to 80 cm diffuse, up to 6 m retro-reflective
Supply
6-36V DC, 10-30V DC or 90-250V AC (Y versions)
Output
NPN or PNP, NO or NC; AC two-wire on Y types
Adjustment
Sensitivity screw on the back
Indicator
LED on when the output switches

Models in this guide

These are alternatives. Pick the one that fits your project; you only need one.

  • Option 1E3F-DS30C4 Infrared Photoelectric Sensor Switch – NPN NO, DC 6-36V₹186
  • Option 2E3F-DS30C4 Photoelectric Sensor, NPN NO, DC 6-36V, 30 cm Detection₹729
  • Option 3E3F-DS30P1 Photoelectric Sensor PNP NO, DC 6–36V, 5–30 cm Range₹729
  • Option 4E3F-DS30P2 Photoelectric Sensor PNP NC, 5–30 cm Detection Range, DC 6–36V₹729
  • Option 5E3F-DS30Y1 / RF18-30A1 Photoelectric Sensor NO, AC 90–250V, 400mA, Detection Range 5–30 cm₹392
  • Option 6E3F-DS30Y2 / RF18-30A2 Photoelectric Sensor NC, AC 90–250V, 200mA, Detection Range 5–30 cm₹319
01

What the E3F-DS30 and Aotoro photoelectric switches (M18, M30 and square) is

E3F and Aotoro photoelectric switches are industrial sensors in threaded or square housings that detect objects with a light beam, using diffuse, retro-reflective or through-beam modes.

Pick the suffix carefully. C4 or B2 means NPN, which works with an Arduino using INPUT_PULLUP. P1 or P2 means PNP, which outputs the supply voltage and suits most PLCs. Y1 and Y2 are AC two-wire switches that go in series with a mains load like a relay coil or contactor, and must never be connected to a microcontroller.

Diffuse range depends on the object: white card gives the quoted range, dark or small objects give much less. Turn the screw until the LED just switches on the object, then back off a little.

02

E3F-DS30 and Aotoro photoelectric switches (M18, M30 and square) pinout

The pins on the E3F-DS30 and Aotoro photoelectric switches (M18, M30 and square) and what each one does.

PinFunction
Brown+V supply, 10-30V DC on most
Blue0V
BlackSwitching output (NPN or PNP)
WhiteSecond output or NC output on 4-wire types
M8/M12 pins1 brown, 2 white, 3 blue, 4 black
PinFunction
Brown
+V supply, 10-30V DC on most
Blue
0V
Black
Switching output (NPN or PNP)
White
Second output or NC output on 4-wire types
M8/M12 pins
1 brown, 2 white, 3 blue, 4 black
03

Wiring the E3F-DS30 and Aotoro photoelectric switches (M18, M30 and square)

AC versions (Y1, Y2) switch mains in series with the load. Keep them away from low-voltage electronics. Never connect a PNP output straight to a 5V or 3.3V pin; it outputs the full supply voltage. Use a divider or an optocoupler input.

E3F-DS30 and Aotoro photoelectric switches (M18, M30 and square) pinConnectionNote
Brown24V +Same supply ground as the controller
Blue0VCommon with Arduino GND
Black (NPN)Arduino D2 with INPUT_PULLUPOpen collector pulls the pin LOW
Black (PNP)10k / 2.2k divider to D2About 4.3V at 24V
Brown
Connection:
24V +
Note:
Same supply ground as the controller
Blue
Connection:
0V
Note:
Common with Arduino GND
Black (NPN)
Connection:
Arduino D2 with INPUT_PULLUP
Note:
Open collector pulls the pin LOW
Black (PNP)
Connection:
10k / 2.2k divider to D2
Note:
About 4.3V at 24V
04

Example code

For a PNP sensor, read through a divider or optocoupler and count the rising edge instead of the falling edge.

Read an NPN industrial sensor with an Arduino Uno · Arduino C++Verify & upload in Electrolark
// Sensor powered from 24V, blue wire to Arduino GND.
// NPN open-collector output (black) to D2.
const int SENSOR = 2;
bool last = HIGH;
unsigned long count = 0;

void setup() {
  Serial.begin(9600);
  pinMode(SENSOR, INPUT_PULLUP);
}

void loop() {
  bool now = digitalRead(SENSOR);
  if (last == HIGH && now == LOW) {   // object arrived
    count++;
    Serial.print("Object detected, count = ");
    Serial.println(count);
  }
  last = now;
  delay(2);
}
05

Setup and tuning

Check the output

NPN or PNP, normally open or closed; match it to your PLC or circuit.

Supply

most run on 6 to 36 V DC; AC versions run on mains and must be wired safely.

Microcontroller input

use an optocoupler or divider; never connect 12 to 24 V outputs straight to a 3.3 V pin.

Adjust sensitivity

set the pot so the target triggers reliably but the background does not.

Reflector alignment

align retro-reflective sensors carefully with their reflector.

06

What you need

Shop this list20 of 20 found in our store · ₹14,739

  • Generic E3F-DS30C4 Infrared Photoelectric Sensor Switch – NPN NO, DC 6-36V: the part this guide coversE3F-DS30C4 Infrared Photoelectric Sensor Switch – NPN NO, DC 6-36V₹186
  • Generic E3F-DS30C4 Photoelectric Sensor, NPN NO, DC 6-36V, 30 cm Detection: another version this guide coversE3F-DS30C4 Photoelectric Sensor, NPN NO, DC 6-36V, 30 cm Detection₹729
  • Generic E3F-DS30P1 Photoelectric Sensor PNP NO, DC 6–36V, 5–30 cm Range: another version this guide coversE3F-DS30P1 Photoelectric Sensor PNP NO, DC 6–36V, 5–30 cm Range₹729
  • E3F-DS30P2 Photoelectric Sensor PNP NC, 5–30 cm Detection Range, DC 6–36V: another version this guide coversE3F-DS30P2 Photoelectric Sensor PNP NC, 5–30 cm Detection Range, DC 6–36V₹729
  • E3F-DS30Y1 / RF18-30A1 Photoelectric Sensor NO, AC 90–250V, 400mA, Detection Range 5–30 cm: another version this guide coversE3F-DS30Y1 / RF18-30A1 Photoelectric Sensor NO, AC 90–250V, 400mA, Detection Range 5–30 cm₹392
  • Generic E3F-DS30Y2 / RF18-30A2 Photoelectric Sensor NC, AC 90–250V, 200mA, Detection Range 5–30 cm: another version this guide coversE3F-DS30Y2 / RF18-30A2 Photoelectric Sensor NC, AC 90–250V, 200mA, Detection Range 5–30 cm₹319
  • Generic E3F1-DS5B2 Photoelectric Sensor NPN NO/NC, DC 10–30V, 200mA, 1.2m Cable: another version this guide coversE3F1-DS5B2 Photoelectric Sensor NPN NO/NC, DC 10–30V, 200mA, 1.2m Cable₹629
  • Generic E3F1-DS5C4 Photoelectric Sensor NPN NO/NC, DC 10–30V, 200mA, Adjustment Fixed Sensing Distance: another version this guide coversE3F1-DS5C4 Photoelectric Sensor NPN NO/NC, DC 10–30V, 200mA, Adjustment Fixed Sensing Distance₹1,079
  • Generic E3F1-DS5P1 Photoelectric Sensor – PNP NO, DC 10-30V, 200mA, Fixed/Adjustable Sensing: another version this guide coversE3F1-DS5P1 Photoelectric Sensor – PNP NO, DC 10-30V, 200mA, Fixed/Adjustable Sensing₹629
  • Generic E3F1-DS5P2 Photoelectric Sensor, PNP NC, DC 10–30V, 200mA, M12 3-Wire: another version this guide coversE3F1-DS5P2 Photoelectric Sensor, PNP NC, DC 10–30V, 200mA, M12 3-Wire₹629
  • M18 Photoelectric Sensor, PNP NO+NC: another version this guide coversM18 Photoelectric Sensor, PNP NO+NC₹403
  • Aotoro CDD-40N Photoelectric Sensor 40cm Diffuse Reflective Metal Housing 12-24VDC: another version this guide coversAotoro CDD-40N Photoelectric Sensor 40cm Diffuse Reflective Metal Housing 12-24VDC₹639
  • Aotoro ED30-D30C4 Photoelectric Sensor 30cm Diffuse Reflective M30 Type 12-24VDC: another version this guide coversAotoro ED30-D30C4 Photoelectric Sensor 30cm Diffuse Reflective M30 Type 12-24VDC₹775
  • Aotoro ED30-D80C4 Photoelectric Sensor 80cm Diffuse Reflective M30 Thread 12-24VDC: another version this guide coversAotoro ED30-D80C4 Photoelectric Sensor 80cm Diffuse Reflective M30 Thread 12-24VDC₹729
  • Aotoro ED30-R3C4 Photoelectric Sensor 3M Retro-reflective M30 Type 12-24VDC: another version this guide coversAotoro ED30-R3C4 Photoelectric Sensor 3M Retro-reflective M30 Type 12-24VDC₹769
  • Aotoro EK51-D2M4 Photoelectric Sensor 2cm Diffuse Reflective AC/DC 24V IP66 Rated: another version this guide coversAotoro EK51-D2M4 Photoelectric Sensor 2cm Diffuse Reflective AC/DC 24V IP66 Rated₹1,013
  • Aotoro EK51-D50M4 Photoelectric Sensor 50cm Diffuse Reflective AC/DC 24V IP66 Rated: another version this guide coversAotoro EK51-D50M4 Photoelectric Sensor 50cm Diffuse Reflective AC/DC 24V IP66 Rated₹1,505
  • Aotoro EK51-R6M4 Photoelectric Sensor 6m Retro-reflective AC/DC 24V IP66 Rated: another version this guide coversAotoro EK51-R6M4 Photoelectric Sensor 6m Retro-reflective AC/DC 24V IP66 Rated₹1,542
  • Aotoro ER-D20C4 Photoelectric Sensor 20cm Diffuse Reflective Plastic Type 12-24VDC: another version this guide coversAotoro ER-D20C4 Photoelectric Sensor 20cm Diffuse Reflective Plastic Type 12-24VDC₹657
  • Aotoro ER18A-D50C4 Photoelectric Sensor 50cm Diffuse Reflective Plastic Type 12-24VDC: another version this guide coversAotoro ER18A-D50C4 Photoelectric Sensor 50cm Diffuse Reflective Plastic Type 12-24VDC₹657
07

Alternatives and when to choose them

  • ✓Branded photoelectric sensors: SICK, Omron, Panasonic.
  • ✓E18-D80NK IR switch: 5V maker option.
  • ✓Photoelectric sensors explained: types and terms.
08

Common mistakes to avoid

  • !Connecting a 24 V output straight to a 3.3 V pin.
  • !Choosing NPN when the PLC expects PNP.
  • !Wiring an AC version without proper insulation.
  • !Setting sensitivity so high that the background triggers it.
09

Frequently asked questions

What is the difference between NPN and PNP?

NPN pulls the output to ground when active; PNP drives it to the supply. PLCs usually expect one type.

Can I connect it to an Arduino?

Yes, through an optocoupler or a voltage divider, because it runs at 12 to 24 V.

What is a retro-reflective sensor?

It sends light to a reflector and detects when an object breaks the beam.

Why does the sensor trigger on the background?

Sensitivity is too high. Turn it down until only the target triggers.

Can the AC version switch mains loads?

It switches a mains load directly, so it must be wired inside an enclosure by a qualified person.

Parts for this guide

  • E3F-DS30C4 Infrared Photoelectric Sensor Switch – NPN NO, DC 6-36V
    ₹186View
  • E3F-DS30C4 Photoelectric Sensor, NPN NO, DC 6-36V, 30 cm Detection
    ₹729View
  • E3F-DS30P1 Photoelectric Sensor PNP NO, DC 6–36V, 5–30 cm Range
    ₹729View
  • E3F-DS30P2 Photoelectric Sensor PNP NC, 5–30 cm Detection Range, DC 6–36V
    ₹729View
  • E3F-DS30Y1 / RF18-30A1 Photoelectric Sensor NO, AC 90–250V, 400mA, Detection Range 5–30 cm
    ₹392View
  • E3F-DS30Y2 / RF18-30A2 Photoelectric Sensor NC, AC 90–250V, 200mA, Detection Range 5–30 cm
    ₹319View
  • E3F1-DS5B2 Photoelectric Sensor NPN NO/NC, DC 10–30V, 200mA, 1.2m Cable
    ₹629View
  • E3F1-DS5C4 Photoelectric Sensor NPN NO/NC, DC 10–30V, 200mA, Adjustment Fixed Sensing Distance
    ₹1,079View
  • E3F1-DS5P1 Photoelectric Sensor – PNP NO, DC 10-30V, 200mA, Fixed/Adjustable Sensing
    ₹629View
  • E3F1-DS5P2 Photoelectric Sensor, PNP NC, DC 10–30V, 200mA, M12 3-Wire
    ₹629View
  • M18 Photoelectric Sensor, PNP NO+NC
    ₹403View
  • Aotoro CDD-40N Photoelectric Sensor 40cm Diffuse Reflective Metal Housing 12-24VDC
    ₹639View
  • Aotoro ED30-D30C4 Photoelectric Sensor 30cm Diffuse Reflective M30 Type 12-24VDC
    ₹775View
  • Aotoro ED30-D80C4 Photoelectric Sensor 80cm Diffuse Reflective M30 Thread 12-24VDC
    ₹729View
  • Aotoro ED30-R3C4 Photoelectric Sensor 3M Retro-reflective M30 Type 12-24VDC
    ₹769View
  • Aotoro EK51-D2M4 Photoelectric Sensor 2cm Diffuse Reflective AC/DC 24V IP66 Rated
    ₹1,013View
  • Aotoro EK51-D50M4 Photoelectric Sensor 50cm Diffuse Reflective AC/DC 24V IP66 Rated
    ₹1,505View
  • Aotoro EK51-R6M4 Photoelectric Sensor 6m Retro-reflective AC/DC 24V IP66 Rated
    ₹1,542View
  • Aotoro ER-D20C4 Photoelectric Sensor 20cm Diffuse Reflective Plastic Type 12-24VDC
    ₹657View
  • Aotoro ER18A-D50C4 Photoelectric Sensor 50cm Diffuse Reflective Plastic Type 12-24VDC
    ₹657View
  • Aotoro ER18A-DS30C1 Photoelectric Sensor 30cm Diffuse Reflective 12-24VDC
    ₹685View
  • 24V 4A AC-DC Switching Power Supply Board
    ₹411View
  • Uno R3 Development Board (No Cable)
    ₹359View
  • Dupont Jumper Wires (40 pcs)
    ₹49View
Shop Photoelectric, Photodiode & Optocoupler ModulesShop Proximity & Inductive/Capacitive Sensors

Keep learning

ComparisonIntermediatePhotoelectric SensorsIndustrial photoelectric sensors: through-beam, retro-reflective, diffuse and background suppression types, NPN vs PNP, light-on vs dark-on, Arduino wiring.3 min read · SensorsComponent guideAdvancedIndustrial Photoelectric SensorsThese are factory-grade photoelectric sensors for conveyors, packaging and machines.8 min read · SensorsComponent guideBeginnerE18-D80NK Adjustable Infrared Proximity SwitchThe E18-D80NK is a cylindrical infrared proximity switch that detects an object between about 3 and 80 cm.3 min read · Sensors

Sources

  • Omron E3F series nomenclature
  • Aotoro product data

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the E3F-DS30 and Aotoro photoelectric switches (M18, M30 and square) isE3F-DS30 and Aotoro photoelectric switches (M18, M30 and square) pinoutWiring the E3F-DS30 and Aotoro photoelectric switches (M18, M30 and square)Example codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide8 items · ₹4,969

E3F-DS30C4 Infrared Photoelectric Sensor Switch – NPN NO, DC 6-36V · E3F1-DS5B2 Photoelectric Sensor NPN NO/NC, DC 10–30V, 200mA, 1.2m Cable · E3F1-DS5C4 Photoelectric Sensor NPN NO/NC, DC 10–30V, 200mA, Adjustment Fixed Sensing Distance · E3F1-DS5P1 Photoelectric Sensor – PNP NO, DC 10-30V, 200mA, Fixed/Adjustable Sensing · E3F1-DS5P2 Photoelectric Sensor, PNP NC, DC 10–30V, 200mA, M12 3-Wire · M18 Photoelectric Sensor, PNP NO+NC · Aotoro CDD-40N Photoelectric Sensor 40cm Diffuse Reflective Metal Housing 12-24VDC · Aotoro ED30-D30C4 Photoelectric Sensor 30cm Diffuse Reflective M30 Type 12-24VDC

Run itChange the inputs and watch the output

NPN output pulls D2 LOW when the beam sees an object. Each new object adds one.

Serial monitor9600 baud
 

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question