Skip to content

4.1.34. Smart Warehouse Environmental Monitor

| Description In Project 89, learners will engineer an advanced 'Smart Warehouse Environmental Monitor' multi-component system. This design integrates BME280 + PIR Motion Sensor + IIC 1602 LCD + RGB LED into a cohesive industrial automation unit.|------------------|----------------------------------------------------------------| | Use case |This project connects to real-world industrial and IoT applications such as: Project 89 provides essential master-level engineering skills for real-world IoT, safety, and control systems.|

Components (Things You will need)

Arduino Uno Arduino USB Cable Bread Board Jumper Wires BME Sensor LCD Display RGB Module LED PIR Motion Sensor

Building the circuit

Things Needed:

  • Arduino Uno Core Board = 1
  • BME280 = 1
  • PIR Motion Sensor = 1
  • IIC 1602 LCD = 1
  • USB Cable & Jumper Wires = 1
  • Bread Board
  • RGB Module
  • LED

Mounting the component on the breadboard and wiring the circuit

Step 1: Inventory Check: Confirm you have the Arduino Uno, BME280 sensor, PIR Motion Sensor, IIC 1602 LCD, and RGB LED.

Step 2: Power Connections: Connect the VCC pin of the IIC 1602 LCD and the PIR Motion Sensor to the 5V pin on the Arduino. Connect the VCC pin of the BME280 to the 3.3V pin on the Arduino.

Step 3: Ground Connections: Connect the GND pins of all modules (LCD, PIR, BME280) to a common GND pin on the Arduino.

Step 4: I2C Bus Connections (LCD & BME280): Connect the SDA pin of both the IIC 1602 LCD and the BME280 to the A4 pin on the Arduino. Connect the SCL pin of both to the A5 pin on the Arduino.

Step 5: Sensor Input: Connect the OUT pin of the PIR Motion Sensor to Digital Pin 2.

Step 6: Actuator Output: Connect the R, G, and B pins of the RGB LED to Digital Pins 9, 10, and 11 respectively.

Step 7: Final Verification: Double-check that all connections match the Circuit Connections table and that no power lines are accidentally touching data lines before connecting the USB cable.

Components on breadboard

Make sure to connect the Arduino USB cable to the Arduino board.

PROGRAMMING

Step 1: Open your Arduino IDE. See how to set up here: Getting Started.

Step 2: Write the complete program implementing the system logic with appropriate pin definitions, setup configuration, and the main control loop.

// Project 89: Smart Warehouse Environmental Monitor
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Adafruit_BME280.h>

Adafruit_BME280 bme;
LiquidCrystal_I2C lcd(0x27, 16, 2);

const int pirPin = 2;
const int redPin = 9;
const int greenPin = 10;
const int bluePin = 11;

void setup() {
  Serial.begin(9600);

  pinMode(pirPin, INPUT);
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);

  if (!bme.begin(0x76)) {
    Serial.println("Could not find BME280 sensor!");
    while (1);
  }

  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Warehouse Monitor");
}

void loop() {
  float temp = bme.readTemperature();
  int motion = digitalRead(pirPin);

  lcd.setCursor(0, 1);
  lcd.print("Temp: ");
  lcd.print(temp);
  lcd.print("C");

  if (motion == HIGH) {
    digitalWrite(redPin, HIGH);
    digitalWrite(greenPin, LOW);
    digitalWrite(bluePin, LOW);
  } else {
    digitalWrite(redPin, LOW);
    digitalWrite(greenPin, HIGH);
    digitalWrite(bluePin, LOW);
  }

  delay(1000);
}


Step 7: Save your code. See the Getting Started section

Step 8: Select the arduino board and port See the Getting Started section:Selecting Arduino Board Type and Uploading your code.

Step 9: Upload your code. See the Getting Started section:Selecting Arduino Board Type and Uploading your code

CONCLUSION

The system responds dynamically when physical conditions cross pre-programmed setpoints, driving output devices reliably.