Skip to content

SaifEddinBrahmi/Smart-Agriculture-IoT-System

Repository files navigation

🌾 Smart Agriculture IoT System

A comprehensive IoT agriculture system combining ESP32 sensors, React Native mobile application, and Firebase for real-time remote monitoring and control of irrigation systems.

πŸ“± Overview

AgriControl is a comprehensive IoT agriculture system built with ESP32 sensors and a React Native mobile application for remote control and monitoring. Designed for farmers and agricultural professionals, the system provides real-time environmental monitoring with 2-second response time and serves 100+ users.

The mobile app offers an intuitive interface to monitor and control irrigation equipment including pumps, valves, water basins, and soil sensors, with advanced data visualization and scheduling capabilities.

✨ Features

🌐 IoT Integration

  • ESP32 Sensor Network: Real-time data collection from IoT sensors
  • 2-Second Response Time: Ultra-fast environmental monitoring
  • 100+ Active Users: Scalable system supporting multiple concurrent users
  • Remote Control: Manage irrigation equipment from anywhere

πŸ” Authentication

  • Secure user registration and login
  • Firebase Authentication integration
  • Session persistence
  • Multi-user support with isolated data

🚰 Equipment Management

  • Pompes (Pumps): Monitor and schedule irrigation pumps with customizable periods
  • Vannes (Valves): Control and track water valve operations
  • Bassin (Basin): Monitor water basin levels and distances
  • Sonde (Probes): Track soil conditions with multi-level temperature and humidity sensors

πŸ“Š Data Visualization

  • Real-time data charts for all equipment types
  • Historical data tracking
  • Interactive chart components
  • Visual analytics for better decision-making

🌍 Internationalization

  • Multi-language support (English/French)
  • Runtime language switching
  • Comprehensive translation coverage

πŸ“… Scheduling

  • Date and time pickers for equipment scheduling
  • Automated period-based operations
  • Start date and time configuration

πŸ› οΈ Tech Stack

Mobile Application

  • Framework: React Native 0.74.5
  • Platform: Expo SDK 51
  • Navigation: React Navigation v6
  • Charts: react-native-chart-kit
  • Internationalization: i18next, react-i18next
  • Build: EAS (Expo Application Services)

Backend & IoT

  • Database: Firebase Realtime Database
  • Authentication: Firebase Auth
  • IoT Hardware: ESP32 Microcontroller
  • Sensors: Temperature, Humidity, Distance sensors
  • Communication: Real-time data sync with 2-second response time

πŸ“¦ Installation

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • Expo CLI
  • Android Studio / Xcode (for native builds)

Setup

  1. Clone the repository

    git clone https://github.com/SaifEddinBrahmi/Smart-Agriculture-IoT-System.git
    cd "Smart-Agriculture-IoT-System"
  2. Install dependencies

    npm install
  3. Configure Firebase

    • Create a Firebase project at Firebase Console
    • Enable Authentication and Realtime Database
    • Update config/firebase.js with your Firebase credentials
  4. Start the development server

    npm start

πŸš€ Running the App

Development Mode

# Start Expo development server
npm start

# Run on Android
npm run android

# Run on iOS
npm run ios

# Run on web
npm run web

Building for Production

Android APK (Preview)

eas build --profile preview --platform android

Production Build

eas build --profile production --platform android

πŸ“‚ Project Structure

AgriControl Mobile App/
β”œβ”€β”€ App.js                      # Root component with navigation
β”œβ”€β”€ app.json                    # Expo configuration
β”œβ”€β”€ package.json               # Dependencies
β”œβ”€β”€ babel.config.js            # Babel configuration
β”œβ”€β”€ eas.json                   # EAS Build configuration
β”œβ”€β”€ i18n.js                    # Internationalization setup
β”œβ”€β”€ assets/                    # Images and icons
β”œβ”€β”€ components/                # React components
β”‚   β”œβ”€β”€ HomePage.js           # Authentication screen
β”‚   β”œβ”€β”€ Pompes.js             # Pump management
β”‚   β”œβ”€β”€ AddPompes.js          # Add pump data
β”‚   β”œβ”€β”€ DisplayPompes.js      # Display pump list
β”‚   β”œβ”€β”€ PompesChartsPage.js   # Pump analytics
β”‚   β”œβ”€β”€ Vannes.js             # Valve management
β”‚   β”œβ”€β”€ AddVannes.js          # Add valve data
β”‚   β”œβ”€β”€ DisplayVannes.js      # Display valve list
β”‚   β”œβ”€β”€ VannesChartsPage.js   # Valve analytics
β”‚   β”œβ”€β”€ Bassin.js             # Basin monitoring
β”‚   β”œβ”€β”€ DisplayBassin.js      # Display basin data
β”‚   β”œβ”€β”€ BassinChartsPage.js   # Basin analytics
β”‚   β”œβ”€β”€ Sonde.js              # Probe monitoring
β”‚   β”œβ”€β”€ DisplaySonde.js       # Display probe data
β”‚   β”œβ”€β”€ SondeChartsPage.js    # Probe analytics
β”‚   β”œβ”€β”€ ChartComponent.js     # Reusable chart component
β”‚   └── styles.js             # Shared styles
β”œβ”€β”€ config/
β”‚   └── firebase.js           # Firebase configuration
β”œβ”€β”€ resources/                 # Translation files
β”‚   β”œβ”€β”€ en.js                 # English translations
β”‚   β”œβ”€β”€ fr.js                 # French translations
β”‚   └── index.js              # Resource exports
└── utils/
    └── firebaseUtils.js      # Firebase helper functions

πŸ”₯ Firebase Database Structure

users/
└── {userId}/
    β”œβ”€β”€ pompes/
    β”‚   └── {pompeId}/
    β”‚       β”œβ”€β”€ name
    β”‚       β”œβ”€β”€ period
    β”‚       └── startdate
    β”œβ”€β”€ vannes/
    β”‚   └── {vanneId}/
    β”‚       β”œβ”€β”€ name
    β”‚       β”œβ”€β”€ period
    β”‚       └── startdate
    β”œβ”€β”€ bassin/
    β”‚   └── {bassinId}/
    β”‚       β”œβ”€β”€ distance
    β”‚       └── date
    └── sonde/
        └── {sondeId}/
            β”œβ”€β”€ date
            β”œβ”€β”€ tempLevel1
            β”œβ”€β”€ tempLevel2
            β”œβ”€β”€ tempLevel3
            β”œβ”€β”€ humLevel1
            β”œβ”€β”€ humLevel2
            └── humLevel3

🌐 Supported Languages

  • πŸ‡¬πŸ‡§ English (default)
  • πŸ‡«πŸ‡· French

Language can be switched at runtime from the login screen.

🎯 Key Achievements

  • βœ… Real-time Monitoring: 2-second response time for environmental data
  • βœ… Scalable Architecture: Successfully serving 100+ active users
  • βœ… ESP32 Integration: Seamless IoT sensor network communication
  • βœ… Remote Control: Full irrigation system management from mobile device
  • βœ… Multi-level Sensing: Temperature and humidity monitoring at 3 different soil depths
  • βœ… Multi-language Support: English and French localization

πŸ“± App Features

The mobile application features:

  • Clean and intuitive user interface
  • Bottom tab navigation for easy access
  • Real-time data synchronization with ESP32 sensors
  • Interactive charts and graphs for data visualization
  • Date/time pickers for equipment scheduling
  • Responsive design for various screen sizes
  • Automated irrigation control based on sensor data

πŸ”§ Configuration

Firebase Setup

  1. Create a Firebase project
  2. Enable Email/Password authentication
  3. Enable Realtime Database
  4. Configure database rules for security
  5. Update config/firebase.js with your credentials

EAS Build Configuration

The project uses EAS for building:

  • Development: Development client with internal distribution
  • Preview: APK builds for testing
  • Production: Production-ready builds

πŸ‘₯ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is part of the AgriControl ecosystem.

πŸ‘¨β€πŸ’» Developer

Saif Eddine Brahmi


⭐ Star This Repository

If you find this project useful, please consider giving it a star! It helps others discover this project and motivates continued development.

GitHub stars

πŸ‘‰ Star this repository on GitHub


Built with ❀️ using ESP32, React Native, and Firebase | Smart Agriculture IoT System

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors