# N20 motor with magnetic encoder to track revolutions

**URL:** <https://forum.makecode.com/t/n20-motor-with-magnetic-encoder-to-track-revolutions/17564>\
**Category:** micro:bit\
**Created:** [January 23, 2023, 6:11pm UTC](https://forum.makecode.com/t/n20-motor-with-magnetic-encoder-to-track-revolutions/17564 "2023-01-23T18:11:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr-Meow-ZA](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mr-meow-za/32/7553_2.png) [@Mr-Meow-ZA](https://forum.makecode.com/u/Mr-Meow-ZA)\
**Post date:** [January 23, 2023, 6:11pm UTC](https://forum.makecode.com/t/n20-motor-with-magnetic-encoder-to-track-revolutions/17564/1 "2023-01-23T18:11:27Z")

</div>

I am trying to use a N20 motor, 120rpm 6v 1:50, with a hall effect magnetic encoder in order to track the turning of a wheel on a robot car. I have managed to read in and count the signal, but it is far lower than expected and seems to be missing a lot of counts. Is this due to the micro:bit not being able to read fast input fast enough? I am currently only reading in one of the two inputs, I realize I may need to read both and do something with them for more accuracy but not sure what…

I need to be able to accurately keep track of the revolutions so I tell car to turn 90 degrees or move forward 100mm etc. Encoder is a Pololu magnetic encoder for N20 motor.

Any ideas are appreciated.
