Stufin
Home Quick Cart Profile

M5Stack Dial - ESP32-S3 Smart Rotary Knob with 1.28" Round Touch Screen

Buy Now on Stufin

Microcontroller

ESP32-S3

Operating Frequency

2.4 GHz

Communication Protocols

Wi-Fi, Bluetooth, BLE

Touch Screen Display

1.28" Round, 240x240 pixels, Capacitive Touch

Rotary Encoder

24 detent positions, High-Resolution

Interfaces

I2C, UART, SPI

MicroSD Card Slot

Support for up to 16 GB microSD cards

Power Management

Voltage Regulator, Battery Management System

GPIO Expansion

10x GPIO pins

Operating Temperature

-20C to 80C

Dimensions

30 mm (Diameter) x 25 mm (Height)

Conclusion

The M5Stack Dial is a versatile and innovative IoT component that offers a unique blend of analog and digital interfaces. With its powerful ESP32-S3 microcontroller, high-resolution touch screen display, and precision rotary encoder, this component is ideal for a wide range of applications, from industrial automation to wearables and gaming.

Pin Configuration

  • M5Stack Dial - ESP32-S3 Smart Rotary Knob with 1.28" Round Touch Screen Pinout
  • The M5Stack Dial is a compact and feature-rich IoT component that integrates a rotary knob with a touch screen and ESP32-S3 microcontroller. This documentation provides a detailed explanation of each pin on the M5Stack Dial, along with guidance on how to connect them.
  • Pinout Structure:
  • The M5Stack Dial has a total of 24 pins, arranged in two rows of 12 pins each. The pins are labeled with a combination of numbers (1-24) and LETTERS (A, B, C, etc.). For clarity, we will refer to the pins using the number-letter combination (e.g., 1A, 2B, etc.).
  • Pinout Description:
  • 1. 1A - VCC: Positive power supply pin for the ESP32-S3 microcontroller (3.3V).
  • 2. 2A - GND: Ground pin for the ESP32-S3 microcontroller.
  • 3. 3A - SCL: I2C clock pin for communication with external devices.
  • 4. 4A - SDA: I2C data pin for communication with external devices.
  • 5. 5A - DAC1: Digital-to-Analog Converter output pin 1.
  • 6. 6A - DAC2: Digital-to-Analog Converter output pin 2.
  • 7. 7A - 3V3: Internal 3.3V power supply pin for peripherals.
  • 8. 8A - EN: Enable pin for the built-in voltage regulator (active low).
  • 9. 9A - RST: Reset pin for the ESP32-S3 microcontroller (active low).
  • 10. 10A - GPIO0: General-purpose input/output pin 0.
  • 11. 11A - GPIO1: General-purpose input/output pin 1.
  • 12. 12A - GPIO2: General-purpose input/output pin 2.
  • 13. 1B - GPIO3: General-purpose input/output pin 3.
  • 14. 2B - GPIO4: General-purpose input/output pin 4.
  • 15. 3B - GPIO5: General-purpose input/output pin 5.
  • 16. 4B - TOUCH_CS: Chip select pin for the touch screen controller.
  • 17. 5B - TOUCH_CLK: Clock pin for the touch screen controller.
  • 18. 6B - TOUCH_DIN: Data input pin for the touch screen controller.
  • 19. 7B - TOUCH_DOUT: Data output pin for the touch screen controller.
  • 20. 8B - ROTARY_CLK: Clock pin for the rotary encoder.
  • 21. 9B - ROTARY_DT: Data pin for the rotary encoder.
  • 22. 10B - ROTARY_SW: Switch pin for the rotary encoder (active low).
  • 23. 11B - LCD_CS: Chip select pin for the LCD controller.
  • 24. 12B - LCD_RST: Reset pin for the LCD controller (active low).
  • Connection Guidance:
  • When connecting the M5Stack Dial to external devices or peripherals, ensure the following:
  • Use a breadboard or PCB with a compatible pinout to avoid damaging the component.
  • Connect VCC (1A) to a 3.3V power supply or a suitable voltage regulator.
  • Connect GND (2A) to a common ground plane.
  • Use I2C communication protocols when connecting to SCL (3A) and SDA (4A) pins.
  • Use the provided power and ground pins (7A and 2A) to supply peripherals and ensure a stable operation.
  • Be cautious when handling the rotary encoder pins (20B, 21B, and 22B) to avoid mechanical damage.
  • Use the LCD pins (23B and 24B) carefully, as the LCD controller is sensitive to electrical noise.
  • By following this pinout guide and taking necessary precautions, you can successfully integrate the M5Stack Dial into your IoT project and leverage its features for advanced user interaction and control.

Code Examples

M5Stack Dial - ESP32-S3 Smart Rotary Knob with 1.28" Round Touch Screen
Overview
The M5Stack Dial is a versatile IoT component that combines a rotary knob with a 1.28" round touch screen and an ESP32-S3 microcontroller. This component is ideal for a wide range of applications, including smart home automation, industrial control, and interactive prototyping. The M5Stack Dial offers a unique combination of analog and digital interfaces, making it an excellent choice for projects that require intuitive user input and visual feedback.
Technical Specifications
Microcontroller: ESP32-S3
 Rotary Knob: 24-integer detent, 30 rotation
 Touch Screen: 1.28" round, 240x240 resolution, capacitive touch
 Communication Interfaces: Wi-Fi, Bluetooth, UART, I2C, I2S, SPI
 Power Supply: 5V DC, 500mA max
 Dimensions: 54.2mm x 54.2mm x 24.5mm
Code Examples
### Example 1: Basic Rotary Knob and Touch Screen Control
This example demonstrates how to read the rotary knob's position and use it to control the brightness of the touch screen.
```c
#include <M5Dial.h>
M5Dial dial;
void setup() {
  dial.begin();
}
void loop() {
  int knobPosition = dial.getKnobPosition();
  int brightness = map(knobPosition, 0, 24, 0, 255);
  dial.setScreenBrightness(brightness);
  delay(10);
}
```
### Example 2: Wi-Fi Remote Control using Rotary Knob and Touch Screen
This example shows how to use the rotary knob and touch screen to control a remote device over Wi-Fi.
```c
#include <M5Dial.h>
#include <WiFi.h>
M5Dial dial;
WiFiClient client;
const char ssid = "your_wifi_ssid";
const char password = "your_wifi_password";
const char remoteDeviceIP = "192.168.1.100";
void setup() {
  dial.begin();
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
  Serial.println("Connected to WiFi");
  client.setServer(remoteDeviceIP, 8080);
}
void loop() {
  int knobPosition = dial.getKnobPosition();
  String command = "rotate=" + String(knobPosition);
  client.print(command);
  client.println();
  delay(10);
if (dial.getTouch()) {
    command = "button=pressed";
    client.print(command);
    client.println();
    delay(100);
  }
}
```
### Example 3: I2C Sensor Reading and Visualization on Touch Screen
This example demonstrates how to use the M5Stack Dial to read data from an I2C sensor and display it on the touch screen.
```c
#include <M5Dial.h>
#include <Wire.h>
M5Dial dial;
Adafruit_BMP280 bmp;
void setup() {
  dial.begin();
  Wire.begin();
  if (!bmp.begin()) {
    Serial.println("Failed to initialize BMP280 sensor");
  }
}
void loop() {
  sensors_event_t event;
  bmpTemperature(&event);
  float temperature = event.temperature;
dial.fillScreen(BLACK);
  dial.setTextSize(2);
  dial.setTextColor(WHITE);
  dial.setCursor(10, 10);
  dial.print("Temperature: ");
  dial.print(temperature, 2);
  dial.print("C");
delay(1000);
}
```
These code examples demonstrate the versatility and functionality of the M5Stack Dial. Whether you're building a smart home automation system, an industrial control panel, or a interactive prototype, this component is an excellent choice for your project.