Ad Code

Responsive Advertisement

Ticker

    Loading......

How To Make DIY Mechanical 7 Segment Display using Arduino NANO & Servo Motor by WTC Zone

 How To Make DIY Mechanical 7 Segment Display using Arduino UNO & Servo Motor by WTC Zone

Creating a mechanical 7-segment display using servo motors is a creative and innovative project. Here’s how you can design this system, including the concept, parts, connections, working, and Arduino code.


Concept

A traditional 7-segment display uses LEDs to represent digits and characters. In your project, each segment will be represented by a servo motor. Each servo motor will move to 90 degrees (ON) or 0 degrees (OFF) based on whether a segment should be active or inactive for a particular digit or letter.


Parts Required

  1. Arduino Nano (1x)
    • Controls the servos and determines the digit/letter to display.
  2. Servo Motors (7x)
    • Acts as the mechanical segments of the display.
  3. Power Supply:
    • Use an external 5V power supply capable of handling all 7 servos simultaneously (e.g., 2A or higher).
  4. Jumper Wires
    • For connecting servos to the Arduino and power supply.
  5. Breadboard
    • For distributing power.
  6. Resistors (optional for pull-down circuits, if needed).

Circuit Connection

  1. Servo Connections:

    • Connect the signal pins of the 7 servo motors to Arduino digital pins (e.g., D2 to D8).
    • Connect the GND and VCC pins of all servos to the external power supply.
    • Connect the power supply GND to Arduino GND for a common ground.
  2. Power Supply:

    • Use an external 5V power supply to avoid overloading the Arduino’s regulator.
  3. Segments Mapping:

    • Map each servo motor to a segment of the 7-segment display:
      • Segment A → Servo 1 → Arduino Pin D2
      • Segment B → Servo 2 → Arduino Pin D3
      • Segment C → Servo 3 → Arduino Pin D4
      • Segment D → Servo 4 → Arduino Pin D5
      • Segment E → Servo 5 → Arduino Pin D6
      • Segment F → Servo 6 → Arduino Pin D7
      • Segment G → Servo 7 → Arduino Pin D8

Working

  1. Initialization:
    • Each servo is initialized to the "OFF" position (0 degrees).
  2. Display Logic:
    • Based on the input digit or letter, the Arduino controls which segments are ON (90 degrees) or OFF (0 degrees).
  3. Servo Movement:
    • When a segment is turned ON, the corresponding servo rotates to 90 degrees.
    • When a segment is turned OFF, the servo rotates back to 0 degrees.
  4. Satisfying Humming Sound:
    • The servos will produce a gentle humming sound during their movement, creating a satisfying mechanical effect.

Circuit Diagram

Video Link: - Click Here For Video

How To Make DIY Mechanical 7 Segment Display using Arduino UNO & Servo Motor by WTC Zone simple Circuit: -


How To Make DIY Mechanical 7 Segment Display using Arduino UNO & Servo Motor by WTC Zone Arduino Programming: -

Arduino IDE Program

Code for DIY Mechanical 7 Segment Display using Arduino UNO & Servo Motor by WTC Zone

#include <Servo.h>

// Define servo objects as an array
Servo servos[7];

// Define servo pin connections
const int segmentPins[] = {2, 3, 4, 5, 6, 7, 8};

// Define the ON and OFF positions for the servos
const int ON_POSITION = 90;  // Servo at ON position
const int OFF_POSITION = 0;  // Servo at OFF position


// Segment activation for digits (0-9) and letters
const int segmentPatterns[17][7] = {
  {1, 1, 1, 1, 1, 1, 0}, // 0
  {0, 1, 1, 0, 0, 0, 0}, // 1
  {1, 1, 0, 1, 1, 0, 1}, // 2
  {1, 1, 1, 1, 0, 0, 1}, // 3
  {0, 1, 1, 0, 0, 1, 1}, // 4
  {1, 0, 1, 1, 0, 1, 1}, // 5
  {1, 0, 1, 1, 1, 1, 1}, // 6
  {1, 1, 1, 0, 0, 0, 0}, // 7
  {1, 1, 1, 1, 1, 1, 1}, // 8
  {1, 1, 1, 1, 0, 1, 1}, // 9
  {1, 1, 1, 0, 1, 1, 1}, // A
  {0, 0, 1, 1, 1, 1, 1}, // B
  {1, 0, 0, 1, 1, 1, 0}, // C
  {0, 1, 1, 1, 1, 0, 1}, // D
  {1, 0, 0, 1, 1, 1, 1}, // E
  {1, 0, 0, 0, 1, 1, 1}, // F
  {1, 0, 1, 1, 1, 1, 0}  // G
};

void setup() {
  // Attach servos to pins
  for (int i = 0; i < 7; i++) {
    servos[i].attach(segmentPins[i]);
    servos[i].write(OFF_POSITION); // Initialize all servos to OFF position
  }
  delay(1000); // Wait for 1 second before starting
}

void loop() {
  // Display numbers (0-9)
  for (int i = 0; i <= 9; i++) {
    displayCharacter(i);
    delay(2000); // Wait 2 second
  }

  // Display letters (A-F)
  for (int i = 10; i <= 15; i++) {
    displayCharacter(i);
    delay(2000); // Wait 2 second
  }
}

// Function to display a character (digit or letter)
void displayCharacter(int index) {
  for (int i = 0; i < 7; i++) {
    if (segmentPatterns[index][i] == 1) {
      servos[i].write(ON_POSITION);  // Turn segment ON
    } else {
      servos[i].write(OFF_POSITION); // Turn segment OFF
    }
  }
}

-----------------------------------------------------------------------------------------------------------------------------

Explanation of the project

  1. Segment Patterns for Letters:

    • The segmentPatterns array now includes configurations for numbers (0-9) and letters (A-F).
    • These letters are based on common 7-segment display configurations, which use limited segments to form recognizable characters.
  2. Loop for Letters:

    • After displaying numbers (0-9), the program moves on to display letters (A-F).
  3. Dynamic Display:

    • The displayCharacter() function is used to control the servos based on the segment pattern for the current character.

Working of the Project

  1. Hardware Setup:

    • Connect each servo to its respective segment pin (as per the segmentPins array).
    • Use external power if needed to handle the power requirements of the 7 servos.
  2. Execution:

    • The program initializes all servos to the OFF position (0°).
    • In the loop(), it cycles through numbers (0-9) and letters (A-F), activating the required segments (servos) for each character.
    • The servo angles change smoothly, and you can hear the "humming" sound as they move.
  3. Satisfying Display:

    • The sequential motion of servos simulates a mechanical 7-segment display.
    • The dynamic movement adds a creative and unique twist compared to traditional LED-based displays.

Circuit Connection

  1. Components:

    • Arduino Uno
    • 7 x Servo Motors
    • Connecting Wires
    • External Power Supply (if needed, as Arduino's 5V pin may not provide sufficient current for all servos).
  2. Connections:

    • Connect servo signal wires to pins 2-8 (as defined in segmentPins).
    • Power the servos with the Arduino's 5V and GND (or an external power source with shared GND).
    • Ensure the potentiometer can handle the servo's current requirements if external power is used.

Demonstration

  • Once powered, the servos will move to form the shapes of numbers (0-9) and letters (A-F) sequentially.
  • The transition of servo angles (90° for ON, 0° for OFF) creates a pleasing mechanical effect.

Let me know if you need further help refining or customizing the project! 😊


Share, Support, and Subscribe!!! 1. PRO KAM EXPLAINED 2. Knowledge KAM 3. PRO KAM Follow us on 1. Facebook 2. Instagram 3. Pinterest 4. Blogspot 5 Twitter If you have any other ideas to make me design, you can describe them in the comment section and if I can, I will make a designing video on it. So I am waiting #prokam #wtc #Arduino #ideas #projects #diy #how #to #ArduinoProjects #UltrasonicSensor #HeightMeasurement #TechDIY #WeTechCreators #wtczone

Post a Comment

0 Comments

Ad Code

Responsive Advertisement