Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Battery-Powered MIDI Controller with nRF52840, AS5600 Encoders, and OLED Display

View and Edit Project In Cirkit DesignerImage of Battery-Powered MIDI Controller with nRF52840, AS5600 Encoders, and OLED Display

Circuit Documentation

Summary

This circuit is a MIDI Controller that utilizes an nRF52840 ProMicro microcontroller, multiple AS5600 magnetic encoders, an Adafruit TCA9548A I2C multiplexer, a 128x64 OLED display, and several pushbuttons. The circuit reads the position of the magnetic encoders and displays text on the OLED screen based on the rotation of each encoder. It also handles button presses to send MIDI signals.

Component List

  1. AS5600 Magnetic Encoder

    • Description: Magnetic rotary position sensor.
    • Pins: DIR, SCL, SDA, GP0, VCC, OUT, GND
  2. nRF52840 ProMicro

    • Description: Microcontroller board based on the nRF52840 SoC.
    • Pins: B+, RAW, GND, RST, VCC, 31, 29, 2, 115, 113, 111, 10, 600, B-, 6, 8, 17, 20, 22, 24, 100, 11, 104, 106, 107, 102, 101
  3. Pushbutton

    • Description: Simple pushbutton switch.
    • Pins: Pin 2, Pin 1, Pin 3, Pin 4
  4. Resistor

    • Description: 10k Ohm resistor.
    • Pins: pin1, pin2
    • Properties: Resistance: 10k Ohms
  5. 2000mAh Battery

    • Description: Power source for the circuit.
    • Pins: VCC, GND
  6. 128x64 OLED Display (I2C IIC SPI Serial)

    • Description: OLED display for visual output.
    • Pins: GND, SDA, SCL, VCC
  7. Adafruit TCA9548A

    • Description: I2C multiplexer.
    • Pins: 2SDA, 2SCL, 3SDA, 3SCL, 4SDA, 4SCL, 5SDA, 5SCL, 6SDA, 6SCL, 7SDA, 7SCL, VCC, GND, INPUTSDA, INPUTSCL, RESET, A0, A1, A2, 0SDA, 0SCL, 1SDA, 1SCL

Wiring Details

AS5600 Magnetic Encoder

nRF52840 ProMicro

Pushbutton

Resistor

2000mAh Battery

128x64 OLED Display (I2C IIC SPI Serial)

Adafruit TCA9548A

Code Documentation

nRF52840 ProMicro Code

/*
 * MIDI Controller using nRF52840 ProMicro, AS5600 Encoders, TCA9548A I2C Mux,
 * 0.96" OLED Display, and 4 Push Buttons.
 *
 * This code reads the position of four AS5600 magnetic encoders and displays
 * text on the OLED screen based on the rotation of each encoder. It also
 * handles button presses to send MIDI signals.
 */

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_TCA9548A.h>
#include <MIDI.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET