If you want reasonably accurate results you could use an optical encoder unit from HP. These give out two pulse trains. One of them leads or lags the other by 90 degrees depending on the direction of rotation. This can be detected by connecting one pulse train to the D input of a D-type flip flop, and connecting the other to the clock input of the same flip flop. Now what you do is to count the pulses from one of the channels of the optical encoder to get rotation info and read the output of the flip flop to get the direction info. You can also dispense with the flip flop and do all inside the pic by sampling the state of one channel when the other changes state. You may get some jitter on the count if you change direction often, but as the encoder has 1024 pulses/rev you might be OK. I am doing this for a coil winding machine I am building which requires high accuraccy (I'm making 2 coils which have to "see" the exactly the same ammount of magnetic flux for high field measurements, therefore all errors in the coil construction are important. For transformer winding this may be overkill). Joe At 07:39 26/07/98 -0700, you wrote: >At 1:11 AM -0700 7/24/98, Aldi Navarro wrote: > > >> Good day ! >> >> Presently I'm doing a counter for my transformer winder machine using >> this 16C84. >> However, I need to determine the direction of the rotation in order to >> know the >> correct no. of turns by considering the addition and subtruction of >> turns which depends >> on the direction of the rotation of my motor. >> >> Can anybody give an idea on the way to detect the direction of the >> motor in simplest >> manner or any. > >If you just want simple, connect a magnet to the shaft, and put a coil >around it. It then becomes a small generator. Add a diode, and a zero >voltage is CCW or stopped (or really slow), and + voltage is CW. >Should be good enough for a winding machine. -Chuck- > >__________________________________________________________________________ >Chuck Rice > >