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.

Magnetic encoder interfacing circuit

Status
Not open for further replies.

Rohith_elec

Full Member level 4
Joined
Dec 16, 2011
Messages
198
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,470
Can anyone help me building a Magnetic encoder interfacing circuit ?
Magentic encoder is connected to behind of a DC motor , how can i interface it with uC using H-bridge and count the steps ?
 

Jestin_cubetech

Advanced Member level 1
Joined
Jun 24, 2012
Messages
499
Helped
76
Reputation
152
Reaction score
73
Trophy points
1,328
Activity points
3,697
hall effect sensors and magnet bar combination is used for Magnetic Rotary Encoder System.

magnetic encoder out put
60_1345194645.png



simple program to read direction and count

Code:
//L1  encoder pin1
//L2  encoder pin2

unsigned int count=0;
unsigned char status1,status2;
while(1)
{
     count=0;
	 while(L1&&((count++)<30000));
	 status1=L2;
     count=0;
	 while(!L1&&((count++)<30000));
	 status2=L2;  
 	
 
 if((!status1)&&status2) {    //down     dec count  }
 else if(status1&&(!status2)){   //up      inc  count  }

 }
 

Rohith_elec

Full Member level 4
Joined
Dec 16, 2011
Messages
198
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,470
Is there any interfacing (amplifier) circuit needed for connecting it to uC ?
The sensor has two leads each from each bar.
 

tpetar

Advanced Member level 5
Joined
Sep 27, 2010
Messages
6,427
Helped
1,712
Reputation
3,454
Reaction score
1,677
Trophy points
1,393
Location
Pancevo-Belgrade, Serbia
Activity points
37,376
Last edited:

Marcel Majoor

Full Member level 2
Joined
Jan 17, 2004
Messages
148
Helped
69
Reputation
138
Reaction score
39
Trophy points
1,308
Activity points
1,569
For 'decyphering' the encoder, it is more typical to act on the rising and/or falling edge of A (or both A and B signal).
When you detect a rising/falling edge then it is just a matter of checking the state of the other signal to determine if you have to increment or decrement the counter.
For a '1x' decoding you act on the rising edge of A.
For a '2x' decoding you act on both rising/falling edges of A.
For a '2x' decoding you act on both A and B rising edges.
For a '4x' decoding you act and both rising/falling edges of both A and B signals.
 

Rohith_elec

Full Member level 4
Joined
Dec 16, 2011
Messages
198
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,470
these are the photos of motor with the magnetic sensor ,



- - - Updated - - -

This sensor doesnt need any amplifier ?
 

Rohith_elec

Full Member level 4
Joined
Dec 16, 2011
Messages
198
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,470
The motors with the sensors as the above pic's sensors will work with the amplifier circuit as Jestin_cubetech suggests ?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top