reading a wheel encoder
mwalimu
Posts: 44
I am vexed by trying to read a wheel encoder. I am using a roomba wheel. It' pretty straight forward, an IR emitter/receiver pair with 32 blades. The problem is that I can't get my program to reliably read the number of on/off transitions.
I tried tying the receiver to a pin directly. No good. I did find that if I used a pull up resistor(10K), it would read on or off. However, my program would read a larger amount of transitions than actually occured. My guess is that as the blade passes the emitter there is a region where the pin state rapidly bounces between 0 and 1.
I was more successful with RC time. I could count transitions, but my program couldn't keep up with the wheel when I increased it's speed. I found I could improve performance if I increased the limit diode on the emitter, but not enough to work properly at full speed.
I'm not sure if I'm having a hardware or a software problem, so I thought I'd through the question out and see anyone else has used the prop to get a similar emitter/receiver type wheel encoder to work.
I tried tying the receiver to a pin directly. No good. I did find that if I used a pull up resistor(10K), it would read on or off. However, my program would read a larger amount of transitions than actually occured. My guess is that as the blade passes the emitter there is a region where the pin state rapidly bounces between 0 and 1.
I was more successful with RC time. I could count transitions, but my program couldn't keep up with the wheel when I increased it's speed. I found I could improve performance if I increased the limit diode on the emitter, but not enough to work properly at full speed.
I'm not sure if I'm having a hardware or a software problem, so I thought I'd through the question out and see anyone else has used the prop to get a similar emitter/receiver type wheel encoder to work.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM