When you're outfitting a machine-safety or control setup, you often face two very different needs: detecting an object from a distance, or tracking the rotation of a knob or shaft. The Photoelectric Switch 12mm 636V 020M Laser Sensor NPN Industrial Sensor and the 2/4/6/10PCS Dual Axis Rotary Encoder With Switch 30 Positioning Number 15 Pulse both belong in a builder's toolkit, but they solve different problems. Here's how to decide.
Quick Verdict
Choose the photoelectric switch if your priority is long-range object detection, such as counting parts, triggering gates, or safeguarding an entry point. It costs a bit more at USD 39.72, but its long-range beam and straightforward output give it a dedicated role in sensing. Choose the dual-axis rotary encoder if you need an affordable way to add a rotating control with a push button to a panel. At USD 29.99, it's the lower-priced option, and the quantity options include 2, 4, 6, or 10 pieces for prototypes or multi-station builds.
Comparison Table
| Comparison | Photoelectric Switch | Rotary Encoder |
|---|---|---|
| Price | USD 39.72 | USD 29.99 |
| Price indicator | ||
| Main role | Presence and distance detection | Rotation and switch input |
| Output | NPN, normally open, 1-way | 15-pulse encoder with switch |
| Key specs | 0-20M beam, IP66 construction | 30 positioning points, 10mA, metal body |
| Best for | Gates, garage doors, counting, safety | Control panels, knobs, positioning |
Where Each Product Wins
The Photoelectric Switch wins for any job that needs to see an object across a gap. Its through-beam reflection design and long range make it suitable for outdoor gates and garage doors, while the IP66-rated construction and stainless steel contact match demanding environments. The normally-open contact type and 1-way circuit keep wiring straightforward for industrial controls.
The Rotary Encoder wins for user input and position feedback. With 30 positioning points and a 15-pulse output, it provides distinct stepping for rotating controls, and the integrated switch adds a push action. The multiple piece options also make it easier to equip several panels at once.
Product Notes
Photoelectric Switch 12mm 636V 020M Laser Sensor NPN Industrial Sensor

This is the pick when you need a dedicated detection sensor rather than a rotary input. The 0-20M beam distance is the headline capability, and the NPN output with normally-open contact integrates cleanly into many industrial logic circuits. The IP66-rated construction is a solid match for outdoor gates, garage doors, and other weather-exposed installations. The stainless steel contact adds durability in high-cycling applications. On the downside, this sensor does not measure rotation or provide a manual control surface. If your machine already has control inputs and simply needs an eye to detect objects, this earns its place.
2/4/6/10PCS Dual Axis Rotary Encoder With Switch 30 Positioning Number 15 Pulse

This encoder takes a different approach: it turns a knob into a signal. The 30 positioning points give distinct stepping, and the 15-pulse output provides rotation feedback to a controller. The built-in switch adds a push function, making it a compact combination for menu navigation or parameter entry. The metal body and 8mm base height are key physical specs, and the 10mA current draw keeps power requirements low. The quantity choices include 2, 4, 6, or 10 pieces to fit small or large builds. The limitation is that it cannot detect objects or distances. It is an input device, not a presence sensor, so choose it only when your project needs a reliable rotary encoder.
Final Choice by Use Case
If you need to sense an object, a person, or a vehicle passing through an area, the photoelectric switch is the clear winner. Its longer range and rugged build make it a ready fit for safety and automation tasks. If you need to provide a human operator with a rotary control that also acts as a push button, the dual-axis rotary encoder is the right call. Its lower price and multiple piece options let you equip several panels without stretching the budget. There's no single "best" here; the correct choice depends on whether your machine needs to see or needs to turn.