Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

analog to quadrature converter?

0 views
Skip to first unread message

Mad Scientist Jr

unread,
Aug 24, 2005, 2:28:40 PM8/24/05
to
How difficult would it be to make an analog to quadrature converter,
that reads a potentionometer, and detects a change in resistance and
based on whether it increased/decreased, sends a pulse (turns on/off
two switches) that mimics a mechanical rotary encoder? I am looking for
256 pulses per revolution. The potentionometer would need to be small
(about the size of a large guitar pot, the circumference of a quarter)
and the circuitry not too bulky (fit inside a small project box), and
be powered by 5v, .5ma. It would possibly use a PIC controller.

If possible (without complicating it too much) I would like the
potentionometer to be one of those ones that can spin a full 360 deg,
so after a full spin, the resistance would go back to 0 (or max
resistance if turend the other way), and the converter would need to be
smart enough to detect this and compensate so it sends the correct
quadrature.

Any ideas?

Jeff Shirley

unread,
Aug 24, 2005, 2:41:41 PM8/24/05
to

> Any ideas?

Is there some reason you do not want to just BUY a rotary encoder with
quadrature outputs? I think I have seen some about the size you want.

Jeff.
--
Jeff Shirley
spam-...@mindspring.com
"Bill Gates is filthy rich, but that doesn't mean I want to be married to him."

The Artist Formerly Known as Kap'n Salty

unread,
Aug 24, 2005, 3:05:22 PM8/24/05
to

An easier way to do it would be to just use a rotary encoder and forget
the pot. There are lot's of rotary controls out there that behave
(mechanically) like pots but produce a quadrature (or absolute) output
based on position, rather than a variable resistance. They're plenty
cheap -- I think digikey has zillions of these (search for "rotary
encoder"). There are both quadrature encounders and encoders that output
an absolute position, and there are both optical and mechanical versions.

Is there any reason you have to use a pot?

Otherwise, go to www.digikey.com and search for "rotary encoder".

--
(Replies: cleanse my address of the Mark of the Beast!)

Teleoperate a roving mobile robot from the web:
http://www.swampgas.com/robotics/rover.html

Coauthor with Dennis Clark of "Building Robot Drive Trains".
Buy several copies today!

Mad Scientist Jr

unread,
Aug 24, 2005, 6:56:09 PM8/24/05
to
i haven't found a mechanical encoders with the resolution I need (256
pulse per revolution(ppr)), and
i didn't know optical encoders came with all the circuitry inside them
- i do not know much electronics. if i can find a 256 ppr encoder that
just takes 5v DC that is affordable that will work, but they seem a bit
pricey at $50 for a 128 ppr. so the potentionomter was an idea for a
workaround

Mad Scientist Jr

unread,
Aug 24, 2005, 6:58:03 PM8/24/05
to
If I can find a 256 ppr optical encoder that just requires 5v and no
fancy circuitry and is affordable (the cheaper the better, can you get
one for <$15?) that will work. Thanks, I will check out digikey

Matthias Melcher

unread,
Aug 25, 2005, 2:39:00 AM8/25/05
to Mad Scientist Jr
Mad Scientist Jr wrote:
> How difficult would it be to make an analog to quadrature converter,
> that reads a potentionometer

Pretty easy. You can do that with a PIC or ATtiny with 8 pins. They come
with 8 or 10 bit analog inputs and any kind of output. You will have
some problems at 360 degrees when the pot goes back to 0, because this
is usually not just a tiny jump, but several degrees of dea area without
readings. Also, you have to find someone to write the program for you
and flash the controller. That will run you *far* over $80 for the encoder.

The Artist Formerly Known as Kap'n Salty

unread,
Aug 25, 2005, 10:21:05 AM8/25/05
to

The QEDS-7148 (HP) rotary encoder has 500 counts/rev and is about the
size you want. They are USD $15.00 apiece from C and H sales. Go to:

http://www.aaaim.com/CandH/

And check their online catalog. I have a couple of these, and they are
quite nice.

Mad Scientist Jr

unread,
Aug 25, 2005, 10:56:50 AM8/25/05
to
Thanks - I will check this out. $15 is doable.

Mad Scientist Jr

unread,
Aug 25, 2005, 10:59:32 AM8/25/05
to
I can live with just using existing Atari 2600 paddles, which don't go
back to 0. Is it possible to make a 4-in-1 encoder, that generates
quadrature for 4 paddles at once? Also I can probably write the program
myself, I am a programmer and have done some C. Are the compiler &
tools freeware? As far as flashing the controller, how expensive is the
equipment? How hard is it to wire the PIC? Can it be made to run off
the of 5v .5 mA going through the switches?

The Artist Formerly Known as Kap'n Salty

unread,
Aug 25, 2005, 11:07:59 AM8/25/05
to
Mad Scientist Jr wrote:
> Thanks - I will check this out. $15 is doable.
>

I think you'll find that it's cheaper than a POT and a PIC, assuming your time
isn't worthless. Remember that you need a programmer for the PIC as well, which
isn't free (although it can be done cheaply, or you might already have one).

Also, this unit is optical so it shouldn't wear out any time soon.

The Artist Formerly Known as Kap'n Salty

unread,
Aug 25, 2005, 11:11:46 AM8/25/05
to
Mad Scientist Jr wrote:
> Thanks - I will check this out. $15 is doable.
>

One other thing you should understand (and from the tenor and subject of your
messages I thought you might not) is that quadrature output is not absolute --
it merely gives you distance and direction of travel. This unit is quadrature
output. Hit google for more information on quadrature output (if you need more
info).

Hope that helps -- tAfkaks

Mad Scientist Jr

unread,
Aug 25, 2005, 11:44:09 AM8/25/05
to
Not a problem, my game already is coded for quadrature - 2 bits - you
simply compare the last value read with the current value and you know
what direction the knob was turned.

I checked out the encoder, the only problem is it is 40 mA, and I only
have 5 mA to work with (though it matches on 5V).

Mad Scientist Jr

unread,
Aug 25, 2005, 11:45:40 AM8/25/05
to
How difficult / expensive is it to get the compiler and PIC flash tools
and do it myself? I am more worried about wiring up the PIC, not
knowing electronics. Also are there PICs that run on 5V .5 mA?

The Artist Formerly Known as Kap'n Salty

unread,
Aug 25, 2005, 12:16:46 PM8/25/05
to

The PIC IDE (w/ assembler) from microchip is free. You'll pay for a C or basic
compiler, though. If you go avr, you can use the gcc toolchain. In both cases
you'll need a programmer -- there are a lot of options, so use Google for
details. I'm not aware of a part that runs on .5ma (did you mean 5ma?) -- but
again, go to the Atmel or Microchip sites to check the datasheets. Most parts
run on 5v.

Is there any reason you're so limited on current draw?

Mad Scientist Jr

unread,
Aug 25, 2005, 1:37:29 PM8/25/05
to
I'm limited by the power supply of the keyboard interface that I'm
using to read my inputs (Hagstrom KE72 module, see
hagstromelectronics.com). Also they have told me that high counts per
revolution might be too fast for the keyboard throughput (limited by
the PC). If that's a problem, I would lean toward simply using a simple
8-bit DAC for each paddle but it kills me to have to use 8 inputs for a
stupid paddle.

Mad Scientist Jr

unread,
Aug 25, 2005, 1:45:56 PM8/25/05
to
I think I meant to say ADC, not DAC. One more question - how
difficult/expensive would it be to build a 8-bit analog-to-digital
converter that you plug a potentionometer into, and it simply
opens/closes 8 switches to send an absolute value to the KE72 or
whatever input device you are using?

The Artist Formerly Known as Kap'n Salty

unread,
Aug 25, 2005, 3:03:54 PM8/25/05
to
8-bit adcs are pretty common parts. I'm sure there are parts with a parallel
output. Some also output via shift register or even ttl async. Might be simpler
than using a microcontroller. Spend some quality time at the digikey website or
with their catalog.

Mad Scientist Jr wrote:
> I think I meant to say ADC, not DAC. One more question - how
> difficult/expensive would it be to build a 8-bit analog-to-digital
> converter that you plug a potentionometer into, and it simply
> opens/closes 8 switches to send an absolute value to the KE72 or
> whatever input device you are using?
>
> Mad Scientist Jr wrote:
>
>>I'm limited by the power supply of the keyboard interface that I'm
>>using to read my inputs (Hagstrom KE72 module, see
>>hagstromelectronics.com). Also they have told me that high counts per
>>revolution might be too fast for the keyboard throughput (limited by
>>the PC). If that's a problem, I would lean toward simply using a simple
>>8-bit DAC for each paddle but it kills me to have to use 8 inputs for a
>>stupid paddle.
>
>

0 new messages