This project implements a LoRa-based virtual fencing solution for livestock and wildlife management. The system uses LoRa communication, GPS, and edge processing to create a virtual boundary and monitor animal movement. It triggers alerts when animals breach the defined boundary, helping manage grazing areas and prevent unauthorized animal movement.
Components 🛠️Hardware 🖥️LoRa Transmitter Node:
- Heltec LoRa32 V2/V3
- GPS Module (TinyGPS++)
- Buzzer for audio feedback 🎵
- Vibration motor for haptic feedback (optional) 🔋
- LoRa Transmitter Node:Heltec LoRa32 V2/V3GPS Module (TinyGPS++)Buzzer for audio feedback 🎵Vibration motor for haptic feedback (optional) 🔋
LoRa Receiver Node:
- Heltec LoRa32 V2/V3
- OLED Display (SSD1306) 🖥️
- LoRa Receiver Node:Heltec LoRa32 V2/V3OLED Display (SSD1306) 🖥️
- WiFi Connectivity: ESP32 WiFi for data transmission 🌐
- Programming Languages: C++ (Arduino)
Dependencies:
- LoRa.h
- Adafruit_GFX.h
- Adafruit_SSD1306.h
- TinyGPS++.h
- HTTPClient.h
- Dependencies:LoRa.hAdafruit_GFX.hAdafruit_SSD1306.hTinyGPS++.hHTTPClient.h
- Dashboard: Flask-based web application with Leaflet.js for real-time geolocation tracking 🗺️.
Virtual Fencing 🚧:
- Define polygon-based geofence boundaries.
- Alert using buzzer and vibration when animals exit the virtual fence.
- Virtual Fencing 🚧:Define polygon-based geofence boundaries.Alert using buzzer and vibration when animals exit the virtual fence.
Real-Time Monitoring 📍:
- Receive live location data of animals.
- Display node positions and movement on an interactive map.
- Real-Time Monitoring 📍:Receive live location data of animals.Display node positions and movement on an interactive map.
Data Transmission 📡:
- Uses LoRa for long-range, low-power communication.
- HTTP-based data transfer from LoRa receiver to Flask dashboard.
- Data Transmission 📡:Uses LoRa for long-range, low-power communication.HTTP-based data transfer from LoRa receiver to Flask dashboard.
WiFi Connectivity 🌐:
- Connects to a local WiFi network for sending data to a remote server.
- WiFi Connectivity 🌐:Connects to a local WiFi network for sending data to a remote server.
Customizable Dashboard 🖥️:
- User-friendly interface for viewing current positions and paths.
- Geofence breach alerts with color-coded markers 🚨.
- Customizable Dashboard 🖥️:User-friendly interface for viewing current positions and paths.Geofence breach alerts with color-coded markers 🚨.
Transmitter Node:
- Connect the GPS module and buzzer to the Heltec LoRa32.
- Program using the Arduino code provided (
transmitter.ino). - Transmitter Node:Connect the GPS module and buzzer to the Heltec LoRa32.Program using the Arduino code provided (
transmitter.ino).
Receiver Node:
- Connect the OLED display to the Heltec LoRa32.
- Program using the Arduino code provided (
receiver.ino). - Receiver Node:Connect the OLED display to the Heltec LoRa32.Program using the Arduino code provided (
receiver.ino).
Arduino:
- Install required libraries (LoRa, Adafruit_GFX, Adafruit_SSD1306, TinyGPS++).
- Upload the corresponding code to the transmitter and receiver.
- Arduino:Install required libraries (LoRa, Adafruit_GFX, Adafruit_SSD1306, TinyGPS++).Upload the corresponding code to the transmitter and receiver.
Flask Dashboard:
- Ensure Python and Flask are installed.
- Run the Flask server script (
app.py). - Access the dashboard at
http://<server_ip>:5000. - Flask Dashboard:Ensure Python and Flask are installed.Run the Flask server script (
app.py).Access the dashboard athttp://<server_ip>:5000.
Map View 🗺️:
- Displays nodes with real-time updates.
- Uses Leaflet.js for map rendering.
- Map View 🗺️:Displays nodes with real-time updates.Uses Leaflet.js for map rendering.
Sidebar Navigation 🔖:
Home: Main view.Clear Path: Clear polyline paths.Export to CSV: Save tracking data.Settings: Adjust geofence parameters.- Sidebar Navigation 🔖:H
ome:Main view.Clear Path:Clear polyline paths.Export to CSV:Save tracking data.Settings:Adjust geofence parameters.
- LoRa
- Adafruit GFX
- Adafruit SSD1306
- TinyGPS++
- Flask
- Requests
- Leaflet.js (for frontend)
- Add edge machine learning for animal behavior analysis 🤖.
- Integrate SMS/notification-based alerts 📲.
- Extend battery life with optimized power management 🔋.












Comments