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
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
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.
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.
| Pin | Function |
|---|---|
| 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 |
- 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
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) pin | Connection | Note |
|---|---|---|
| Brown | 24V + | Same supply ground as the controller |
| Blue | 0V | Common with Arduino GND |
| Black (NPN) | Arduino D2 with INPUT_PULLUP | Open collector pulls the pin LOW |
| Black (PNP) | 10k / 2.2k divider to D2 | About 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
Example code
For a PNP sensor, read through a divider or optocoupler and count the rising edge instead of the falling edge.
// 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);
}Setup and tuning
NPN or PNP, normally open or closed; match it to your PLC or circuit.
most run on 6 to 36 V DC; AC versions run on mains and must be wired safely.
use an optocoupler or divider; never connect 12 to 24 V outputs straight to a 3.3 V pin.
set the pot so the target triggers reliably but the background does not.
align retro-reflective sensors carefully with their reflector.
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
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.
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.
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
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




