Author Topic: How to correctly read values from wheel encoder using arduino  (Read 4808 times)

0 Members and 1 Guest are viewing this topic.

Offline SuperMiguelTopic starter

  • Jr. Member
  • **
  • Posts: 35
  • Helpful? 0
So im trying to read the values from my encoder using an arduino mega.. This is the encoder i got:

The motors i have are these: http://www.specamotor.com/en/Faulhaber/motors/2342-012CR/datasheet_motor.html

Offline RobotMan_24

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Re: How to correctly read values from wheel encoder using arduino
« Reply #1 on: September 17, 2012, 01:24:02 AM »
Hey Super:

I don't see any encoder info up there - looks like you forgot to post it?  In terms of the motor - it looks like the manufacturer has a lot of data - which is always a good sign.

You might want to read this introductory info about encoders here:

It goes over how some rotary encoders work - which could help you out.  Generally, most quadrature encoders have two channels (A and B).  You could either poll the pins, or better (if you have the option) I would recommend using interrupts tied to your pin state change.  A brief blurb about interrupts can be read here:

Hope this helps, and if you have any questions feel free to let me know!


Get Your Ad Here