Arduino Project: Metal Identification with Thermal Conductivity 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):
- Button 1: Displays 'TITANIUM_22'
- Button 2: Displays 'STEEL_50'
- Button 3: Displays 'BRASS_109'
- Button 4: Displays 'GOLD_315'
- Button 5: Displays 'COPPER_385'
- Button 6: Displays 'SILVER_407'
Arduino Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Initialize the display with I2C address (usually 0x27 or 0x3F)
LiquidCrystal_I2C lcd(0x27, 16, 2); // 16 columns and 2 rows
// Define button pins
const int button1Pin = 2;
const int button2Pin = 3;
const int button3Pin = 4;
const int button4Pin = 5;
const int button5Pin = 6;
const int button6Pin = 7;
void setup() {
lcd.begin(16, 2); // Initialize with 16 columns and 2 rows
lcd.backlight(); // Turn on the backlight
// Set button pins as input with pull-up resistors
pinMode(button1Pin, INPUT_PULLUP);
pinMode(button2Pin, INPUT_PULLUP);
pinMode(button3Pin, INPUT_PULLUP);
pinMode(button4Pin, INPUT_PULLUP);
pinMode(button5Pin, INPUT_PULLUP);
pinMode(button6Pin, INPUT_PULLUP);
}
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.