Giter Site home page Giter Site logo

jonas-merkle / as5047p Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 10.0 1.09 MB

An Arduino library for the AS5047P high-resolution rotary position sensor. Supporting also the following sensor types: AS5047D, AS5147, AS5147P, AS5247

Home Page: https://github.com/jonas-merkle/AS5047P

License: GNU General Public License v3.0

C++ 100.00%
arduino-library as5047p spi sensor rotary-encoder high-resolution rotary-position-sensor as5x47 as5047d as5147

as5047p's Introduction

AS5047P - Arduino Library

GitHub Workflow Status (with branch) GitHub Workflow Status (with branch) GitHub release (latest by date) GitHub GitHub issues GitHub pull requests Maintenance

tl;dr

An Arduino library for the AS5047P high-resolution rotary position sensor. Supporting also the following sensor types: AS5047D, AS5147, AS5147P, AS5247

Contents

Supported Sensors

The following sensors of the AS5x47 series of rotary potion sensors are supported by this library:

You can get the AS5047P sensor preinstalled on a breakout board here.

Not supported are the following sensors:

Documentation

Documentation Deployment Status: GitHub deployments

Branch Link
Master Documentation
Develop Documentation

How to install this library

Install the library via the Arduino Library Manager

The easiest way to install this library is to use the build in Arduino Library Manager. Just search for AS5047P an install the latest version available. You can also upgrade the library to the newest release via the Arduino Library Manager. For detailed information please read the section Using the Library Manager of this tutorial. (Pleas keep in mind you need at least version 1.6.2 of the Arduino IDE in order to use the Arduino Library Manager)

Manually install a Arduino library

You can download the latest version of this library here as a zip file and follow the section Importing a .zip Library or Manual installation of this tutorial about How to Install a Library.

Install the library via the PlattformIO Library Manager

You can find this library here in the PlattformIO Library Manager. To add this library to your plattformIO project you can either use the library manager ui and search for this library or you can use the following platform io cli command: pio lib install "jonas-merkle/AS5047P"

How to connect the AS5047P to your Arduino

Connect to an Arduino Uno

AS5047P Pin Arduino Uno Pin Comment
GND GND -
VDD 5V -
VDD3V NC -
MOSI MOSI (Pin: 11) -
MISO MISO (Pin: 12) -
CLK SCK (Pin: 13) -
CSn 9 Can be any unused digital pin on the arduino as long as it's configured here AS5047P as5047p(<ChipSelectPort>);

Connect to an Arduino Mega

AS5047P Pin Arduino Mega Pin Comment
GND GND -
VDD 5V -
VDD3V NC -
MOSI MOSI (Pin: 51) -
MISO MISO (Pin: 50) -
CLK SCK (Pin: 52) -
CSn 9 Can be any unused digital pin on the arduino as long as it's configured here AS5047P as5047p(<ChipSelectPort>);

Connect to an Adafruit Feather M0

AS5047P Pin Adafruit Feather M0 Pin Comment
GND GND -
VDD 3V -
VDD3V 3V -
MOSI MOSI -
MISO MISO -
CLK SCK -
CSn 9 Can be any unused digital pin on the arduino as long as it's configured here AS5047P as5047p(<ChipSelectPort>);

Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Adafruit Feather M0 board!

Connect to Teensy Board

Connect to a Teensy 3.5

AS5047P Pin Teensy Pin Comment
GND GND -
VDD 3V -
VDD3V 3V -
MOSI MOSI0 (Pin: 11) -
MISO MISO0 (Pin: 12) -
CLK SCK0 (Pin: 13) -
CSn CS0 (Pin: 10) Can be any unused digital pin on the teensy as long as it's configured here AS5047P as5047p(<ChipSelectPort>);

Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!

Connect to a Teensy 3.6

AS5047P Pin Teensy Pin Comment
GND GND -
VDD 3V -
VDD3V 3V -
MOSI MOSI0 (Pin: 11) -
MISO MISO0 (Pin: 12) -
CLK SCK0 (Pin: 13) -
CSn CS0 (Pin: 10) Can be any unused digital pin on the teensy as long as it's configured here AS5047P as5047p(<ChipSelectPort>);

Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!

Connect to a Teensy 4.0

AS5047P Pin Teensy Pin Comment
GND GND -
VDD 3V -
VDD3V 3V -
MOSI MOSI (Pin: 11) -
MISO MISO (Pin: 12) -
CLK SCK (Pin: 13) -
CSn CS (Pin: 10) Can be any unused digital pin on the teensy as long as it's configured here AS5047P as5047p(<ChipSelectPort>);

Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!

Connect to a Teensy 4.1

AS5047P Pin Teensy Pin Comment
GND GND -
VDD 3V -
VDD3V 3V -
MOSI MOSI (Pin: 11) -
MISO MISO (Pin: 12) -
CLK SCK (Pin: 13) -
CSn CS (Pin: 10) Can be any unused digital pin on the teensy as long as it's configured here AS5047P as5047p(<ChipSelectPort>);

Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!

Project Status & ToDo's

Status Task / ToDo
Read functions for all registers implemented.
Doxygen comments added.
BasicReadAngle.ino successfully tested on an Arduino Mega & Adafruit Feather M0
BasicReadAngleAndDebugInfo.ino successfully tested on an Arduino Mega & Adafruit Feather M0
PrintAllSettings.ino successfully tested on an Arduino Mega & Adafruit Feather M0
Adding a CI pipline.
Build & deploy doxygen documentation for the library.
Sensor status output as string.
keywords.txt updated for main library functions.
Switch to unions...
Write functions for all registers implemented.
Parity check on incoming data.
Improve initSPI()
ToString() for Error_t
Adding Library to Arduino Library Manager 🥳
Adding Library to PlattformIO Library Manager 🥳
Documentation update.
keywords.txt updated for all library functions.
🚧 Readme.md update.
🚧 Test of all wirte functions
🚧 Test of all read functions
Porting the library to be compatible with the STM32 HAL
Additional examples.
Unit Tests?!
Implementation & test of programming the one time programmable register of the AS5047P.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.