This project builds a multi-sensor environmental dashboard using an Arduino Uno and a 16x2 LCD display. Six sensors monitor temperature and humidity, ambient light, distance, motion detection, and soil moisture, with readings displayed in real-time on the LCD screen.
The guide provides a complete wiring diagram, parts list, and step-by-step assembly instructions starting from a disconnected state. Included firmware cycles through each sensor's readings and can be configured to focus on individual sensors. Builders will learn I2C communication, analog and digital sensor integration, and how to manage multiple inputs on a single microcontroller.
Wiring diagram
Gather all the parts
Assemble it in 7 steps
1. Start with USB unplugged
Use an Arduino Uno, a breadboard and jumper wires. Connect Uno 5V to the breadboard positive rail and Uno GND to the ground rail. All modules share these rails. Use the named modules with their onboard support components, not bare sensors.
- Disconnect USB before changing wires. Check printed pin labels rather than assuming pin order.
2. Connect the LCD
Connect LCD VCC to 5V and GND to ground. Connect SDA to A4 for data and SCL to A5 for the clock. Use a 16 by 2 LCD with a PCF8574 I2C backpack at address 0x27 or 0x3F.
- Turn the small contrast screw on the backpack gently if the text is invisible.
3. Connect the temperature and humidity module
Connect the DFR0067 DHT11 module VCC to 5V, GND to ground and DATA to D2. This is a module with its support circuitry, not the bare four-pin sensor.
4. Connect the light module
Connect light module VCC to 5V, GND to ground and AO to A0 for the analog light reading. Leave DO disconnected. The display shows a raw reading from 0 to 1023, not lux.
5. Connect the distance sensor
Connect HC-SR04 VCC to 5V, GND to ground, TRIG to D6 for the start pulse and ECHO to D7 for the return pulse. Point the two round faces toward a flat target 2 to 400 cm away.
6. Connect the motion sensor
Connect HC-SR501 VCC to 5V, GND to ground and OUT to D3 for movement detection. Allow one minute after powering up for the sensor to settle.
7. Connect the soil sensor
Connect SEN0308 VCC (red) to 5V, GND (black) to ground and AOUT (yellow) to A1. Compare readings in dry and moist soil before interpreting moisture; the program reports raw readings rather than an uncalibrated percentage.
- Keep the Uno and wiring dry. Do not immerse connectors.
Review all connections
1. Connections between "lcd" and "Arduino"
2. Connections between "climate" and "Arduino"
3. Connections between "light" and "Arduino"
4. Connections between "distance" and "Arduino"
5. Connections between "motion" and "Arduino"
6. Connections between "soil" and "Arduino"
Deploy the firmware
#include <Arduino.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <DHT.h>
// 0: rotate all examples; 1: climate; 2: light; 3: distance;
// 4: motion; 5: soil. Change this number to run just one example.
const byte EXAMPLE = 0;
LiquidCrystal_I2C lcd(0x27, 16, 2);
DHT climate(2, DHT11);
char previous[2][17] = {{0}, {0}};
bool screenReady = false;
void line(byte row, const char *text) {
char padded[17];
memset(padded, ' ', 16);
padded[16] = 0;
for (byte i=0; i<16 && text[i]; ++i) padded[i]=text[i];
if (strcmp(padded, previous[row]) != 0) {
if (screenReady) { lcd.setCursor(0,row); lcd.print(padded); }
strcpy(previous[row], padded);
Serial.println(padded);
}
}
// Example 1: DHT11 temperature and humidity.
void exampleClimate() {
float t=climate.readTemperature(), h=climate.readHumidity();
char text[17];
if (isnan(t) || isnan(h)) {
line(0,"1: Climate"); line(1,"Check DHT wiring"); return;
}
snprintf(text,sizeof(text),"1: Temp %d C",(int)t); line(0,text);
snprintf(text,sizeof(text),"Humidity %d%%",(int)h); line(1,text);
}
// Example 2: raw light reading, not calibrated lux.
void exampleLight() {
char text[17]; line(0,"2: Light level");
snprintf(text,sizeof(text),"Raw: %d",analogRead(A0)); line(1,text);
}
// Example 3: ultrasonic distance with a bounded echo wait.
void exampleDistance() {
digitalWrite(6,LOW); delayMicroseconds(2);
digitalWrite(6,HIGH); delayMicroseconds(10); digitalWrite(6,LOW);
unsigned long us=pulseIn(7,HIGH,25000UL);
line(0,"3: Distance");
char text[17];
if (!us || us<116 || us>23200) line(1,"Out of range");
else { snprintf(text,sizeof(text),"%lu cm",us/58); line(1,text); }
}
// Example 4: PIR detects movement, not guaranteed occupancy.
void exampleMotion() {
line(0,"4: Motion");
if (millis()<60000UL) line(1,"Warming up...");
else line(1,digitalRead(3)==HIGH ? "Motion detected" : "No motion");
}
// Example 5: raw soil reading; compare dry and wet soil to calibrate.
void exampleSoil() {
char text[17]; line(0,"5: Soil moisture");
snprintf(text,sizeof(text),"Raw: %d",analogRead(A1)); line(1,text);
}
void setup() {
Serial.begin(9600); Wire.begin();
// Common backpack addresses: only one LCD should be on this bus.
const byte addresses[]={0x27,0x3F};
for (byte a : addresses) {
Wire.beginTransmission(a);
if (Wire.endTransmission()==0) {
lcd=LiquidCrystal_I2C(a,16,2); lcd.init(); lcd.backlight();
screenReady=true; break;
}
}
if (!screenReady) Serial.println(F("LCD not found at 0x27 or 0x3F"));
climate.begin();
pinMode(6,OUTPUT); digitalWrite(6,LOW);
pinMode(7,INPUT); pinMode(3,INPUT);
}
void loop() {
static unsigned long last=0;
if (millis()-last<2000UL) return;
last=millis();
byte selected=EXAMPLE ? EXAMPLE : (millis()/6000UL)%5+1;
switch(selected) {
case 1: exampleClimate(); break;
case 2: exampleLight(); break;
case 3: exampleDistance(); break;
case 4: exampleMotion(); break;
case 5: exampleSoil(); break;
default: line(0,"Set EXAMPLE 0-5"); break;
}
}Remix this project
Make it yours in one click
Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.




