Build A Web-Controlled Climate And Motion Monitor

Mold in my home was the main reason I built this device. Mold needs moisture to grow, and persistently high indoor humidity can keep walls, furniture, and other surfaces damp enough to support it.
I wanted real measurements that would show when the room was becoming too humid, plus remote control of my air conditioner so I could manage the room climate and warm the space before returning home.
I also wanted to know if movement detected while I was away might indicate a possible break-in.
The result is a compact Arduino Uno and ESP8266 D1 Mini system that measures temperature and humidity, reports movement, controls the air conditioner through infrared signals, and presents the latest status on a web dashboard.
Key Takeaways
Mold prevention through better moisture awareness was the project’s primary purpose; temperature, humidity, and movement are visible remotely on one dashboard.
An Arduino Uno handles the DHT11, PIR sensor, and infrared transmitter, while a D1 Mini provides Wi-Fi and MQTT connectivity.
A voltage divider protects the D1 Mini’s 3.3 V input from the Uno’s 5 V serial output.
Moving the D1-to-Uno connection from the hardware TX pin to D6 separated device communication from USB serial diagnostics and made troubleshooting much clearer.
Why I Built This Device
Moisture control was the main purpose of the project. Mold had already appeared in my house, and I wanted reliable measurements instead of judging the room by how it felt. The U.S. Environmental Protection Agency explains that mold cannot grow without moisture and recommends keeping indoor relative humidity below 60%, ideally between 30% and 50% when possible. It also notes that leaks, condensation, damp materials, and HVAC maintenance still need direct attention.
This device does not remove existing mold or repair the source of moisture. It gives me information that can support better decisions. When humidity rises, the system can send the infrared command that turns on my air conditioner in its configured operating mode. I can also turn the unit on or off from the website when I am away and want to warm the room before returning.
The second objective was security awareness. When I was away, I wanted the dashboard to show whether the PIR sensor had detected movement that might indicate someone had entered the house. This is useful as a simple presence indicator, but it is not a certified security system and should not replace locks, alarms, cameras, or professional monitoring.
What The Final Device Does
The finished device has four main functions:
It measures room temperature and relative humidity with a DHT11 sensor.
It detects movement with an HC-SR501 passive infrared sensor.
It sends learned infrared ON and OFF commands to the air conditioner.
It transfers room data and motion status to a web dashboard through HiveMQ Cloud.
The automatic logic in my final Uno sketch sends the AC ON command when temperature falls below 20°C or humidity rises above 70%. It sends the OFF command when temperature is above 25°C and humidity is below 70%. These values are project settings, not universal recommendations, and they should be changed for the room, climate, air conditioner mode, and comfort level involved.
For heating, the stored AC ON infrared sequence must represent the remote control configured in heat mode with the desired target temperature. If the learned sequence represents cooling mode, the system will reproduce that instead. Air conditioners often encode mode, fan, target temperature, and power state in one long infrared frame.
Final Device Demonstration
How The System Works
The Arduino Uno is responsible for the physical room hardware. It reads the DHT11, monitors the HC-SR501, and sends the stored infrared sequences through the IR transmitter.
The D1 Mini acts as the network bridge. It receives messages from the Uno, connects to Wi-Fi, and publishes data to HiveMQ Cloud using MQTT. It also subscribes to AC commands sent by the website and forwards those commands to the Uno.
The web application does not expose the HiveMQ password in browser-side JavaScript. Server-side API functions read the credentials from Vercel environment variables, communicate with HiveMQ, and return only the room or device status needed by the page.
The data flow is:
DHT11 And HC-SR501 (humidity/temperature and movements modules)
↓
Arduino Uno
↓
Serial Through Voltage Divider
↓
ESP8266 D1 Mini (Wifi module)
↓
HiveMQ Cloud
↓
Vercel API And Web DashboardCommands travel in the opposite direction:
Website → HiveMQ → D1 Mini → Arduino Uno → IR Transmitter → Air ConditionerParts Used
Arduino Uno R3
ESP8266 D1 Mini
DHT11 temperature and humidity sensor
HC-SR501 PIR movement sensor
