Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Measuring speed using a rotary optical encoder through a PIC 16F877 microcontroller

Status
Not open for further replies.

Kunal2

Junior Member level 3
Joined
Jun 21, 2011
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,512
Dear friends

I am doing a project where i need to measure the speed of my motor shaft. I am using a rotary optical encoder which will give a 0 logic level each time one of the 8 slots cuts the light beam. This output will enter a PIC 16F877 micro-controller. I need to do programming in mikroBasic to calculate the speed. I have a few vague ideas. Can you please help me to guide me towards the development of the program?

Proposed schema:
1. Input signal from sensor in pic
2. start internal timer of PIC
3. count pulses for a specific time
4. calculate speed

My problem also in how to start the internal time of the PIC. Kindly help me.

Relying on your usual cooperation.

Thanks

Kind regards

Kunal
 

Kunal,


I may sugest you to use dsPIC instead PIC.
That´s because it have incremental built-in hardware module, wich allows the firmware to take account of encoder position without need to count incoming pulses, but reading a specific counter register.

+++
 

Proposed schema:
1. Input signal from sensor in pic
2. start internal timer of PIC
3. count pulses for a specific time
4. calculate speed

My problem also in how to start the internal time of the PIC.

The following thread discusses at great length the implementation of a tachometer using a PIC and various sensors:

some questions motor speed monitoring

I would suggest reviewing the above thread and if you have any additional question concerning your projects implementation posting them here.

BigDog
 

Thanks andre_teprom.... However i do not have a dsPIC available and the time i will get it if purchases will be too close to my submission deadline...What i have on hand is a PIC 16F877... I need to manage with this one only....

Thanks a lot for the advice though.

Kind regards

Kunal

---------- Post added at 11:11 ---------- Previous post was at 11:02 ----------

Thanks a lot for your usual help and cooperation bigdogguru.... I will go through the link and get back once done to update you with progress on the topic.

Thanks a lot once again.

Kind regards

Kunal
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top