Arduino Smart Classroom Series: Lab Equipment Usage Tracker
Arduino Smart Classroom Series: Lab Equipment Usage Tracker|Smart Home|Equipment
Welcome to the Arduino Smart Classroom Series! 🏫 In this project, we will build a Lab Equipment Usage Tracker that monitors and logs the usage of lab devices. Using EEPROM, SD card, RTC, LCD, and buttons, you can track equipment usage for classroom management. This is perfect for educators, makers, and students aiming to automate lab monitoring.
Table of Contents
- Introduction
- Required Hardware
- Arduino IDE Setup
- Wiring the Components
- Arduino Code
- How It Works
- Testing Your Project
- Advanced Modifications
- Common Issues and Troubleshooting
- Learning Insights
- Next Project Teaser
- Conclusion
1. Introduction
The Lab Equipment Usage Tracker helps monitor which lab devices are being used, when they were turned on/off, and for how long. This data is stored in EEPROM and logged weekly to an SD card for record-keeping. A 16x2 LCD displays real-time status, while buttons control the devices. A RTC module timestamps each action, enabling accurate usage tracking.
This project is highly scalable: you can add more equipment, integrate Wi-Fi notifications, or even automate reports. It's designed for classrooms, labs, or any shared workspace where tracking usage is important.
2. Required Hardware
- Arduino Uno (~₹500)
- 3 Push Buttons (~₹50)
- 3 LEDs or Relay Modules for equipment (~₹150)
- 16x2 I2C LCD (~₹200)
- RTC Module DS3231 (~₹150)
- SD Card Module (~₹250)
- SD Card (~₹100)
- Resistors 220Ω (~₹20)
- Jumper Wires & Breadboard (~₹100)
- Power supply 5V (~₹100)
3. Arduino IDE Setup
- Install Arduino IDE.
- Connect Arduino via USB.
- Select Board → Arduino Uno.
- Select COM port → (your Arduino port).
- Install libraries via Library Manager: Wire.h, RTClib.h, SD.h, EEPROM.h, LiquidCrystal_I2C.h.
4. Wiring the Components
Wire all components carefully:
- Button 1 → D2, Button 2 → D3, Button 3 → D4 (with pull-down resistors)
- LED 1 → D5, LED 2 → D6, LED 3 → D7 (simulate equipment)
- LCD SDA → A4, SCL → A5, VCC → 5V, GND → GND
- RTC SDA → A4, SCL → A5, VCC → 5V, GND → GND
- SD Module CS → D10, MOSI → D11, MISO → D12, SCK → D13, VCC → 5V, GND → GND
5. Arduino Code
Upload this code to your Arduino. It tracks button presses, toggles equipment states, logs usage with timestamps, saves weekly to SD, and displays status on LCD.
#include <Wire.h> #include <RTClib.h> #include <EEPROM.h> #include <SD.h> #include <SPI.h> #include <LiquidCrystal_I2C.h> RTC_DS3231 rtc; LiquidCrystal_I2C lcd(0x27,16,2); const int buttonPins[3] = {2,3,4}; const int equipmentPins[3] = {5,6,7}; bool equipmentState[3] = {false,false,false}; const int eepromStart = 0; const int chipSelect = 10; struct LogEntry { int equipment; bool state; byte hour; byte minute; byte second; }; void setup() { Serial.begin(9600); lcd.init(); lcd.backlight(); rtc.begin(); for(int i=0;i<3;i++){ pinMode(buttonPins[i],INPUT_PULLDOWN); pinMode(equipmentPins[i],OUTPUT); digitalWrite(equipmentPins[i],LOW); } if(!SD.begin(chipSelect)){ Serial.println("SD init failed!"); } } void loop() { DateTime now = rtc.now(); lcd.setCursor(0,0); lcd.print("Lab Tracker "); lcd.setCursor(0,1); for(int i=0;i<3;i++){ if(digitalRead(buttonPins[i])){ equipmentState[i] = !equipmentState[i]; digitalWrite(equipmentPins[i],equipmentState[i]); logUsage(i,equipmentState[i],now); delay(200); // debounce } lcd.print(equipmentState[i] ? "ON " : "OFF"); } // Weekly save to SD card if(now.dayOfWeek() == 0 && now.hour()==23 && now.minute()==59){ saveEEPROMtoSD(); delay(60000); } } void logUsage(int equipment,bool state,DateTime timestamp){ LogEntry log = {equipment,state,timestamp.hour(),timestamp.minute(),timestamp.second()}; int addr = eepromStart + (equipment*10); EEPROM.put(addr,log); } void saveEEPROMtoSD(){ File file = SD.open("LabLog.txt",FILE_WRITE); if(file){ for(int i=0;i<3;i++){ LogEntry log; int addr = eepromStart + (i*10); EEPROM.get(addr,log); file.print("Equipment "); file.print(log.equipment+1); file.print(": "); file.print(log.state?"ON":"OFF"); file.print(" at "); file.print(log.hour); file.print(":"); file.print(log.minute); file.print(":"); file.print(log.second); file.println(); } file.close(); Serial.println("Weekly log saved to SD"); } else { Serial.println("SD write failed!"); } }
6. How It Works
Each button controls one piece of lab equipment. Pressing a button toggles the state (ON/OFF) of the equipment. The LCD displays the real-time state of all devices. Every toggle is timestamped with the RTC. Logs are temporarily stored in EEPROM and weekly written to the SD card for permanent storage. This enables tracking usage patterns, equipment maintenance schedules, and lab accountability.
The code is modular, allowing you to add more equipment, integrate Wi-Fi alerts, or automate maintenance reminders.
7. Testing Your Project
- Upload the code to Arduino.
- Wire the buttons, LEDs, LCD, RTC, and SD module correctly.
- Press buttons and observe LCD updates.
- Check EEPROM logs via Serial Monitor.
- Verify SD card log created weekly (or simulate by adjusting RTC time).
8. Advanced Modifications
- Add more equipment by expanding arrays and EEPROM space.
- Integrate Wi-Fi (ESP8266/ESP32) to send alerts to devices when equipment is turned on/off.
- Use a 20x4 LCD for more detailed display.
- Generate automated PDF reports from SD card logs.
- Implement RFID-based access for controlling devices.
9. Common Issues and Troubleshooting
- Buttons not toggling: Check wiring and debounce delay.
- EEPROM not saving: Ensure addresses don’t overlap and log structure is correct.
- SD card not writing: Verify module connections and CS pin.
- RTC not providing time: Check I2C connections and battery.
10. Learning Insights
- EEPROM storage and retrieval techniques.
- SD card logging for long-term data storage.
- Integrating RTC for timestamped events.
- Button-controlled toggling of devices.
- Real-time display on LCD.
- System modularity for expansion.
11. Next Project Teaser
Get ready for the next Smart Classroom project: Automated Classroom Temperature & Humidity Monitor with Alerts. It will include sensor integration, LCD display, SD logging, and Wi-Fi notifications for a complete classroom monitoring solution!
12. Conclusion
This Lab Equipment Usage Tracker project provides a comprehensive introduction to classroom automation. By combining buttons, LEDs, RTC, EEPROM, SD card, and LCD, it teaches data logging, modular design, and system scalability. Perfect for educators, students, and makers looking to build smart classrooms.
By Kaushal Haladi
Comments
Post a Comment