JWoodrell 285 Posted April 16, 2013 Share Posted April 16, 2013 guys. a side thing I am working on starting I need to measure the rotation of a dial. the motion is continuous (can free spin one direction forever) and can just be relative incremental, doesn't have to be accurate over many rotations, it just has to track changes in dial position. the original circuit I am replacing was limited to 270 degrees motion only (had stops to prevent continuous rotation) and used a potentiometer. but I want to add the free spinning capability to the new version My first thought was to use an A/B rotary encoder like they use on mouse scroll wheels, but those only give me about 24-48 steps per rotation. the original circuit had functionally around 220 steps per rotation. a rotary encoder with that many steps is too expensive.(around 70 bucks) my current plan is to gut optical mice for their sensor + lense i can get them for around 2-3 bucks. the first mouse i gutted had an AVAGO ADNS-2051 sensor which is nice because it has a serial interface, but also has hard quadrature X and Y outputs to track. I am going to have to wait and see which sensor these cheap mice have in them but it seems most optical mice use some avago sensor or another. I can source just the sensor chips for around 2 bucks on aliexpress, but I have yet to find a place to be able to get the lenses, so I am stuck gutting mice because they already have the sensor + lens + ancillary circuits like appropriate crystal and whatnot. basucally use the optical sensor and have it watch a flat disk attached to the dial, so it works like a mouse moving on a surface, and just reports the motion back and forth on that "surface" the good thing is that optical mice have anywhere from 400 to 2000 counts per inch, and even with a 3/4" disk that is 900 to 4500 steps per revolution. the pin layout for the 2051 was interesting to me, it is 100mil standard spacing on the pins, but the left and right sides are offset from each other by 50mils so its a staggered 16 pin arrangement, although this looks normal for avago chips. the downside is you can't use standard prototyping board at 100 mil spacing, unless you use 2 pieces for the offset does this seem like a good route to go, or am I missing something simpler in how to accomplish this? thanks guys Quote Link to post Share on other sites
chicken 630 Posted April 16, 2013 Share Posted April 16, 2013 Alternatively you could dumpster-dive for an optical encoder disk and sensor found in cheap inkjet printer. See picture 14 in this teardown http://dangerousprototypes.com/forum/viewtopic.php?f=56&t=3334 But I like your idea of using an optical mouse IC.I toyed around with another AVAGO sensor a while back and found it pretty easy to use. My only (beginner's) headache was 3.3V/5V level-translation for the bi-directional SDIO line. Though uni-directional communication might be sufficient to get the quadrature encoder emulation going - mine didn't have that option. Quote Link to post Share on other sites
PTB 27 Posted April 17, 2013 Share Posted April 17, 2013 Have you looked at gray encoding? http://en.m.wikipedia.org/wiki/Gray_code Cheers Ptb Quote Link to post Share on other sites
abecedarian 330 Posted April 17, 2013 Share Posted April 17, 2013 I have a few magnetic rotary encoders I don't need if you're interested: AS5140H, AS5312, AS5048B. JWoodrell 1 Quote Link to post Share on other sites
roadrunner84 466 Posted April 17, 2013 Share Posted April 17, 2013 Gray encoding is very nice, but I don't think JWoodrell is looking to build rotary encoders entirely from scratch. Quote Link to post Share on other sites
PTB 27 Posted April 17, 2013 Share Posted April 17, 2013 Gray encoding is very nice, but I don't think JWoodrell is looking to build rotary encoders entirely from scratch. Rats.... I would have bought one. I really need to work on my subtlety. One day i would like to try build one via 3d printing and a suitable circuit. ...... One day. Interesting thread. Look forward to seeing how it works out. Cheers PTB Quote Link to post Share on other sites
JWoodrell 285 Posted April 17, 2013 Author Share Posted April 17, 2013 I like the concept of the magnetic sensor, may use that if I can't get the optical sensor to work, but the price is higher than I wanted for the project. It is a good alternative though, thank you. Quote Link to post Share on other sites
abecedarian 330 Posted April 18, 2013 Share Posted April 18, 2013 I like the concept of the magnetic sensor, may use that if I can't get the optical sensor to work, but the price is higher than I wanted for the project. It is a good alternative though, thank you.I have 3 each of the 3 I listed so if you want to try one, compare the datasheets and pick whichever you'd like (or all 3 for that matter ;-)) and I'll mail them to you gratis. AS5140H AS5132 AS5048B Quote Link to post Share on other sites
JWoodrell 285 Posted April 18, 2013 Author Share Posted April 18, 2013 I will keep that in mind, I am going to work with the mice first because i can get them for 2 bucks a piece, and the mag sensors i can't find cheaper than 6 bucks a piece (excluding the sample from you to test). but this project I will build several of (at least 10) and probably more if they are popular. Quote Link to post Share on other sites
JWoodrell 285 Posted April 20, 2013 Author Share Posted April 20, 2013 well got the optical chip wired up and working, now I need to make sure everything will fit in the case, and fabricate the dial disk. Until I get the MSP talking to the optical chip over the serial link, it defaults to 400 CPI, but I can up it to 800 CPI once I can talk into its registers. here is what it looks like so far. (I build it into an 0.3c usb board) cause it is a usefull prototyping board since the pins were offset on each side of the chip, I had to bend the pins over to land in the standard holes, but it didn't seem to complain had to cut a hole in the prototyping board for the lense to go through, so that cut the traces linking the top side of the MSP430 to the pin header for a boosterpack, but if I need those pins, I will wire around the hole manually bluehash and RobG 2 Quote Link to post Share on other sites
TheDirty 33 Posted April 21, 2013 Share Posted April 21, 2013 Too bad you can't get the old ball mice. Each had two rotary encoders to track the ball movement, Quote Link to post Share on other sites
JWoodrell 285 Posted April 22, 2013 Author Share Posted April 22, 2013 due to space limitations (stack height) and avoiding existing bosses, and whatever axle the knob rotates on... and on and on, I am having to switch over to the magnetic sensor option. I built it up in solidworks in 3d, and there is no way I can flip it around or orient things so i can get it to fit in the existing case. anyway, I messaged @@abecedarian to get one of the 5132 sensors from him, it doesn't have the accuracy of the other two, but only costs half as much (around 6 bucks) here is what the stackup was looking like, Quote Link to post Share on other sites
abecedarian 330 Posted April 22, 2013 Share Posted April 22, 2013 ... never mind .... Quote Link to post Share on other sites
abecedarian 330 Posted April 22, 2013 Share Posted April 22, 2013 Okay, I'm not sure this will save or reduce space. You'll probably want the sensor IC on the same side of the board as the knob, and will need a magnet on the knob, and around 1mm spacing between the magnet and the IC.... You might be able to mount the IC on the opposing side of the board from the knob, but I've no idea how the decrease in magnetic flux would be affected, and you'd have to account for the reversed direction of rotation were you to do so. Quote Link to post Share on other sites
GeekDoc 226 Posted April 22, 2013 Share Posted April 22, 2013 Okay, I'm not sure this will save or reduce space. You'll probably want the sensor IC on the same side of the board as the knob, and will need a magnet on the knob, and around 1mm spacing between the magnet and the IC.... You might be able to mount the IC on the opposing side of the board from the knob, but I've no idea how the decrease in magnetic flux would be affected, and you'd have to account for the reversed direction of rotation were you to do so. If the chip has pins, maybe inverted mount of the chip through a cutout? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.