Searching \ for 'optical rotary encoders with PICs' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=encoder
Search entire site for: 'optical rotary encoders with PICs'.

Truncated match.
PICList Thread
'optical rotary encoders with PICs'
1997\01\07@070100 by Anson Chuang

flavicon
face
Dear All,

This is my first post and I am very impressed at the level of knowledge. And
since I have none, I am up for a lot of reading.

Anyway, this is a bit of a general electronics question. I want to make a
rotary switch for a HiFi preamplifier project. It is used to select the
source and volume on pre-amplifier and the signal from the switch goes to
the PIC. (with maybe some electronics in between).

The switch needs to be able to distinguish clock or anti-clockwise. And
little else. The end effect is similar to many PPL commercial radios with
tuning knobs that free wheel. I believe that there is such a thing as an
optical rotary encoder that will give me a required signal.

I recently opened a dead mouse and it has the exact parts I want, but
obviously I can't use it.

If there is such a thing as an simple optical rotary encoder that can be
mounted on a front panel of an Amplifier project. Tell me where to get it...

Anson

PS. I live in the UK, so only UK retailers please!

1997\01\07@083759 by Keith Dowsett

flavicon
face
>If there is such a thing as an simple optical rotary encoder that can be
>mounted on a front panel of an Amplifier project. Tell me where to get it...
>
>Anson
>
>PS. I live in the UK, so only UK retailers please!

Hi,

  If you find them at a reasonable price (RS charges 45 quid - ouch) could
you let me know too. If a mouse can be sold for five quid with two of them
in it there must be someone making them cheaply.

Thanks,

Keith.

P.S. If you want to get one from RS mail me and I'll send you the part no.

==========================================================
Keith Dowsett         "Variables won't; constants aren't."

E-mail: spam_OUTkdowsettTakeThisOuTspamrpms.ac.uk
WWW:    http://kd.rpms.ac.uk/index.html

1997\01\07@092732 by Wireless Scientific

flavicon
face
At 6:57 AM 1/7/97, Anson Chuang wrote:
>I recently opened a dead mouse and it has the exact parts I want, but
>obviously I can't use it.

why not?

Use a track ball connected a PIC serial port.

craig

1997\01\07@120831 by Aschwin Gopalan

flavicon
face
Anson Chuang <.....anson.chuangKILLspamspam@spam@dial.pipex.com> writes:

>
> I recently opened a dead mouse and it has the exact parts I want, but
> obviously I can't use it.
>
> If there is such a thing as an simple optical rotary encoder that can be
> mounted on a front panel of an Amplifier project. Tell me where to get it...
>

I had the same problem a few weeks ago. I found a few sources for such parts,
but they all were too expensive for my application. I couldn't get any optical
encoders below $40. If cost is not an issue to you, you can get optical
encoders by HP or Bourns, e.g. Look up UK suppliers at their homepage, I can't
help you there since I live in germany. (If memory serves me well, I found
some HP parts in the Farnell catalogue, which you should have in the UK, too)

For my project I finally bought mechanical encoders, since I didn't need the
higher resolution of the optical parts. I got Bourns mechanical encoders with
32 steps per rotation. These have mecanical clicks, which is not ideal for
my application, but I got them for 7DM ($5) at Farnell's so what the heck...

I hope that helps you...

PS: If you find cheap optical encoders, pleas mail me, I am still interested!


Bye

Aki

1997\01\07@135247 by Anson Chuang

flavicon
face
At 18:08 07/01/97 +0100, Aschwin Gopalan wrote:
>Anson Chuang <anson.chuangspamKILLspamdial.pipex.com> writes:
>
>>
>>
>> If there is such a thing as an simple optical rotary encoder that can be
>> mounted on a front panel of an Amplifier project. Tell me where to get it...
>>
>
>For my project I finally bought mechanical encoders, since I didn't need the
>higher resolution of the optical parts. I got Bourns mechanical encoders with
>32 steps per rotation. These have mecanical clicks, which is not ideal for
>my application, but I got them for 7DM ($5) at Farnell's so what the heck...
>

Do mechanical encoder provide the CW, CCW triggers that I am looking for? I
don't have that many data lines left on my '84. Only PA4, and PortB bus left...

Anson

1997\01\07@152938 by Leon Heller

flavicon
picon face
In message <.....2.2.32.19970107115700.006863e8KILLspamspam.....pop.dial.pipex.com>, Anson
Chuang <EraseMEanson.chuangspam_OUTspamTakeThisOuTDIAL.PIPEX.COM> writes
{Quote hidden}

Cirkit have an inexpensive mechanical encoder in their catalogue. It
looks a bit like a rotary switch, and is much cheaper than the optical
ones, but won't last as long. We make our own optical encoders where I
work, for our military radios. It's basically a disk with slots cut in
it. The "fingers" are then bent over at right angles to produce a sort
of slotted cylinder - very cheap, and it's easy to mount the IR LED
emitters and IR sensors.

Leon
--
Leon Heller, G1HSM
leonspamspam_OUTlfheller.demon.co.uk
Tel: +44 (0) 118 947 1424 (home)
    +44 (0) 1344 385556 (work)

1997\01\08@020809 by nigelg

flavicon
picon face
In message  <@spam@2.2.32.19970107115700.006863e8KILLspamspampop.dial.pipex.com>> KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU writes:

> If there is such a thing as an simple optical rotary encoder that can be
> mounted on a front panel of an Amplifier project. Tell me where to get it...

There's no need to use an expensive optical encoder, I believe the cheaper
ones use conductive plastic, and would be quite suitable for a volume control.
Many current 'mid-cost' audio units use encoders, as do some of the Pace
satellite receivers (MSS500/1000), you could always try and obtain one as a
spare part - if I remember, I'll try and find a price tomorrow.

Nigel.

       /--------------------------------------------------------------\
       | Nigel Goodwin   | Internet : RemoveMEnigelgTakeThisOuTspamlpilsley.demon.co.uk     |
       | Lower Pilsley   | Web Page : http://www.lpilsley.demon.co.uk |
       | Chesterfield    |                                            |
       | England         |                                            |
       \--------------------------------------------------------------/

1997\01\08@023532 by Mike

flavicon
face
>Cirkit have an inexpensive mechanical encoder in their catalogue. It
>looks a bit like a rotary switch, and is much cheaper than the optical
>ones, but won't last as long. We make our own optical encoders where I
>work, for our military radios. It's basically a disk with slots cut in
>it. The "fingers" are then bent over at right angles to produce a sort
>of slotted cylinder - very cheap, and it's easy to mount the IR LED
>emitters and IR sensors.

I have one of the older microsoft mice - the type that used a PC-card
to use an LPT(2) interrupt so it looked like a PS/2 type.

The Mouse is mechanical - has two code wheels X and Y and each code wheel
has 2 sliding contacts (and still some lubrication even after 6 years).
So you can generate pulse and direction by using a simple flip-flop,
though use a schmitt with delay at the front end to remove extraneous
pulses.

I've seen this mouse sold around secondhand shops for about 5$.

Mine still works after 6 years !  Even without extra vaseline and I use it
every day.


Rgds

mike

Socrates once gave the advice to "by all means get married... If you
get a good wife you will become happy, if you get a bad one you will
become a philosopher."

Become an Engineer and avoid making this problematic decision.

1997\01\08@025407 by Martin Nilsson

picon face
> Anyway, this is a bit of a general electronics question. I want to make a
> rotary switch for a HiFi preamplifier project. It is used to select the
> source and volume on pre-amplifier and the signal from the switch goes to
> the PIC. (with maybe some electronics in between).
>
> The switch needs to be able to distinguish clock or anti-clockwise. And
> little else. The end effect is similar to many PPL commercial radios with
> tuning knobs that free wheel. I believe that there is such a thing as an
> optical rotary encoder that will give me a required signal.

Why not use a simple DC motor? Bias at 2.5 V and feed into PIC A/D via an
opamp + filter. The DC motor will give output with magnitude proportional
to rpm and polarity of the direction of rotation. If you don't want the
magnitude it might do with a pair of comparators.

-- Martin

1997\01\08@052550 by Aschwin Gopalan

flavicon
face
Anson Chuang <spamBeGoneanson.chuangspamBeGonespamdial.pipex.com> writes:

>
> Do mechanical encoder provide the CW, CCW triggers that I am looking for? I
> don't have that many data lines left on my '84. Only PA4, and PortB bus
left...
>
> Anson
>

Yes, they give you the same quadrature signals as the optical ones, that is
two sqare wave signals. Depending on which edge comes first, you get the
direction. You need two input pins on the PIC, one for each channel. You
have to debounce them in software though. Its not really a problem, it took
me about 30min, but thats just because am am a little dumb sometimes :-(

I can lookup my code at home and mail it to you, though I think it is not
quite an example of nice coding style...


To clarify the operation of these things, let me show you a little ascii-art:

Channel A
         ++-------++      ++-------++      ++-------++
         ||       ||      ||       ||      ||       ||
         ||       ||      ||       ||      ||       ||
         ||       ||      ||       ||      ||       ||
----------++       ++------++       ++------++       ++-------


Channel B
    ++-------++      ++-------++       ++-------++
    ||       ||      ||       ||       ||       ||
    ||       ||      ||       ||       ||       ||
    ||       ||      ||       ||       ||       ||
-----++       ++------++       ++-------++       ++-------

This is for clock-wise rotation for example.

As you can see, if you trigger on the rising edge of A, B is always high.
For CCW rotation, at the rising edge of A, B is always low. So you can use
one of the channels as a trigger and the other as direction output. All what is
left is the debouncing.

Another thing: look carefully at the manufactures specs on rotational lifetime
of the part. The cheaper ALPS parts I found only had a lifetime of 10.000
rotations, which is not really much. The Bourns parts I am using now will last
for 200.000 rotations, which is much better but still well below the 2 millions
you can get out of optical encoders :-(


Bye,

Aki

1997\01\08@084505 by Paul Waterfield

flavicon
face
> > Anyway, this is a bit of a general electronics question. I want to make a
> > rotary switch for a HiFi preamplifier project. It is used to select the
> > source and volume on pre-amplifier and the signal from the switch goes to
> > the PIC. (with maybe some electronics in between).
> >
> > The switch needs to be able to distinguish clock or anti-clockwise. And
> > little else. The end effect is similar to many PPL commercial radios with
> > tuning knobs that free wheel. I believe that there is such a thing as an
> > optical rotary encoder that will give me a required signal.
>
> Why not use a simple DC motor? Bias at 2.5 V and feed into PIC A/D via an
> opamp + filter. The DC motor will give output with magnitude proportional
> to rpm and polarity of the direction of rotation. If you don't want the
> magnitude it might do with a pair of comparators.
>
>  -- Martin
>

Ive used a stepper motor like this. Use two comparitors to clean up
the signals from two of the phases and feed this into the PIC and use
them like an ordinary encoder.
Paul Waterfield
Exhibit designer
Techniquest Cardiff.

1997\01\08@085546 by rrose

flavicon
face
> PS: If you find cheap optical encoders, pleas mail me, I am still interested!

I too would be interested in the information.


Richard Rosenheim
TakeThisOuTrroseEraseMEspamspam_OUTaccessnv.com

1997\01\08@132206 by Anson Chuang

flavicon
face
At 08:52 08/01/97 +0100, Martin Nilsson wrote:
>>
>> The switch needs to be able to distinguish clock or anti-clockwise. And
>> little else. The end effect is similar to many PPL commercial radios with
>> tuning knobs that free wheel. I believe that there is such a thing as an
>> optical rotary encoder that will give me a required signal.
>
>Why not use a simple DC motor? Bias at 2.5 V and feed into PIC A/D via an
>opamp + filter. The DC motor will give output with magnitude proportional
>to rpm and polarity of the direction of rotation. If you don't want the
>magnitude it might do with a pair of comparators.
>
> -- Martin
>

Good idea, but since the motor is next to some delicate audio equipment, I
am unsure as to its noise contributions. Also, I only have equipment to
program the '84s

Anson

1997\01\08@181835 by nigelg

flavicon
picon face
In message  <RemoveME2.2.32.19970107115700.006863e8spamTakeThisOuTpop.dial.pipex.com>> PICLISTEraseMEspam.....MITVMA.MIT.EDU writes:

> If there is such a thing as an simple optical rotary encoder that can be
> mounted on a front panel of an Amplifier project. Tell me where to get it...

I checked on the encoder used on the Pace MSS500/1000 satellite receiver, it's
a quadrature encoder (but not optical), and only costs 1.84 UK pounds + vat as
a spare part from Pace. The manual gives the encoder the reference
ECWOJ-C24-BE0024(200K-CYC), and the partnumber 146-0002420. On the circuit
diagram it has three connections, 5 volts, anti-clockwise, and clockwise.

Nigel.

       /--------------------------------------------------------------\
       | Nigel Goodwin   | Internet : EraseMEnigelgspamlpilsley.demon.co.uk     |
       | Lower Pilsley   | Web Page : http://www.lpilsley.demon.co.uk |
       | Chesterfield    |                                            |
       | England         |                                            |
       \--------------------------------------------------------------/


'optical rotary encoders with PICs'
1997\12\03@061200 by Stuart Tyrrell
flavicon
picon face
Way back in January, in message
<RemoveMEubenfwmpp9.fsfEraseMEspamEraseMEhelium.physik.uni-kl.de> Aschwin Gopalan
<RemoveMEgopalanspam_OUTspamKILLspamPHYSIK.UNI-KL.DE> wrote:

{Quote hidden}

Looking at edges in this way is asking for trouble, hence you have to
write things like debouncing routines etc. Really you should always look
at examining the levels.

A nice (fast!) compromise is documented in one of the Parallax data
sheets, which is:

Is the Current reading different from the previous?
If so:
 Take the previous reading
 shift it to the right
 xor it with the current reading.
 Check bit 0 (or 2, 4, 6 etc...)
 If it is 0, then decrease the counter, else increase it.

This works wonderfully. Consider the first two transitions in Aschwin's
example (assume that count starts at 5, and the switch bounces a lot!)

    A: LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLHLLLLHHHHLLHHHHHHHHH

    B: LLLLLLLLLLHLLLLHHHLLHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Change: NNNNNNNNNNYYNNNYNNYNYNNNNNNNNNNNNNNNNNNNNNNNYYNNNYNNNYNYNNNNNNNN

Count:  5555555555655556665566666666666666666666666676666777766777777777

There's absolutely no way that the bounce can induce slippage, which it
would with an edge-detecting algorithm.

Using such a mechanism I've been keeping a serial-controlled resistor
up to date and reading encoders at up to 12,000 pulses/sec on a 4MHz
'84! (that's assuming one channel out of the 4 it's monitoring is
changing, and guarantees that any pulse is seen)

Fun!




Stuart.
--
Stuart Tyrrell Developments        RemoveMEStuartTakeThisOuTspamspamstdevel.demon.co.uk
PO Box 183, OLDHAM. OL2 8FB        EraseMEstdevelspamspamspamBeGonelocust.co.uk (Mobile <> Email)
Orange: 0976 255 256 (9am-9pm)     http://www.stdevel.demon.co.uk
*Analogue joystick i/face 39.95*   *Using an IR keyboard via PS2Mouse 24.95*

1997\12\03@080229 by Ben Wirz

flavicon
face
Hi Guys,

       US Digital makes a nice chip that decodes the quadature inputs into a
direction and clock pulse that could be easily interfaced to a PIC's
interupt.  On interupt, sample the direction and increment your counter.
It also has some built in filtering.  I only looked at quickly but it
looked interested and was pretty cheap, ~2.00 US.  I can dig out their
contact info if your interested.

Ben
Wirz Electronics
http://www.wirz.com


At 10:18 AM 12/3/97 +0000, you wrote:
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...