OTHERS

Smart Mirror Arduino Project

The Smart Mirror Arduino project combines technology and everyday utility, transforming a conventional mirror into an interactive and informative display. This innovative project utilizes an Arduino board, a Liquid Crystal Display (LCD), a NeoPixel LED strip, and a microphone button to create a versatile Smart Mirror.

Upon startup, the mirror showcases a dynamic “Starting Up” message on the LCD while activating a captivating LED strip to mimic the boot-up experience.

The project allows users to input messages through a simulated app interface, displaying them on the mirror’s surface. The mirror intelligently handles longer messages by scrolling them for visibility.

Component List:

NameQuantityComponent
U11Arduino Uno R3
LEDLED Strip1NeoPixel Strip 4
PIEZOSpeaker
PIEZOMicrophone
2Piezo
UDisplay1LCD 16 x 2
SMicrophone Button1Pushbutton
R11220 Ω Resistor
R2
R3
R4
31 kΩ Resistor

The Smart Mirror further simulates a microphone function through a button press, providing an interactive element. The microphone function prompts the mirror to display a “Microphone Active” status and awaits text input, offering a glimpse into voice-activated possibilities.

After receiving a message, the mirror sends a visually engaging LED notification and prints the message on the display, enhancing user interaction.

A simplified circuit involves connecting the Arduino board to the LCD, NeoPixel LED strip, and a microphone button. The LCD provides visual output, the NeoPixel LED strip adds dynamic lighting effects, and the microphone button simulates voice interaction.

Wiring and connections may vary based on specific components used, but this basic setup forms the foundation for a Smart Mirror that blends practicality with technology.

Arduino code for Smart Mirror Project:

#include <LiquidCrystal.h>
#include <Adafruit_NeoPixel.h>
LiquidCrystal LCD(12, 11, 5, 4, 3, 2);
int numRows = 2;
int numCols = 16;
define PIN 9
define NUMPIXELS 4
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
const int Microphone_Button = 7;
String message;
String Sent_Message;
String Reply_Message;
void setup() {
Serial.begin(9600);
pixels.begin();
LCD.begin(16, 2);
pinMode(Microphone_Button, INPUT);
Start_Up();
}
void loop() {
Activate_Messenger();
delay(2000);
LCD.clear();
if (digitalRead(Microphone_Button) == 1) {
Serial.println("Microphone Button pressed");
Activate_Microphone();
}
}
void Start_Up() {
LCD.setCursor(2, 0);
LCD.print("Starting Up");
LCD.setCursor(2, 1);
LCD.print("Smart Mirror");
Activate_LEDStrip();
delay(5000);
DeActivate_LEDStrip();
LCD.clear();
}
void Activate_LEDStrip() {
for (int i = 0; i < 4; i++) {
pixels.setPixelColor(i, pixels.Color(100, 180, 160));
pixels.show();
delay(100);
}
}
void DeActivate_LEDStrip() {
for (int i = 0; i < 4; i++) {
pixels.setPixelColor(i, pixels.Color(0, 0, 0));
pixels.show();
delay(100);
}
}
void Activate_Messenger() {
if (Serial.available()) {
char letter = Serial.read();
if (letter == 'm') {
Sent_Message = Input_Message();
Print_Text(Sent_Message);
Activate_LEDStrip();
}
else if (letter == 'p') { Serial.println("Last Message was:"); Serial.println(Sent_Message); }
}
}
String Input_Message() {
Serial.println("Enter Message:");
while (Serial.available() == 0) {
}
message = Serial.readString();
Serial.println("The message is:");
Serial.println(message);
return message;
}
void Print_Text(String text) {
int Message_Length = text.length();
if (Message_Length < numCols) {
LCD.print(text);
}
else {
int pos;
for (pos = 0; pos < numCols; pos++) {
LCD.print(text[pos]);
}
delay(1000); while (pos < Message_Length) { LCD.scrollDisplayLeft(); LCD.print(text[pos]); pos = pos + 1; delay(300); }
}
}
void Activate_Microphone() {
LCD.setCursor(3, 0);
LCD.print("Microphone");
LCD.setCursor(5, 1);
LCD.print("Active");
Reply_Message = Input_Message();
LCD.clear();
LCD.setCursor(4, 0);
LCD.print("Sending");
LCD.setCursor(4, 1);
LCD.print("Message");
delay(2600);
LCD.clear();
Print_Text(Reply_Message);
delay(1000);
LCD.clear();
LCD.setCursor(4, 0);
LCD.print("Message");
LCD.setCursor(6, 1);
LCD.print("Sent");
DeActivate_LEDStrip();
}

This Arduino-based Smart Mirror project showcases the integration of hardware components to elevate a traditional mirror’s functionality. Its versatility in displaying messages and simulating interactive features demonstrates the potential for further developments in smart home technology.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button