ESP8266 NodeMCU Project – Imperial March Ringtone Play in ESP8266

Pr-request to study first

  • Pulse With Modulation
  • ESP8266 NodeMCU Module – PWM

First Watch the Video Demonstration


What is RRTL?

  • Ring Tone Text Transfer Language (RTTTL) was developed by Nokia.
  • The RTTTL format is a string divided into three sections:
    • Name
    • Default value and
    • Data.
  • See More

Imperial March Music (Hear)

  • The Imperial March (Darth Vader’s Theme) is a musical theme present in the Star Wars franchise.
  • It was composed by John Williams for the film Star Wars: The Empire Strikes Back.

What is PWM

PWM in ESP8266

  • ESP8266 have four PWM.
  • Only 6 pins can be set to PWM mode at the most, if use NodeMCU Firmware

Note : Your NodeMCU firmware should have PWM Module library functions.

Required Hardware and Software Tools


ESP8266 with Buzzer Connection Diagram

NodeMCU Lua code


Follow steps

  • Connect the circuit as per the connection diagram
  • Save the above code as “AEW_RRTL_Buzzer.lua”
  • Open ESPlorer and upload the file “AEW_RRTL_Buzzer.lua”
  • Run the file  [ dofile(“AEW_RRTL_Buzzer.lua”) ]
  • Done.! Enjoy!! (Hear Imperial_march RTTL ringtone)



  • True Credits –  Arduino sketch by Andre Tagliati
  • Additional Credits – Lua code By Andres Reischle

Next :

Previous :


2 thoughts on “ESP8266 NodeMCU Project – Imperial March Ringtone Play in ESP8266”

  1. Came across your website by accident, this code is exactly what I have been looking for, for an alarm project I have been working on, thanks.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

if you have any queries call us +918300026060 or WhatsApp Dismiss


Your Cart

%d bloggers like this: