AS5048B Adapter Board

Hi,

I'm trying to get this adapter board working with arduino.

http://ams.com/eng/Support/Demoboards/Magnetic-Position-Sensors/Angle-Position-On-Axis/AS5048B-Adapterboard

I'm connecting it to an adafruit bluefruit LE Micro

The problem I'm having is getting the i2c to work.

I've got it powered up properly, I checked this by checking the pwn output of the board. Moving the magnet around changes the PWN value - read using standard pwn read.

But using the standard i2c arduino scanner code it just says no i2c devices detected.

The adafruit board has no pullup resistors so I've tried 2.2k, 4.7k and 10k resistors pulling up the SCL and SDA pins of the bluefruit but still nothing.

Also I found a library for the sensor

Using that I just get an i2c error 2(which I believe means no sensor found), that library says the A1 and A2 pins should be grounded to set the i2c address - which I have done.

I've checked all the pins are connected correctly - even checking individual pins from the chip itself.

I have been trying it for a number of days now and still nothing via i2c. I know the i2c pins on the bluefruit work because I've connected another i2c device(wii nunchuck with the wiichuck library) and that works.

I am stumped as to what to try next. The datasheet for the board is not very helpful - the only wiring diagram in that is for SPI - which is the A version of this board(the B version is i2c).

I've googled a lot and apart from the library I can't find any more information on wiring etc for this board.(which the library doesn't cover - I just read the A1, A2 pin ground in the library code).

Any suggestions as to what to try to get it to work ?

Thanks.

I've read a bit more and it seems that I need to set the base address using OTP. I've tried using the program address sketch included in the library but even that gives an i2c Error 2. The PWM output is definitely working it's just not good enough for my use - it doesn't give a consisten value.

I've got it powered up properly, I checked this by checking the pwn output of the board. Moving the magnet around changes the PWN value - read using standard pwn read.

Please define what a "standard pwn read" is.

The adafruit board has no pullup resistors so I've tried 2.2k, 4.7k and 10k resistors pulling up the SCL and SDA pins of the bluefruit but still nothing.

Where did you connect that to? 5V? The datasheet of the sensor says that any input pin must not get a voltage over 3.8V.

Please provide a wiring diagram. In my interpretation of the datasheet the address pins must not be left floating otherwise probably that SPI interface is selected.

Hi,

thanks for reply.

I used two ways of checking the pwm output. I used pulseIn() and pinChangeInterrupt.(learnt from this post)

http://www.benripley.com/diy/arduino/three-ways-to-read-a-pwm-signal-with-arduino/

(though I used a different pinChangeInterrupt library rather than pinChangeInt because I couldn't get that one to work with the arduino).

Both of which show the value changing as I rotate the magnet - though the value flutters too much for my needs - by flutter I mean the value doesn't stay completely static, i guess because it uses a timing function to generate the value.

Wiring

The capacitors are there based on the main datasheet for the boards(2nd image). I don't know if it makes a difference but the only 10uf capacitor I could get was electrolytic but it's correctly orientated - I doubt it affects the i2c because it's just for powering sensor board - which I assume is working correctly because the pwm works.

I've checked the sda and scl levels and they are around 3.3v.

This version of the board doesn't have SPI - that's the A version of the board, the B version uses i2c(I can understand confusion because the datasheet only has SPI wiring diagram, even though it's meant to cover A and B version).
Thanks.

I've checked the sda and scl levels and they are around 3.3v.

What does that mean? What values did you measure exactly?

The biggest problem I see with your wiring is the pull-ups of 10kΩ, together with the internal pull-ups (~30kΩ) activated by the Wire library you get a slightly over-voltage on the I2C pins. The specification says that the maximum tolerable overvoltage is 0.3V but you provided over 0.4V. I don't know how sensitive the sensor is for such stuff, but it might be a problem.

Other than that I cannot see what might go wrong. At least the scanner should show anything if the address lines are not left floating.

Hi,

When I say I checked the values I used a multi meter to check what voltage I was reading on the sda and scl pins when operating to check that the pins were being pulled up(I've read stuff on i2c and even though I sort of understand, my internal logic thinks that having both scl and sda pulled up to the same supply would means they are shorted together(though I realise this is not the case)).

I don't think the adafruit board has pullups(I'm not sure what you mean but the internal pull-ups). The adapter board has no resistors on it I can see.

Where is the 0.4V overvoltage you talk about ? I can't see where that would be.

Thanks again for your help.

When I say I checked the values I used a multi meter to check what voltage I was reading on the sda and scl pins when operating to check that the pins were being pulled up(I've read stuff on i2c and even though I sort of understand, my internal logic thinks that having both scl and sda pulled up to the same supply would means they are shorted together(though I realise this is not the case)).

You don't short by a resistor, you only short them by a direct wire.

I don't think the adafruit board has pullups(I'm not sure what you mean but the internal pull-ups).

By internal I mean the pull-up resistors that are included into the MCU (ATmega328p). The Wire library activate these pull-ups, so with weak external pull-ups you might get a critical voltage for sensitive devices.

Where is the 0.4V overvoltage you talk about ? I can't see where that would be.

Take the internal pull-up of around 30kΩ to 5V and the external pull-up of 10kΩ to 3.3V. Together they build a voltage divider between 5V and 3.3V by a ration of 3:1. So the resulting voltage on the I2C pins is about 3.725V. If the Arduino is driven by USB the voltage is usually a bit higher, so you get even more critical values. The datasheet of your sensor specifies that the maximum voltage to any pin is 3.6V. So the 3.725V is over that. That's what I meant.

Hi,

thanks for the very detailed reply, and for your patience in answering my questions.

I just tried 2k2 resistors on the SDA and SCL and the voltage on those pins was 3.25V.

One thing has occurred to me, initially I read the datasheet and thought it was SPI version(I just bought it without paying attention to exact version).

So I tried using SPI. Is it possible that I fried the I2c part of chip trying that ? I'm not sure what kind of voltage using SPI uses. Is is possible to fry part of a chip(i2c bit) and still have the PWM part work ?

Thanks.

So I tried using SPI. Is it possible that I fried the I2c part of chip trying that ? I'm not sure what kind of voltage using SPI uses. Is is possible to fry part of a chip(i2c bit) and still have the PWM part work ?

Yes, this is possible as the chip's datasheet specifies that a 5V voltage is to high. And it might be possible that the PWM part still works although the serial interface was damaged.