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

Arduino UNO R4 WiFi Controlled Potentiometer Level Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO R4 WiFi Controlled Potentiometer Level Display

Circuit Documentation

Summary

The circuit in question is designed to interface a TM1651 display driver with an Arduino UNO R4 WiFi microcontroller and a potentiometer. The TM1651 is used to display levels that correspond to the analog value read from the potentiometer. The Arduino UNO R4 WiFi is the central processing unit of the circuit, reading the potentiometer value, processing it, and then sending the appropriate commands to the TM1651 to update the display.

Component List

YY (TM1651 Display Driver)

Arduino UNO R4 WiFi

Potentiometer

Wiring Details

YY (TM1651 Display Driver)

Arduino UNO R4 WiFi

Potentiometer

Documented Code

#include "TM1651.h"

#define CLK 3       // TM1651's CLK pin
#define DIO 2       // TM1651's DIO pin
#define POT_PIN A0  // Potentiometer's analog pin

TM1651 batteryDisplay(CLK, DIO);

void setup() {
  batteryDisplay.init();               // Initialize TM1651
  batteryDisplay.set(BRIGHTEST);       // Set display brightness
}

void loop() {
  int potValue = analogRead(POT_PIN);  // Read the potentiometer value (0-1023)

  // Convert the potentiometer value from 0-1023 to a level from 0-7
  int displayLevel = map(potValue, 0, 1023, 0, 7);

  // Display the converted level on the TM1651
  batteryDisplay.displayLevel(displayLevel);

  delay(100);  // Delay for update interval
}

The code is written for the Arduino UNO R4 WiFi and is responsible for initializing the TM1651 display driver, reading the analog value from the potentiometer, converting this value to a display level, and updating the TM1651 display accordingly. The delay(100) function call ensures that the display updates at a reasonable interval.