Hey there! Welcome to SmartSense AI.
I built this project for a hackathon to simulate a real-world intelligent IoT monitoring system. Coming from an Electronics & Telecommunication background where I've worked with hardware like Arduino, relays, and LM35 temperature sensors, I wanted to create a software simulation that acts just like a real automated HVAC (Heating, Ventilation, and Air Conditioning) or Smart Home system.
This system monitors two main things:
- Temperature (simulating an LM35 or DHT11 sensor)
- Occupancy (simulating a PIR motion sensor or IR sensor)
Based on these inputs, the system uses clear rule-based logic to decide whether to turn the cooling/heating ON or OFF to save energy.
Then, I integrated the Google Gemini API to act as the "brain". Instead of just showing raw sensor data, the AI translates the system's decisions into simple, user-friendly insights—explaining why a decision was made, just like a modern smart home assistant.
- Sensor Simulation: Manually input temperature and occupancy, or toggle "Auto Mode" to see it react to random live data.
- Decision Logic Engine: A practical, if-else rule engine that decides system states (Cooling ON, Heating ON, OFF).
- AI Insight Layer: Uses Google Gemini to explain the system's logic and energy optimization choices in simple terms.
- Clean Dashboard: Built with Streamlit for a lightweight, easy-to-use interface.
- Python (Core logic)
- Streamlit (Web dashboard)
- Google Gemini API (AI Insights)
-
Clone the repository:
git clone <your-repo-url> cd SmartSense-AI
-
Install the required libraries:
pip install -r requirements.txt
-
Set up your API Key: Create a
.envfile in the main folder and add your Gemini API key (DO NOT share this file!):GEMINI_API_KEY=your_actual_api_key_here -
Run the Streamlit App:
streamlit run app.py
Want to put this live on the internet? It's super easy!
- Upload your code to a public or private GitHub repository.
- Go to share.streamlit.io and log in with GitHub.
- Click "New app" and select your repository, branch, and
app.pyas the main file. - CRITICAL: Don't forget the API Key! Click on "Advanced settings" before deploying, and in the Secrets section, add your key like this:
GEMINI_API_KEY="your_actual_api_key_here"
- Hit Deploy and share your link!
This simulation mirrors how smart energy-efficient buildings operate today. Instead of leaving an AC running in an empty room, sensors detect the lack of occupancy and shut down the system. The AI layer adds a transparent explanation so the user feels in control and understands the system's benefits.