I'm building a Robotic Car, the 4 DC Motors are working perfectly. I need to know the speed of its moving using an Encoder.

Encoder that I use: has two edges (transmitter & receiver) and a holed circle (has 30 hole) attached to the motor, so the Encoder give a digital pulse when a the signal from transmitter to receiver is cut.

I know that there is a better solution to have an accurate value of velocity (e.g. using an IMU or an aceleromoter) but I'm totally newbie, and after a long search I found that using IMU is so difficult, and it has no implementation using Python. That's why I have chosen to use Encoders.

Many Thanks for any suggestion or help, my project should be finished within one week

  • DId you mean "Wheel counter" which uses photo interrupter? – Kong Chun Ho Jul 18 '16 at 18:47
  • So? Count the pulses in a known period. Divide by 30 to get the revolutions. Multiply by the wheel diameter times pi to get the distance. What problem are you having? – joan Jul 18 '16 at 18:48
  • Mr. @joan the problem not in counting pulse ... 1. I need to trig an event whenever the car moves that require the Encoder to be connected as an interrupt. 2. I need to subtract revolutions when car moves backward. – Abdulkader Khateeb Jul 18 '16 at 19:27
  • You need to edit clarifications into your question. – joan Jul 18 '16 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.