Mouse encoders

westaust55

Moderator
Welcome to the PICAXE forum.

What type of mouse are you considering:
(a) Wheel type (photo interrupter) encoder
(b) Optical (no wheel/ball) type encoder

I have utilised an encoder from a wheel type MS Mouse. Each encoder has two photo transistors so that quadrature encoding for direction can be achieved. My project only used one channel as I only needed to determine speed or distance but not direction.
Have a look at this project for a Model Railway Speedometer wagon if you seek some details/schematic on how to use the wheel type (photo interrupter) mouse encoder.
http://www.picaxeforum.co.uk/showthread.php?27013-PICAXE-based-Model-Railway-Speedometer-Wagon
The schematic provides resistor values in series with the IR LED and for the emitter side of the photo transistor (for PICAXE input).


For quadrature encoder applications there have been some past threads on that topic if you do a PICAXE forum search.
 

JAM1959

Member
Thanks for answering.I had stripped a standard ball ps2 mouse.Unsoldered its decoder and got it working on a breadboard but not connected to Picaxe.Used multi meter to test working.While we on Picaxe,which is the best one to buy.I am using 08M2 at the moment.
 

hippy

Technical Support
Staff member
While we on Picaxe,which is the best one to buy.I am using 08M2 at the moment.
It really depends on what you want to do. All current PICAXE chips have reasonably large memory capacities, can operate on a wide range of supply voltages, will run up to 32 MHz, and they mostly have the same or similar capabilities.

For a mouse wheel or other quadrature encoder project fastest speed is useful and the 20X2 can run at 64 MHz without requiring any additional crystal or resonator.

As you have an 08M2 at present then it's probably best to start with that and see how things go, get things working and then see if it is up to what you require.
 

JAM1959

Member
Thanks.I will have to check with HobbyTronics here in South Africa and see what is in stock.I was planning on building a basic data logger for my Formula Vee racing car.On that basis which Picaxe should I use.I will use pots to measure suspension movement etc.
 

westaust55

Moderator
You need to indicate the full extent of the sensors and outputs.
A comment like suspension movement etc is rather vague as to total IO requirements.
Even for the suspension, is That in one axis only or in all three axis.

Then are the sensors going to be via i2c or direct to ADC inputs? Only one device per ADC input but can be many onto the i2c port (often 8 or more of the same i2c chip) and multiples of differing i2c chip types.
that may dictate a 28X2 or 40X2 part.

The X2 parts can operate to 64 MHz by design with an external resonator and even 80 or 100 MHz going outside the specs (I have 4 off 28X2 operating reliably at 80 MHz)

Think about your total IO and compare the count with the PICAXE pin out diagrams:
http://www.picaxe.com/What-is-PICAXE/PICAXE-Pinouts/

For any reasonable data logger you will either need several large 24/25LC series i2c EEPROM memory chips or to investigate use of SDRAM memory cards -there are a few past threads on the topic if you watch the forum.
 

westaust55

Moderator
24LC512 or 24LC1024 are the sort of i2c EEPROM I was suggesting.
The 25LC series are actually SPI interfacing EEPROM.
With the 24LC512 you can easily have up to 8 connected to the i2c port for 512 KBytes of storage.
how much memory capacity you need depends on How many sensors, whether byte or words of data, frequency of recording data and how long/duration over which you want to record as 1 campaign.
 

JAM1959

Member
I will only log suspension movement up and down,2 front pots and 1 rear as rear suspension runs a monoshock system.I will only log for one lap to start off with.Then I can come home pull suspension down to that point and see what happens with wheel aligment angles...I wud also like a 360 deg pot on steering shaft to measure steering angle.Hope that makes senses.Take baby steps......first
 

erco

Senior Member
If this is on a vehicle, you definitely don't need a mouse's quadrature encoder nor high resolution. Eight or fewer ticks per wheel revolution is plenty.
 

JAM1959

Member
Thanks.I found a web page where they had used pots to measure suspension,throttle position etc.So that's the route I will take.Will use Picaxe battery source to run pots so nothing is linked to cars system.I only need to log for maybe one or two laps.It is not F1 or Indy car.
 
Top