Arduino Project Metal Identification Display
Arduino Project Metal Identification Display
Introduction
This project is designed to use an Arduino UNO with an I2C LCD display and six push
buttons. Each button corresponds to a metal and displays the metal's name along with its
thermal conductivity value. When a button is pressed, the LCD screen shows the respective
metal's information.
Components
The components required for this project are:
- Arduino UNO
- I2C LCD Display (16x2)
- 6 Push Buttons
- Jumper Wires
- Breadboard
Code Explanation
The code initializes the LCD with the I2C address (0x27 in this case), defines each button’s
pin, and sets them as input pins with internal pull-up resistors enabled. In the loop function,
each button is checked for a LOW signal (indicating it’s pressed), which triggers the LCD to
display the metal's name and its thermal conductivity value. A small delay is added for
debounce.
Button Functionality
Each button displays a different metal name along with its thermal conductivity (in
W/m·K):
Arduino Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
void setup() {
lcd.begin(16, 2); // Initialize with 16 columns and 2 rows
lcd.backlight(); // Turn on the backlight
void loop() {
// Check button states
if (digitalRead(button1Pin) == LOW) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("TITANIUM_22");
delay(500); // Debounce delay
} else if (digitalRead(button2Pin) == LOW) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("STEEL_50");
delay(500); // Debounce delay
} else if (digitalRead(button3Pin) == LOW) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("BRASS_109");
delay(500); // Debounce delay
} else if (digitalRead(button4Pin) == LOW) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("GOLD_315");
delay(500); // Debounce delay
} else if (digitalRead(button5Pin) == LOW) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("COPPER_385");
delay(500); // Debounce delay
} else if (digitalRead(button6Pin) == LOW) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("SILVER_407");
delay(500); // Debounce delay
}
}
Conclusion
This project demonstrates how to interface an Arduino with an I2C LCD display and use
multiple push buttons to trigger different display outputs. It serves as a practical example of
how simple components can be combined to create interactive educational tools for
learning material properties.