Music Player or MP3 Player with Scrolling Display
The Music Player with Scrolling Display project combines an Arduino, a simple keypad, an LCD, and a buzzer to create a unique music-playing experience.
The system reads inputs from the keypad to select and play predefined music tracks, and a scrolling display showcases the current playing track.
Component List:
Name | Quantity | Component |
---|---|---|
U1 | 1 | Arduino Uno R3 |
U2 | 1 | LCD 16 x 2 |
R1 | 1 | 220 Ω Resistor |
PIEZO1 | 1 | Piezo |
S1 | 1 | Slideswitch |
R3 | 1 | 1 kΩ Resistor |
The circuit consists of a keypad (connected to pins 2-9) for track selection, a buzzer (connected to pin 7) for audio output, and an LCD (connected to pins 8-13) for displaying the current track name.
A resistor network may be included for voltage division. The LCD utilizes custom characters to represent a play icon and track details.
Arduino Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
byte b[8] = {
B00001,
B00101,
B10111,
B10111,
B11111,
B11111,
B11111,
B11111
};
byte f[8] = {
B10001,
B10101,
B10111,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte c[8] = {
B10000,
B10101,
B11101,
B11111,
B11111,
B11111,
B11111,
B11111
};
byte d[8] = {
B10010,
B10110,
B10111,
B11111,
B11111,
B11111,
B11111,
B11111
};
void setup() {
pinMode(6, INPUT);
lcd.begin(16, 2);
lcd.setCursor(6,0);
lcd.print("Play ");
lcd.setCursor(3,1);
lcd.print("<| "); lcd.setCursor(7,1); lcd.print("|| |> ");
delay (1000);
}
void loop() {
if(digitalRead(6)) {
tone (7,120, 500);
delay (500);
lcd.setCursor(0,0);
lcd.print(" NP: Nothing-Bruno Major");
lcd.scrollDisplayLeft();
lcd.createChar(0,b); lcd.createChar(0,f); lcd.setCursor(0, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,f); lcd.setCursor(1, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,f); lcd.setCursor(2, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,f); lcd.setCursor(3, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,f); lcd.setCursor(4, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,f); lcd.setCursor(5, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,f); lcd.setCursor(6, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,f); lcd.setCursor(7, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,f); lcd.setCursor(8, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,f); lcd.setCursor(9, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(10, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(11, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(12, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(13, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(14, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(15, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(16, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(17, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(18, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,c); lcd.setCursor(19, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(20, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(21, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(22, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(23, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(24, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(25, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(26, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(27, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(28, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(29, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(30, 1); lcd.write(byte(0)); lcd.noBlink();
lcd.createChar(0,d); lcd.setCursor(31, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(32, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(33, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(34, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(35, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(36, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(37, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(38, 1); lcd.write(byte(0)); lcd.noBlink(); lcd.createChar(0,d); lcd.setCursor(39, 1); lcd.write(byte(0)); lcd.noBlink();
}
else {
lcd.clear();
}
delay(0);
}
This project provides an interactive way to enjoy music using Arduino. The keypad allows easy navigation through tracks, and the scrolling display enhances the user experience.
It’s a creative implementation that showcases the versatility of Arduino in combining hardware components for entertainment purposes.
The circuit can be expanded with additional features like volume control, track skipping, or playlist management. This Music Player with Scrolling Display serves as an engaging and educational introduction to Arduino-based projects, fostering a deeper understanding of coding, electronics, and system integration.