Hello Friends ,
Here we created this article for Angular sensor reading
taking using Arduino. Angular sensor is mostly use for precession
linear or angular position sensing. Or alterative for
potentiometer.
Here I am using AS5020 6-Bit Absolute Angular
Position Sensor of simple magnet source that is placed at the surface.
A total of 64 absolute angular positions are available within the full
range of 360°. The device includes a Hall sensor array, the
signal conditioning and the post processing needed to generate a
6- bit binary code. The binary code may be accessed via
the Synchronous Serial Interface (SSI).
NOTE : Zero-position programming allows one time programming of a user
specific zero position between the device and the magnet source.
Pin Configuration :
![]() |
AS5020 Angular Sensor |
Pin 1 # DATA : DATA Output of the SSI. If PD/CSn=0, the measured angle data (6-bit
value) is serially shifted out over this pin by the CLK, starting
with the MSB. A NVR bit and a PARITY bit are added. Even Parity is given.
(NVR=1 indicates a Non Valid Range of the magnetic field)
Pin 2 # VDD : Positive Supply Voltage.
Pin 3 # VSS : Negative Supply Voltage (GND).
Pin 4 # PROG : Programming Input. This pin is used to program the
zero position into a non-volatile memory (One Time Programmable).
The programmed value is subtracted from the actual measured
angle. (This pin is also used for Data In during Daisy-Chain
function)
Pin 5 # N.C : Not Connected during
operation. This pin is for manufacturers use only.
Pin 6 # N.C : Not Connected during
operation. This pin is for manufacturers use only.
Pin 7 # PD/CSn : Power Down
Input, Disable or Chip Select (active low). PD/CSn=0 activates the device and enables the measurement. PD/CSn=1 sets the device in power save mode and puts the DATA pin in high impedance (high Z) state.
Pin 8 # CLK : CLOCK Input of the SSI.Pin 8 serially clocks out the measured angle data at Pin 1 (DATA).
Basic Diagram :
Schematic Diagram :
![]() |
Circuit Diagram of Angular sensor with Arduino |
const int clockpin = 13;
const int datapin = 12;
const int cspin = 10;
void setup()
{
Serial.begin(9600);
pinMode(clockpin, OUTPUT);
pinMode(cspin, OUTPUT);
pinMode(datapin, INPUT);
digitalWrite(cspin, HIGH);
digitalWrite(clockpin, LOW);
}
void loop()
{
digitalWrite(cspin, LOW);
digitalWrite(clockpin, HIGH);
delayMicroseconds(10);
digitalWrite(clockpin, LOW);
delayMicroseconds(10);
byte data = shiftIn(datapin, clockpin, MSBFIRST);
digitalWrite(cspin, HIGH);
Serial.println(data);
Serial.println(data, BIN);
delay(1000);
}
Comments
Post a Comment