/mp-as5600

Micropython project linking an ESP32-C3 to an AS5600 magnetic rotary position sensor

Primary LanguagePythonMIT LicenseMIT

MP-AS5600

Micropython project linking an ESP32-C3 to an AS5600 magnetic rotary position sensor

Image of working breadboard

alt text

Hardware

Wiring

  • ESP32-C3-DevKitC-02
    • 3V3 -> Breadboard + rail
    • GND -> Breadboard - rail
    • GPIO 9 -> Breadboard Row 22
    • GPIO 8 -> Breadboard Row 23
    • 5V -> Servo Red
    • GND -> Servo Black
    • GPIO 0 -> Servo PWM
  • SSD1306 OLED display
    • Breadboard + rail -> VCC
    • Breadboard - rail -> GND
    • Breadboard Row 22 -> SSD1306 SDA
    • Breadboard Row 23 -> SSD1306 SCL
  • AS5600 breakout board
    • Breadboard + rail -> VCC
    • Breadboard - rail -> GND
    • Breadboard Row 22 -> AS5600 SDA
    • Breadboard Row 23 -> AS5600 SCL

Software

Deployment instructions

  • Install Micropython on the ESP32-C3-DevKitC-02
  • Copy all files in /src to the ESP32-C3-DevKitC-02
cd src/

# Make directory structure on the ESP32-C3-DevKitC-02 matching the directory structure of src
find . -type d | grep -v '^\.$' | sed 's;\./;;' | while read dir; do mpremote mkdir :$dir; done
mkdir :lib

# Copy files in src to the ESP32-C3-DevKitC-02
find . -type f | grep -v '^\.$' | sed 's;\./;;' | while read file; do mpremote cp $file :$file; done