Shop OBEX P1 Docs P2 Docs Learn Events
DIY motor feedback from mouse parts. — Parallax Forums

DIY motor feedback from mouse parts.

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-10-22 10:08 in General Discussion
So someone had posted a really cool ink about building wheel encoders from an old ball mouse, which led me even deeper into finding out how to use a laser mouses sensor to track speed and position by running the laser over the floor. Anyways I had an old serial ball mouse so I took it apart to see what could be done with it.

Now what im thinking is I can just cut out the part of the board that contains the IR led and photo transistor, then mount them around an encoder wheel attached to the motor and read the counted pulses with a propeller, this should be easy enough right, the IR stuff in wheel encoder isnt like binary encoded data like an IR remote correct? My biggest issue is that the encoder wheels in the mouse are going to be impossible to drill through the dead center of, Ive tried this with many plastic gears and failed.. So heres what I have and heres what Im thinking about doing..

mouse.jpg
meccano.jpg


I really only have four major concerns here, assuming is just as easy as connecting the IR LED and PhotoTransistor to the prop and counting pulses. The first is If I us the brass wheel on the right instead of the wheel with the mouse, will I need to paint it, im wondering if the brass will cause light reflection problems. The next is the resalution, I effevtively jumping from what looks like at least 30 or 40 slots on the mouses wheel to 8 on the brass wheel fitted for my axel and motor shaft size. The resalution also brings up the question of wether to mount directly to the motor shaft or the wheel axels, ive read that you get better resalution if you runn your wheel before any gearing so the wheel spins at a higher RPM, but this seems like more work to get your actual wheel speed. And the last but most important question is will this set up work out side if I dont enclose the encoder wheel and leds in some kind of casing to block out the ambient light?

Is there maybe an obex object I can load on to a prop and connect the leds up reel quick to run some tests? Im assuming the code would be the same for any photo transistor/ir led setup. There is nothing special at all about the hardware correct? I guess im just asking the same thing as above i do not need to decode a 38khz frequency or something correct?
1024 x 768 - 74K
1024 x 768 - 71K
«1

Comments

  • kwinnkwinn Posts: 8,697
    edited 2012-10-18 18:57
    The mouse encoder output is pulses from 2 phototransistors similar to any quadrature encoder, no 38KHz or such. You can probably use one of the quadrature encoder objects in the OBEX for it.

    You can drill a hole in the plastic mouse wheel that will be very close to the center if you use a piece of brass tubing from a hobby store that just fits over the plastic axles of the wheel. Use a dremel with a cutting disk and notch the end of the tubing to create "saw teeth".

    The brass wheel may also work since the IR has to go through the holes to reach the detector. Reflections should not be a problem since they are on the other side of the disk from the sensors.

    Best to go for maximum resolution so mount the wheel on the motor shaft. You will have to convert pulse counts to distance, and it is the same amount of work wherever you mount it.

    I doubt it will be necessary to block ambient light, but if you do it should not be hard to do so later.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-18 20:07
    awesome just what i wanted to hear!! the pipe trick should work well never thought about doing that! i have a press my issue has always been loking the gear in place without runing the teeth. i will probably use the brass wheel for now becuase it only requires me to screw it down.

    ive done alot of research, and am kind of cunfused about encoders though. my plan is to use 1 of each of the optical pairs on its own motor wheel. is this a quadrature encoder? i thought to male a quadrature encoder you had to have two sets of optical sensors on one wheel? also the clear sensor is two leads and the black is 3 these are both photo transistors? the wheels im using are big enough that i could mount the.sensor on the axel as this would be easier since my motors dont have back shafts. i have custom gearing after the motor shaft so while mounting the encoder on the motor shaft will give better resalution im a bit.confused as how i would get an accurate wheel posistion, if i were to mount the encoder by the wheel it should be realtively easy to measure wheel speed and posistion. it seems like this is a resalution vs ease of use issue am right?

    back to the question above any quadrature encoder object.should work with this set up? the way i understand it im keeping track of off and ons the black photo transistor out pits, this is the same as grey code.

    im sorry ive done alot of looking around but theres so many varied info out there im having a hard time figuring out if what im attempting to build is even a quadrature encoder
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-19 02:01
    While you can do things with those very tiny encoders on ball mice, you can also simply use an intact optical mouse as a wheel encoder if you mound a CD on the whell shaft and have the optical mouse on its surface. I guess the tiny 3" CDs would be more useful than the 5 1/4" standard ones. But the Propeller will easily read the optical mouse and you don't have to build so much.

    No 38Khz modulation means that ambient IR may cause trouble - the encoder needs to be kept away from room light.

    There are prebuilt photo transistor/IR led pairs that might be easier to use. Just salvage the mouse's encoder wheels.

    Not all mice have encoder wheels like the one's in your photos. I have some that are extremely fine slots and I gave up working with them as they just were too fine to be sure of successful use.

    If you want to drill an exact centered hole in the salvaged encoder shaft, cut the shafts off of the existing encoder wheel flush to the wheel. Maybe clean up the cut with sandpaper or a file. Then locate the center and drill a very tiny pilot hole first. Follow up with the right sized shaft hole.

    There are two ways to create quadriture encoders. One is to have two sensors in a line and a special wheel with slots or graphics 90 degrees out of phase; the second is to have a wheel with one set of slots and the two sensors 90 degrees out of phase (this means a simpler wheel).
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2012-10-19 06:59
    Now what im thinking is I can just cut out the part of the board that contains the IR led and photo transistor, then mount them around an encoder wheel attached to the motor and read the counted pulses with a propeller, this should be easy enough right, the IR stuff in wheel encoder isnt (isn't) like binary encoded data like an IR remote correct? My biggest issue is that the encoder wheels in the mouse are going to be impossible to drill through the dead center of, Ive tried this with many plastic gears and failed..

    Not impossible. If you don't have a center punch you may want to pick one up. There are some spring loaded one that you can place on your part where you want the hole to be and press down. It will make a small dimple that helps keep the drill for moving around when you start the hole. It helps if you won't have a proper fixture to hold the part or a drill press. You can also start with a very small pilot hole which can be easier to get centered and then follow up with a larger drill. It will follow the first hole you drilled and help keep it centered.
    The next is the resalution (resolution), effevtively (effectively) jumping from what looks like at least 30 or 40 slots on the mouses wheel to 8 on the brass wheel fitted for my axel (axle) and motor shaft size. The resalution also brings up the question of wether (whether) to mount directly to the motor shaft or the wheel axels, ive read that you get better resalution if you runn your wheel before any gearing so the wheel spins at a higher RPM, but this seems like more work to get your actual wheel speed. And the last but most important question is will this set up work out side if I dont enclose the encoder wheel and leds in some kind of casing to block out the ambient light?

    If it is just a single opto sensor or if you only plan on reading one of them then changing the number of slots (or holes) isn't a big deal. However, those optical IR sensors have a pair of receivers and those are setup to match the spacing on the wheel. If you use a different wheel you will mess up the quadrature encoding. Having the quadrature intact is preferred since it will give you both the distance it moved and direction. Otherwise you can only tell that it moved and don't really know which way. I'd recommend using the encoder wheels from the mouse.

    If you are making your own home brew encoders then I recommend using two separate encoder channels with the sensors stacked vertically. That way you can change encoder wheels at will without readjusting the sensors. If they are mounted side to side then the spacing between them does matter and you may need to adjust them when changing the encoder resolution. If you search on the encoder threads I've posted on you can get more details on that issue.
    Is there maybe an obex object I can load on to a prop and connect the leds up reel quick to run some tests? Im assuming the code would be the same for any photo transistor/ir led setup. There is nothing special at all about the hardware correct? I guess im just asking the same thing as above i do not need to decode a 38khz frequency or something correct?

    There are some objects in the OBEX for encoders. No 38Hz required. You make need to add some sort of cover to block out ambient light but that is about it.

    Robert
  • kwinnkwinn Posts: 8,697
    edited 2012-10-19 07:41
    Each one of the 2 IR led/sensor assemblies in a mouse should have 2 phototransistors in it. That is required in order for the mouse to sense if it is moving forward/backward or left/right. This is why an old ball mouse is a good choice to scavenge the sensors from.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-19 11:58
    ohhh ok i think i get it now, the clear thing is an ir led and the black is two photo transistors thre leads are a common and two outputs, one for direction and one for posistion, making it a true quadrature encoder and not just a posistion sensor.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2012-10-19 12:29
    two outputs, one for direction and one for posistion, making it a true quadrature encoder and not just a posistion sensor.

    Almost. Either one by itself can be used for counting. Both of them acting as a team can determine counting and direction.

    Here are a few more places you can read up on Quadrature encoders:

    http://www.robotoid.com/appnotes/circuits-quad-encoding.html

    http://prototalk.net/forums/showthread.php?t=78

    http://www.ni.com/white-paper/4763/en

    http://www.ni.com/white-paper/7109/en

    http://tutorial.cytron.com.my/2012/01/17/quadrature-encoder/
  • jmgjmg Posts: 15,161
    edited 2012-10-19 12:32
    I really only have four major concerns here, assuming is just as easy as connecting the IR LED and PhotoTransistor to the prop and counting pulses.
    The first is If I us the brass wheel on the right instead of the wheel with the mouse, will I need to paint it, im wondering if the brass will cause light reflection problems.

    This is a transmissive sensor, so from a IR path viewpoint, you do not need to paint it.
    From a stray light path angle, maybe paint would help, but it needs to be IR absorbing.
    The next is the resalution, I effevtively jumping from what looks like at least 30 or 40 slots on the mouses wheel to 8 on the brass wheel fitted for my axel and motor shaft size. The resalution also brings up the question of wether to mount directly to the motor shaft or the wheel axels, ive read that you get better resalution if you runn your wheel before any gearing so the wheel spins at a higher RPM, but this seems like more work to get your actual wheel speed.

    The sensors in the Mouse are spaced close together (eg usually one half the gap width in the mouse wheel)
    - a larger-hole wheel will work, but it will not give linear steps per edge
    And the last but most important question is will this set up work out side if I dont enclose the encoder wheel and leds in some kind of casing to block out the ambient light?

    Yes, enclosing will be essential.
    I had a translucent wheel mouse once, that failed on a sun illuminated desk.
    It needed baffles added internally, to block the light.

    This is where those large holes may cause the most problems - they let a lot of light in.
    A better wheel, could make light shrouding easier.

    What about a PCB disk, where you drill smaller holes in a CAD generated circle ?
    You get full NC control of all dimensions.
    Black solder mask is readily available.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-19 13:35
    thaks robot workshop, im gonna read those links now.. i found a really good article at society of robots last night but it mostly covered one sensor with two or three wheel tracks, which is kind of slick to read perfect angles and such. Also in the links you gave me to the mouse encoders before, one of the guys had an article about using a laser mouse sensor to track coordinates on the floor have you ever tried this? does the laser have to touch the ground. for anyone who knows about lasers and optics more maybe this technique could be pulled off at a few inches from the ground with opamps and better lasers? im look around vishay later see whats available for sampling.

    jmg that is a reall good idea, all my shafs/axels are 5/32 this would allow me to create dead on deminsions for gears and wheels like you say, i was acually gonna see what a machinest would charge to recreate my encoder wheels from the mouse with the right center whole but this is better. seed will do 10 pcbs for 20 i could then use flat black rubberizing paint on them. i could also use small round holes and etch myself.

    what exactly would happen if i made my own wheel via pcb and then used the mouse sensors.. how does a dofferent style wheel throw the ir off
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2012-10-19 13:49
    In this thread I talk about printing custom encoders on plastic sheets:

    http://forums.parallax.com/showthread.php?138600-Source-for-white-plastic-8.5-quot-x11-quot-printer-sheets

    It also talks about the sensor placement. If you just have one set of encoder marks then the placement of the sensors matter in order to get the proper 90 degree offset. By using twp sets of encoder marks 90 degrees out of phase you can place both sensors vertically at the center of each track. They don't require any special adjustment when changing resolutions.

    This thread has a list of tools to make your own wheels:

    http://forums.parallax.com/showthread.php?138597-Encoder-generators-Quadrature-etc.&highlight=encoder

    You can either print them on white material and use the reflective sensors or print them on transparency material and use the pass through type.
  • jmgjmg Posts: 15,161
    edited 2012-10-19 14:05
    what exactly would happen if i made my own wheel via pcb and then used the mouse sensors.. how does a dofferent style wheel throw the ir off

    Easy enough to try, I'm sure you have PCB with some holes in it somewhere ;)
    The wheels tend to have rectangular slots, whilst round holes are more practical in a PCB.
    The starting hole size to try, is around 2x the sensor pitch, with the same web width.

    Then, if you are a purist, you adjust that slightly, to compensate for the radii, and illumination angles etc, until you get 90' per quadrant.

    On the interrupters I have here, you can see the optical active area (size and offset) if you get bright light on the right angles.
  • kwinnkwinn Posts: 8,697
    edited 2012-10-19 18:12
    Quadrature encoder operation is fairly simple and a simple device is easy enough to make.

    Figure 1 in the attached diagram is the basic circuit of the detector. A quadrature encoder needs 2 such circuits placed so the output pulses overlap.

    In figure 2 the spacing between the black and transparent sections of the wheel is such that the two signals are approximately 90 degrees out of phase. When detector A goes from low to high you can determine the direction of rotation by the level on detector B. The wheel is going clockwise if B is low, counter clockwise if B is high.

    In figure 3 the spacing between the black and transparent sections of the wheel is such that the two signals are approximately 45 degrees out of phase. The actual phase angle is not critical as long as the signals have some overlap. The phase angle must be more than 0 degrees and less than 180 degrees.

    Figure 4 shows a combination of wheel and detector spacing that will not work for determining the direction of rotation.
    1024 x 409 - 42K
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-19 19:26
    Well what im a bit confused about since most o the articles show the wheels like the ones you have above, if how is quadrature data dirived from one wheel track and two sensors?

    Also im about done making this setup, gonna drill the holes in the encoder wheels now (crossing fingers i get it right) but what im unclear on is what is the resalution on my encoder is it the number of empty slots in the wheel or the number of empty slots and filled in spots, and does using two photo transistors effect how you derive resalution>
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-19 19:49
    Also come to think of it how am I suppose to figure out how many milla amps are safe for the IR Led and PhotoDiode, Its not like I can just throw a pot on and adjust it till the brightness looks right,I see one resistor going to the IR LED on the original board it looks like 1.8k Ohm I cant tell if thats a gray band though, anyways it doesnt matter becuase this thing was powered by rs232 its an old serial mouse so I dont know what kind of voltage it was even running at, should thought of this before hack sawing the board and cutting the cord
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-19 23:21
    It seems that less than 20ma for the IR LED is good, it is about the same as any other LED.

    https://www.sparkfun.com/products/241

    This above link might help, but I suspect only the LED is critical. Most transistors, including photo-transistors will tolerate much higher voltages than they have in actual use.

    Personally, I think you are getting involved in doing this in a rather difficult manner.

    1. The parts in a mouse are very tiny.
    2. The parts are undocumented
    3. For quadrature, you are going to have difficulty getting everything positioned right with such tight tolerances due to using small salvaged parts.

    There are other IR photo sensors that would make a build easier and one could use a bigger disk. Or, one could use magnets and hall-effect sensors.

    Take a look at a 'photo interrupter'. http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=2079961&MER=baynote-2079961-pr

    Or you could use an IR photo reflective sensor, like the CNY70

    http://www.vishay.com/docs/83751/cny70.pdf
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-20 00:53
    Ya ive got to say this isnt working to well, :/ I couldnt get the encoder wheels drilled dead center so I dont know if these are going to work at all. I tried testing it and realised Im not sure how this photo transistor works, it appears middle pin is ground but i cant seem to figure out how to hook the rest of it up, my plan was to get it wired correctly to a logic analyzed and then play with the posistion sensor. N
  • kwinnkwinn Posts: 8,697
    edited 2012-10-20 00:54
    Well what im a bit confused about since most o the articles show the wheels like the ones you have above, if how is quadrature data dirived from one wheel track and two sensors?

    Refer to Diagram 2 for the following explanation (the wheel is turning clockwise):

    Both sensors are under a transparent area of the wheel so both outputs A & B are low.

    The wheel turns 1/16th of a turn. Sensor A is blocked so it's output is high, sensor B is clear so it's output is low.

    The wheel turns another 1/16th of a turn. Sensor A & B are blocked so both output are high.

    The wheel turns another 1/16th of a turn. Sensor A is now clear so it's output is low, sensor B is still blocked so it's output is high.

    On the next 1/16th of a turn both sensors are clear again and the sequence repeats.

    It does not matter if the wheel has alternating dark and transparent spokes or holes and solid areas between the holes. As long as the areas that block or allow the ir to pass are at least wide enough to cover both sensors. That is why figure 2 and 3 will work as quadrature encoders and figure 4 will not.
    Also im about done making this setup, gonna drill the holes in the encoder wheels now (crossing fingers i get it right) but what im unclear on is what is the resalution on my encoder is it the number of empty slots in the wheel or the number of empty slots and filled in spots, and does using two photo transistors effect how you derive resalution>

    The resolution on the encoder in figure 2 can be one of the following:

    If you only count the pulses from sensor A it is 1/4th of a motor revolution.

    If you count each transition (high to low/low to high) from sensor A it is 1/8th of a motor revolution.

    If you count the transitions from both sensors it is 1/16th of a motor revolution.

    What that means as far as a robot movement depends on the motor gearing and wheel diameter.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-20 01:26
    If the photo-transistor has 3 leads, it is the same as a regular transistor - collector/base/emitter: though the sequence may be needs to be verified.

    http://physlab.lums.edu.pk/images/1/10/Photodiode_circuit.pdf

    Only 2 leads is a photo-diode.
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-10-20 05:48
    Only 2 leads is a photo-diode.

    or a photo-transistor with no base connection. There is a difference.
  • kwinnkwinn Posts: 8,697
    edited 2012-10-20 11:48
    Photo-diodes are not as sensitive to light as photo-transistors so are not used in encoders very often if at all. I have never seen an encoder with photo-diodes in any of the equipment I have worked on.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-20 12:31
    Ok well heres the deal, looking at the way this bored was layed out before is why im not understanding how to use the photo transistor.

    First of all let me make sure I under stand this right, I should have two ouptuts from the photo transistor, and they should be either hi or low depending on if the IR beam is broken? If this is wrong its probably causing alot of my confusion. Im thinking the transistor should be outputting a square wave signal from it emitter and collector for the speed and position.

    The way the pTransistor is layed out also makes no sense to me, the base is grounded, im not awesome this transistors, IO have succesfully used transister to amplify LEDs and invert signals none of the transistor circuits I have ever made have the base grounded. The middle pin of the pTransistor ties to the ground of the IR LED and then goes off to the ground on the mouse button. Does this appear to make sense to anyone?
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-20 15:28
    Ok this is just ridculousness!! Although the concept of reading a light freakin flashing on and off is a very simple concept, loopy is right destroying a mouse and recyling its parts to make a quadrature encoder is not easy, electrically or mechanically, small plastic pieces and undocumented semiconductors is a PITA. So im going to scrap this whole idea of using a mouse. For now im going to DIY an encoder the idea is to use the brass hub I showed in the first post with two vishay slot interrupters. There are 8 holes in each hub, with two interrupters this should work for quadrature data correct? The reason I ask is because the wheels posted early showed and 8 posisiton wheel and said it wouldn't work for quadrature data.

    I can also get the reflective type sensors from vishay and print my own wheels, but I dont like this idea beacuase I eventually want this bot out in the dessert and I feel like a paper wheel is not very rugged... Is there any advanage to using the reflective encoders? Also on a slot interupter how does the apature size effect the sensor I got a 1mm apature since it was the biggest and holes in my encoder are rather large

    Now I have ripped my bot up becuase It wasnt a very upgradeable design Right now the final idea is to have a 8 wheel bot that is normal four wheel drive with two more set of wheels mounted higher than the other 4, these axels will be the very front and back set of wheels, I want to drive these off angled wheels with hi torque stepper motors the idea being that when the bot get stuck on a rock or incline I can use the steppers to help dig it out/pull it over the rock. For this design id like something solid for wheel encoding but also cheap and easy to use since I will need 4 encoders total, I have been looking at eventually upgrading too these and would like an opinion

    http://www.ebay.com/itm/Oak-Grigsby-900-400-Optical-Encoder-2-CH-Quadrature-Robotic-Hobby-CNC-Avail-Qty-/140868604833?pt=LH_DefaultDomain_0&hash=item20cc6c53a1

    t
    hey seem nice and are enclosed in steel so they aren gonna get dirt in them but im not sure if these are worth buying or not, most othere systems are in the 30-60 dollar range
  • kwinnkwinn Posts: 8,697
    edited 2012-10-20 16:23
    The encoders in your link look like they should work fine but it there is not enough info to be sure.

    You can make your own encoder with the brass hub and the Vishay slot interrupters but the spacing of the interrupters is critical. The output pulses from the 2 interrupters must overlap as shown by the wave forms in figure 2 or 3 of my earlier post. The interrupter package may be so wide that you need to mount them over separate holes in the brass hub. This is not a problem as long as at least one of the interrupters position can be adjusted to get the timing right.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-20 16:43
    Well my plan was to mount them at a 90 degree angle from each other if that makes seanse basically one over the hub and one on the side. I was thinking later I could get a machine shop to drill me a set of accurate holes so I could also use a thrid dector for angle detection when I know more about what Im doing. Right now im just trying to get this all worked out and have a set plan so I can build all the the mechanical parts of the bit, Ive ripped up my old design so I could regear the drive train for more torque, since Im going to be putting more power to the wheels than originally thought, So i wanted to build it with shaft extensions in such a way I can put play with encode discs at the wheels and drive shaft. I.E swap encoder wheels and whole devices.

    I thought more about the reflective sensros I guess I could easly print out a wheel and then paste it to my hub, but im not sure what the benefits of reflective vs slot interrupt are if any. I went ahead and got 4 cny70 reflective sensors and 4 slot interrupters so I could do two motors with either method.
  • agfaagfa Posts: 295
    edited 2012-10-20 17:11
    I've used mouse IR pairs both as reflective and interrupter configuration. I liked using them because old mice are abundant and I am cheap. I actually removed them from the mouse circuit board and prototyped my on circuit boards. When I used as encoders I used them as reflective sensors with hand painted discs, I only used as tachometer not quadrature. I found that I had to add hysteresis using a 555 configured as a schmidt trigger. I've attached some notes I had made documenting a line following sensor array which describes two different styles of IR transistors that I ran across.
    1024 x 891 - 87K
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-20 19:55
    @agfa

    Those notes were incredibly helpful acually the photo trnsistor you drew in the bottom right is what these mice seem to use you cant tell the difference from front and back the middle is ground connected to the IR leds ground. The two outer emitters went directly to the mouses controller IC. So how do I wire those up, if the middle pin is grounded and I then sit in a dark room and interupt the connection what should happen, in my case one emitter is 0v the other 3v (im using a 3.3 supply) when I interupt the signal nothing happens on a DMM. Im not even trying to use the wheel yest just read the emitter pins when I manually break the signal. Im pretty sure the transistor needs to be biased but I dont see that happening on the original board, although I cut it up pretty bad...
  • jmgjmg Posts: 15,161
    edited 2012-10-20 20:07
    Find a mouse that still works, and probe that ?
  • kwinnkwinn Posts: 8,697
    edited 2012-10-20 21:08
    The signal out is usually on the collector, and the collector has a resistor going to the power supply. You also need to have current through the led so it is outputting some ir. The signal on the collector should be low when there is nothing blocking the ir beam, high when it is blocked.

    FYI, the signal out is not really a square wave. It rises as the ir beam is unblocked and decreases as the beam is blocked. In commercial encoders a schmidt trigger is used to square it up.

    The 555 idea agfa mentioned works well for cleaning up the signal.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-20 21:30
    Well agfa labeld two emitters and no collector in that drawing, If this thing is suppose to be putting out two signals and the center is grounded which pin do I need to put a voltage on ive tried both pins that arent grounded and just gotten goofy results. Do I need a pull down somewhere or a biasing transistor. Id hoped since agfa had this kind of photo transistor labeled in his notes almost exactly hed be able to tell me how to connect the thing. Now his drawing has two emitters, there is actually a base, collector and emitter correct?

    I managed to pull another photo interrupter out of a disk drive close to the ones I ordered from vishay, I figured I could just play with it until my real sensors with a data sheet get here from vishay :). If agfa has some info on this thing ill check it out again but I have to agree this is a bad way to do your first expermenint with encoding and IR even.

    I bought this http://www.radioshack.com/product/index.jsp?productId=2049723 a while back and there wasnt to much data on these leds, apparently the detector is the clear one. I bought these for a remote project not realizing i needed a 38-50khz detector for most applications. Obviously this could work as an interupter if I were to focus the leds at each other and sheild the light, but I was wondering If I could do something cooler with these like set up a beacon, IR object detection, or even better could I focus these at the groung to get an X,Y like a mouse? Im really intrested in the parallax or any mouse module but im not sure I acually want to buy any of it becuase id like to make something high powered enough that works 1 to 6 inches above the ground.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2012-10-21 03:43
    I bought this http://www.radioshack.com/product/index.jsp?productId=2049723 a while back and there wasnt to much data on these leds, apparently the detector is the clear one. I bought these for a remote project not realizing i needed a 38-50khz detector for most applications. Obviously this could work as an interupter if I were to focus the leds at each other and sheild the light, but I was wondering If I could do something cooler with these like set up a beacon, IR object detection, or even better could I focus these at the groung to get an X,Y like a mouse? Im really intrested in the parallax or any mouse module but im not sure I acually want to buy any of it becuase id like to make something high powered enough that works 1 to 6 inches above the ground.

    That set from Radio Shack should work. You could use heat shrink tubing to cover the body of them to help direct the beam. The early Rhino XR-1 used pairs similar to these (except the smaller T-1 size) to build their encoders. The easiest circuit for you to use is probably the 2nd one down on Gordons page here:

    http://www.robotoid.com/appnotes/circuits-quad-encoding.html

    Other than the resistor values it uses the same circuit that I use on my own home built encoders. It uses one gate of a 7416 chip to help clean up the signal. I've been using the 74HC16 chip for this. If you have two quadrature encoders you end up using 4 of the 6 gates in the chip. Since it is a CMOS chip you need to attach the inputs of the two unused gates as well. I usually just connect them to ground. You never want to leave any unused inputs on a CMOS chip floating (unconnected).

    Before you put any of these on your robot I would strongly suggest that you build one as a sample and just do some bench testing with one set. Once you get that working you can build the second one and install them.
Sign In or Register to comment.