Celebrating Eid Milad-un-Nabi (ﷺ) with Tech & Creativity 🌙✨

“Tech Meets Tradition: Arduino Project for Eid Milad-un-Nabi (ﷺ)”


OVERVIEW

This year, I decided to celebrate Eid Milad-un-Nabi (ﷺ) in a unique way by fusing my love of technology with my religious beliefs.    I made a simple project to spread the love, kindness, and peace of the Prophet Muhammad (ﷺ) using an Arduino, LEDs, and an OLED display.

 The idea behind the project

The idea was to have the LEDs flash wildly on a happy night, to put it simply.
"Happy Eid Milad-un-Nabi (ﷺ) to you and your family on your 1500th anniversary" should appear on the OLED display in the style of a typewriter.
In this sense, the project not only conveys beauty but also a warm greeting.

Components utilized

 1) The ESP32 Board
 2) Seven 220 ohm resistors
 3) OLED Display with I2C
 4) A breadboard and jumper wires
 5) Seven LEDs 

 How It Operates

 The LEDs blink in a pattern to create a festive atmosphere.
The greeting is typed out on the OLED display, one letter at a time (much like typing on a screen).
The message is separated into the following lines for readability: "Milad-un-Nabi (ﷺ)" "To you, Mubarak" "And your family."

Code for Esp 32 

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

// OLED setup
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// LED setup (use pins you connected)
int ledPins[] = {12, 13, 14, 25, 26, 27, 32};
int numLeds = 7;

// Messages (multi-line supported)
const char* messages[][2] = {
  {"1500th Year", ""},
  {"Eid Milad-un-Nabi", "(ﷺ)"},
  {"Mubarak to you", "And your family"}
};
int messageCount = 3;

void setup() {
  Wire.begin(21, 22); // SDA = 21, SCL = 22 (ESP32 default)

  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3D)) {
      for (;;); // stop if OLED not found
    }
  }

  display.clearDisplay();
  display.display();

  for (int i = 0; i < numLeds; i++) {
    pinMode(ledPins[i], OUTPUT);
  }

  randomSeed(analogRead(0));
}

void loop() {
  for (int msg = 0; msg < messageCount; msg++) {
    typeMessage(messages[msg][0], messages[msg][1]);  // OLED typing
    festiveShow();                                    // LED show
    delay(1200);
    display.clearDisplay();
  }
}

// === OLED Typewriter Effect ===
void typeMessage(const char* line1, const char* line2) {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);

  // First line typing
  for (int i = 0; line1[i] != '\0'; i++) {
    display.clearDisplay();
    display.setCursor(5, 20);
    for (int j = 0; j <= i; j++) {
      display.print(line1[j]);
    }
    display.display();
    delay(120);
  }

  // Second line typing
  if (strlen(line2) > 0) {
    for (int i = 0; line2[i] != '\0'; i++) {
      display.clearDisplay();
      display.setCursor(5, 20);
      display.println(line1); // keep first line
      display.setCursor(5, 40);
      for (int j = 0; j <= i; j++) {
        display.print(line2[j]);
      }
      display.display();
      delay(120);
    }
  }
}

// === LED Festive Show ===
void festiveShow() {
  wavePattern();
  burstPattern();
  twinklePattern();
}

void wavePattern() {
  for (int i = 0; i < numLeds; i++) {
    digitalWrite(ledPins[i], HIGH);
    delay(60);
    digitalWrite(ledPins[i], LOW);
  }
  for (int i = numLeds - 1; i >= 0; i--) {
    digitalWrite(ledPins[i], HIGH);
    delay(60);
    digitalWrite(ledPins[i], LOW);
  }
}

void burstPattern() {
  for (int k = 0; k < 3; k++) {
    for (int i = 0; i < numLeds; i++) digitalWrite(ledPins[i], HIGH);
    delay(150);
    for (int i = 0; i < numLeds; i++) digitalWrite(ledPins[i], LOW);
    delay(150);
  }
}

void twinklePattern() {
  for (int k = 0; k < 15; k++) {
    int led = random(numLeds);
    digitalWrite(ledPins[led], HIGH);
    delay(100);
    digitalWrite(ledPins[led], LOW);
  }
}

The Significance of This Project

 For me, it's more than just electronics.   It has to do with using technology to express spirituality.   With our knowledge, creativity, and ingenuity, we can reflect the light that the Prophet Muhammad (ﷺ) brought 1500 years ago.

Concluding

  This project taught me that technology isn't only for labs and companies; it can also be used to express beliefs, celebrate traditions, and spread optimism.

 Happy Eid Milad-un-Nabi (ﷺ) to you and your family! 🌸

Setup and Output 





Comments