Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TrashTransforms πŸ—‘οΈπŸ“Š

A real-time sensor monitoring system built with Django for tracking waste management data through ESP32-powered sensors. This project provides a web dashboard to visualize environmental sensor data including distance measurements, gas concentrations, temperature, and humidity.

πŸš€ Features

  • Real-time Data Monitoring: Live sensor data updates every 5 seconds
  • Multiple Sensor Support:
    • Distance sensors (for waste level monitoring)
    • MQ-4 gas sensors (methane detection)
    • MQ-135 air quality sensors
    • Temperature and humidity sensors
  • Firebase Integration: Seamless data storage and retrieval
  • Responsive Dashboard: Bootstrap-powered web interface
  • ESP32 Compatible: Designed to work with ESP32 microcontrollers

πŸ› οΈ Tech Stack

  • Backend: Django 5.1.4
  • Database: Firebase Realtime Database
  • Frontend: HTML5, Bootstrap 5.3.0, jQuery 3.6.0
  • Hardware: ESP32 microcontroller
  • Sensors: Distance sensors, MQ-4, MQ-135, DHT22/AM2302

πŸ“‹ Prerequisites

  • Python 3.8+
  • Firebase account and project
  • ESP32 microcontroller (for data collection)
  • Required sensors (MQ-4, MQ-135, distance sensor, temperature/humidity sensor)

πŸ”§ Installation

  1. Clone the repository

    git clone https://github.com/JulioCaesarRBG/TrashTransforms.git
    cd TrashTransforms
  2. Create virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install django firebase-admin python-decouple
  4. Configure Firebase

    • Create a Firebase project at Firebase Console
    • Generate a service account key (JSON file)
    • Enable Realtime Database
    • Create a .env file in the project root:
    FIREBASE_CREDENTIALS=path/to/your/firebase-credentials.json
    FIREBASE_DATABASE_URL=https://your-project-id-default-rtdb.firebaseio.com/
    SECRET_KEY=your-django-secret-key
    DEBUG=True
  5. Run migrations

    python manage.py migrate
  6. Start the development server

    python manage.py runserver

πŸ“Š API Endpoints

  • GET / - Main dashboard view
  • GET /get_data/ - Fetch sensor data from Firebase (JSON)

πŸ”Œ Hardware Setup

ESP32 Sensor Configuration

The system expects sensor data in the following JSON format:

{
  "timestamp": "2025-01-01 12:00:00",
  "distance": 25.5,
  "mq4": 150,
  "mq135": 200,
  "temperature": 24.5,
  "humidity": 65.0
}

Firebase Data Structure

sensors/
β”œβ”€β”€ sensor_data_1/
β”‚   β”œβ”€β”€ timestamp: "2025-01-01 12:00:00"
β”‚   β”œβ”€β”€ distance: 25.5
β”‚   β”œβ”€β”€ mq4: 150
β”‚   β”œβ”€β”€ mq135: 200
β”‚   β”œβ”€β”€ temperature: 24.5
β”‚   └── humidity: 65.0
└── sensor_data_2/
    └── ...

🎯 Use Cases

  • Smart Waste Management: Monitor trash bin fill levels
  • Environmental Monitoring: Track air quality and weather conditions
  • Industrial IoT: General sensor data collection and visualization
  • Research Projects: Environmental data analysis

πŸ“± Dashboard Features

  • Real-time Updates: Automatic data refresh every 5 seconds
  • Responsive Design: Works on desktop, tablet, and mobile devices
  • Data Table: Clean tabular view of all sensor readings
  • Error Handling: Graceful handling of connection issues

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is open source and available under the MIT License.

πŸ› Troubleshooting

Common Issues

  1. Firebase Connection Error

    • Verify your Firebase credentials and database URL
    • Check Firebase security rules
  2. No Data Appearing

    • Ensure ESP32 is sending data to the correct Firebase path
    • Check network connectivity
  3. Django Server Issues

    • Verify all dependencies are installed
    • Check the .env file configuration

πŸ“ž Support

If you encounter any issues or have questions, please open an issue on GitHub.

πŸ™ Acknowledgments

  • Built with Django framework
  • Firebase for real-time data storage
  • Bootstrap for responsive UI design
  • ESP32 community for hardware inspiration

Made with ❀️ for smart waste management and environmental monitoring

About

πŸ—‘οΈ Real-time waste management monitoring system with ESP32 sensors, Django backend, and Firebase integration for environmental data tracking

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages