Giveaway!

Edit: Thanks for all the comments, some brilliant ideas. If we could send one to everyone we would but unfortunately we only have three. We'll be sending them out soon.

We’ve recently made up a batch of the angle sensor boards described below, leave a comment if you’d like one of them. We’ll send a few populated boards to whoever has the best use for them. We’ll even include a magnet or two.

Introduction

When dealing with motors or actuators it’s often useful to have some sort of rotational feedback. This is usually accomplished by mounting a rotary encoder on the motor, either an absolute or incremental encoder. We wanted a very accurate absolute encoder to use in our system and ended up with the AS5048 angle sensor.

The AS5048 is a chip from Austria Microsystems (AMS) which can sense angular position using a magnet. This means that by mounting a small magnet on the end of a shaft it’s possible to get a precise measurement of the current shaft angle. Although AMS produces a range of these sensors, we’re currently using the version with 14-bit resolution giving an absolute accuracy of around 0.05 degrees!

Our library for interfacing with the SPI chip is available on our github.

The Problem

The chip is provided in a TSSOP package which needs to be mounted close to the magnet and aligned fairly carefully. To make this easier, we designed a break-out board that also includes some LEDs to allow for simpler alignment.

To avoid having to set up the control system (Arduino in our case) before mounting the sensor, there’s an ATTiny micro included on the board. When the switch is set to debug mode and power is applied, the AVR queries the angle sensor and checks error conditions, lighting the corresponding LEDs if the sensor is too close to the magnet, too far away from the magnet and if a magnetic field is detected. This allows you to position the sensor correctly without worrying about programming new firmware etc.

The PCB

The board also includes a header breaking out the chip’s SPI pins so the sensor can be used as a normal SPI sensor too.

After a couple of prototypes everything was working well so we sent the designs off to dirty PCBs in China. A few weeks later we received our boards and soldered a few together. It’s somewhat difficult to evaluate the quality of the boards with a black soldermask but they seem to all be fairly well produced. The silkscreen is a little hard to read in places but given the size of the text we can’t really complain. Here’s a photo of what we received from China:

They’re working nicely now! You can see an assembled version at the top.

The board is open source, kicad files are available on our github along with the arduino code being used on the ATtiny44. There is a jumper on the board to select a 3.3V supply, this won’t be populated on the boards we send out so remember to throw a 0 Ohm resistor in there if you’re using 3.3V. The schematic is shown below:

Conclusion

The PCB is very handy when aligning your sensors and is useful purely as a breakout board if your sensor can't be directly next to your microcontroller. Hopefully others will find them as useful as us!

Download