https://github.com/pythonicforge/smart-home-automation
A Smart Home Automation system using an LDR and a TMP36 sensor to control an LED and a fan based on light and temperature conditions.
https://github.com/pythonicforge/smart-home-automation
arduino led-controller photoresistor smarthome tmp36
Last synced: 9 months ago
JSON representation
A Smart Home Automation system using an LDR and a TMP36 sensor to control an LED and a fan based on light and temperature conditions.
- Host: GitHub
- URL: https://github.com/pythonicforge/smart-home-automation
- Owner: pythonicforge
- License: mit
- Created: 2025-03-11T08:13:54.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-12T06:01:36.000Z (9 months ago)
- Last Synced: 2025-03-28T11:18:47.916Z (9 months ago)
- Topics: arduino, led-controller, photoresistor, smarthome, tmp36
- Language: C++
- Homepage:
- Size: 291 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π _Smart Home Automation with LDR, Temperature Sensor & LCD Display_
This project showcases a **Smart Home Automation System** using an **LDR (Light Dependent Resistor), TMP36 Temperature Sensor, and a 16x2 I2C LCD Display** to control an **LED (automatic night lighting), a fan (temperature-based cooling), and display real-time sensor readings.**
### π Features
β
**Automatic night light** using an LDR
β
**Temperature-based fan control** with a TMP36 sensor
β
**Live sensor readings displayed on a 16x2 LCD**
β
**Real-time debugging via Serial Monitor**
β
Adjustable threshold values for **customization**
### π§ Components Used
- **LDR (Photoresistor)** β Detects ambient light levels
- **TMP36 Temperature Sensor** β Measures surrounding temperature
- **16x2 I2C LCD Display** β Shows live sensor readings
- **LED** β Turns on when itβs dark
- **Fan (Motor)** β Activates when temperature crosses a set threshold
- **Arduino UNO R3** β Microcontroller to process inputs and control outputs
- **Resistors & Wires** β For circuit connections
- **I2C Module** β Enables LCD communication with fewer pins
### π Code Explanation
- Reads **LDR & temperature sensor values** using `analogRead()`
- Maps & processes sensor values for **LED & Fan control**
- Displays sensor data on **LCD using I2C communication**
- Uses **digitalWrite()** to toggle LED & Fan based on thresholds
- Outputs real-time readings via **Serial Monitor**
### π Circuit Connections
| Component | Arduino Pin |
|-----------|------------|
| LDR | A0 |
| TMP36 | A1 |
| LED | 9 |
| Fan | 5 |
| LCD (SDA) | A4 |
| LCD (SCL) | A5 |
### πΊ LCD Display Output
The **16x2 LCD screen** will display:
```
Temp: 26.4Β°C
Light: 540 LUX
```
### π― How to Use
1. **Upload the code** to your Arduino
2. Adjust **lightThreshold** & **tempThreshold** if needed
3. Open **Serial Monitor** for debugging
4. **Observe** the LCD displaying real-time sensor values
5. Watch the **LED & Fan operate automatically** based on environmental conditions
### πΈ Simulation
This project was built and tested in **TinkerCAD**. View or modify the simulation here:
[π TinkerCAD Link](https://www.tinkercad.com/things/1syJ0ihAiga-smart-light-and-fan-automation?sharecode=nxrHhSjw3-JQ8oMcYJHdpOPWFktW9LUOS0673Uy2-4E)
## π Future Improvements
- **Add a DHT11 sensor** for humidity monitoring
- **Integrate IoT connectivity** for remote monitoring & control
- **Use relay modules** for real-world appliance control
- **Upgrade LCD to an OLED display** for better readability
Made with β€οΈ by Hardik Jaiswal
Exploring Embedded Systems & Smart Automation! π