# Problem with microbit and sensors

**URL:** <https://forum.makecode.com/t/problem-with-microbit-and-sensors/28397>\
**Category:** micro:bit\
**Created:** [April 24, 2024, 1:55am UTC](https://forum.makecode.com/t/problem-with-microbit-and-sensors/28397 "2024-04-24T01:55:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr.oussama](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mr.oussama](https://forum.makecode.com/u/mr.oussama)\
**Post date:** [April 24, 2024, 1:55am UTC](https://forum.makecode.com/t/problem-with-microbit-and-sensors/28397/1 "2024-04-24T01:55:55Z")

</div>

Hello,  
Am using microbit v1.5 and ir sensor (tcrt5000), in P3 and vcc=3.3v.  
the problem is when the ir sensor detects and sends the value 1 to pin3, this value always remains 1 in the event of no-detection, whereas normally it returns to the value 0.  
knowing that sometimes this problem fails.  
Any solution please?

---

<div class="post-metadata">

**Author:** ![bsiever](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bsiever/32/1032_2.png) [@bsiever](https://forum.makecode.com/u/bsiever)\
**Post date:** [April 27, 2024, 11:45pm UTC](https://forum.makecode.com/t/problem-with-microbit-and-sensors/28397/2 "2024-04-27T23:45:37Z")

</div>

Hi @mr.oussama ,

Can you provide a little more information? In particular:

1. Can you share a link to the project? (See [instructions to create a share link](https://makecode.microbit.org/share))
2. Are you using a module that has a tcrt5000 or just a plain tcrt5000? If a module, what module? If not, can you share a diagram or description of how it’s wired?
3. It looks like the tcrt5000 should be used with a “pull resistor” to avoid a [floating input](https://learn.adafruit.com/circuit-playground-digital-input/floating-inputs). A floating input can cause the type of behavior you have described. Some sensor modules may already have a pull resistor on them. If there isn’t a pull resistor, the micro:bit pins can also use an internal pull resistor. The choice of pull (up or down) will depend on overall wiring and code. There are blocks to configure pulls in the Advanced section of tool boxes. Go to `Pins` and the `... more` toolbox ([description of block here](https://makecode.microbit.org/reference/pins/set-pull)).
