IR Break Beam Sensor (50cm) (SEN0503)

This is a placeholder topic for “IR Break Beam Sensor (50cm)” comments.

Infrared break-beam sensors are a simple way to detect motion. This IR break beam sensor works up to 50cm with a fast and stable response of <2ms…

Read more

1 Like

Hello! Would this device be compatible with a MicroBit?

1 Like

Adding a sample code or hook up guide would be better.

Hi @Adam265512,

Welcome to the forum!

In short, yest - this should work with a micro:bit.

The IR Break Beam Sensor (50cm) can run from 3.0–5.0V, so you can power it from the micro:bit’s 3V pin. One thing to note is the range drops at 3.3V — it’s roughly 20cm rather than the full 50cm.

Wiring is usually:

  • transmitter: 3V and GND
  • receiver: 3V, GND, and signal to a digital input like P0

The receiver output is an NPN/open-collector style output, so if you get unreliable readings you may need a pull-up resistor on the signal line to 3V (around 10k is typical). On a micro:bit, the internal pull-up can often do the job too.

@love312190 fair call on the guide. The basic logic is:

  • beam intact = input reads HIGH
  • beam broken = input reads LOW

In MakeCode, you’d just read a digital pin in a loop and trigger your action when it goes LOW.

If helpful, I’d suggest testing it first at short range on the bench, since alignment matters a fair bit with these beam sensors.

Liam

Hi ALL

Please read “WiII need a pull up”
Cheers Bob