This is a 12 BIT Magnetic Angle Position Sensor using hall effect array.
I am hoping that someone can help me read this sensor board. From the datasheet, " The PCB requires only a 3-wire connection: 5V power supply, GND and the output connection . Only pin 1, 3, 5, and 7 of JP1 are connected. Capacitor C2 (1uF) is buffering the LDO output VDD3; C3 (1uF) is placed between VDD and GND."
This is a 1 wire bi- directional communication but for now all I need to do is read the angle for a windvane project.
The Output Pin is also described " Output and interface pin. Provides PWM Output on the AS5161 and Analog output on the AS5162 . It is as well used for programming UART interface." This board is the analog version.
At first I was confused by the term 'analog output' I thought is was like the as5040 and would output a proportional voltage but no.
I believe that I need to connect the output pin to an Rx pin on arduino and read the 12 bits in some fashion. I have not found any example for this board but there are examples and libraries for the as 5040 however they are I2C or PWM communication examples.
AS5161_AS5162_EK_AB_UserManual.pdf (457 KB)
At first I was confused by the term 'analog output' I thought is was like the as5040 and would output a proportional voltage but no.
According to the data sheet for the AS5162 that is correct, and it should come default programmed for that output. ams OSRAM is a global leader in intelligent sensors and emitters | ams OSRAM
Are you certain that you have the 5162 and not the 5161?
Thank you for your response. I thought that was correct as well. Have verified that I am indeed using the as5162 ( not the as5161 ) evaluation board shown in the top pdf file. Thanks for including the datasheet for the actual chip.
Here is the code I am using to read the sensor.
#define ANALOG_PIN 1
int reading = 0;
float angle = 0;
void setup()
{
Serial.begin(19200);
Serial.println("Started");
}
void loop()
{
reading = analogRead(ANALOG_PIN);
angle = ((float)reading / 1024.0) * 360.0;
Serial.print("Reading: ");
Serial.print(reading, DEC);
Serial.print(" Angle: ");
Serial.println((int)angle, DEC);
delay(1000);
}
I am connected to a mega 2560. I will check my connections again.
Connections were fine. I found this is the data manual. " The OUT pin (JP1 – 5) is used as output as well as programming interface. After the first power up, the AS5161 or the AS5162 is in communication mode. During this mode different settings are possible to program. via UART . After the fusing of the internal OTP ( one time programmable ) block, the AS5161 provides a pulse width modulated output (PWM) and the AS5162 provides an analog output.
I'm wondering if this chip is in communication mode and if so, what do I need to do to get functional mode.
There is an executable program from the manufacturer for programming this series of chips. I now have a version installed on my computer and all I need now is a half duplex one wire interface. This is a bit of a setback for my windvane project but it is definitely an education for me. I have a serial usb cable that converts to ttl levels and I will try and connect tx and rx with a circuit like the one shown to connect to the chip.
https://hackadaycom.files.wordpress.com/2014/01/1wireserial.png?w=352
Just a short update on the sensor. Yes the programming software is available from the manufacturer and yes the half duplex interface works quite well on this chip. I think that this will work on many of these microprocessor chips. This has been an interesting exercise for me. I'm sure that many of you who read this will consider this as beginner work but my hope is that someone will benefit.
Hi, im try to use AS5162 too. I don't have a demoboard, i use my own board(i checked and my board is the same). And on the windows GUI on read command i get an error: "Error -1073807343 occurred at Property Node (arg 1) in VISA Configure Serial Port (Instr)_RTS.vi->AS5161_128Bit_UART_Read.vi->AS5161_Main.vi" and i can't program the IC. Im using latest softvares from NI and AMS website. On google i dont find any ideas for this error.
Im using a CP2101 USB-UART Board and i try your 1wire schematic and an another schematic from Atmel's website(with 2 NPN transistor). Have you any idea's?