Currently deployed and operational at BVB School, Nadiad π«
An intelligent IoT-based school bell automation system that combines modern web technology with Raspberry Pi hardware to deliver precise, reliable bell scheduling for educational institutions.
This system is actively running at BVB School, Nadiad, successfully automating their daily bell schedule and providing administrative control through a modern web dashboard.
SchoolBell is a complete IoT solution that automates school bell operations through:
- Web Dashboard: Modern Next.js interface for schedule management and system control
- Raspberry Pi Controller: Hardware interface for bell control with offline capability
- Firebase Integration: Cloud synchronization and real-time data management
- Multi-level Security: PIN-based authentication system with brute force protection
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Web Dashboard βββββΊβ Firebase βββββΊβ Raspberry Pi β
β (Next.js) β β (Database) β β (Controller) β
β β β β β β
β β’ Schedule Mgmt β β β’ Data Storage β β β’ GPIO Control β
β β’ Manual Controlβ β β’ Command Queue β β β’ Local Storage β
β β’ Activity Logs β β β’ Device Status β β β’ Scheduling β
β β’ Settings Panelβ β β’ Sync System β β β’ Time Sync β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Pre-configured school timetables (weekday/Saturday)
- Period-based scheduling with break management
- Special day override capability for events/holidays
- Offline operation with local data persistence
- Instant bell activation through web interface
- PIN-protected emergency controls
- Configurable bell duration (1-10 seconds)
- Real-time status feedback
- Comprehensive logging of all bell activities
- Real-time system status monitoring
- Device connectivity tracking
- Historical activity reports
- Site PIN (8 digits): Dashboard access control
- User PIN (8 digits): Manual control and schedule modifications
- Master PIN (10 digits): System configuration and PIN management
- Brute force protection with progressive delays
- Firebase-based data synchronization
- Remote system monitoring and control
- Automatic backup and recovery
- Cross-platform accessibility
Period 1: 08:15 - 08:55
Period 2: 08:55 - 09:35
Short Break: 09:35 - 09:45
Period 3: 09:45 - 10:25
Period 4: 10:25 - 11:05
Period 5: 11:05 - 11:40
Long Break: 11:40 - 12:00
Period 6: 12:00 - 12:40
Period 7: 12:40 - 13:20
Period 8: 13:20 - 14:00
Period 1: 08:15 - 08:55
Period 2: 08:55 - 09:35
Short Break: 09:35 - 09:45
Period 3: 09:45 - 10:25
Period 4: 10:25 - 11:05
Period 5: 11:05 - 11:45
- Raspberry Pi (3B+ or newer recommended)
- Node.js 18+ for dashboard development
- Python 3.7+ for Pi controller
- Firebase account
- GPIO-compatible relay module
cd dashboard
npm installCreate .env.local with your Firebase configuration:
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
# Add other Firebase config variables# Development
npm run dev
# Production build
npm run buildChoose your preferred installation method:
cd dietpi
sudo ./install.shcd dietpi
sudo ./install_pyrebase.shcd new-dietpi
sudo ./install.sh- Create a Firebase project
- Download service account key
- Place in appropriate directory based on installation method
- Update project ID in configuration files
- Deploy Firestore security rules
Connect your bell system to Raspberry Pi GPIO:
- GPIO 22: Primary relay control
- GPIO 23: Secondary relay control
- 3.3V/GND: Relay module power
SchoolBell/
βββ dashboard/ # Next.js Web Dashboard
β βββ app/ # Next.js 13+ app directory
β β βββ api/ # API routes
β β βββ components/ # React components
β βββ lib/ # Utility libraries
β βββ public/ # Static assets
β βββ firebase.json # Firebase hosting config
β
βββ dietpi/ # Standard Pi Controller
β βββ main.py # Primary controller script
β βββ install.sh # Installation script
β βββ requirements.txt # Python dependencies
β
βββ new-dietpi/ # Hybrid Node.js Bridge Version
β βββ firebase-bridge.js # Node.js Firebase interface
β βββ main.py # Python bell controller
β βββ install.sh # Hybrid installation
β
βββ Documentation/
βββ DEPLOYMENT.md # Detailed deployment guide
βββ QUICK-PI-SETUP.md # Rapid Pi setup instructions
βββ SOLUTION-SUMMARY.md # Technical implementation details
PI_BASE_URL=http://192.168.1.100:5000
NEXT_PUBLIC_SITE_PIN=12345678
NEXT_PUBLIC_USER_PIN=87654321
NEXT_PUBLIC_MASTER_PIN=1234567890# GPIO Configuration
RELAY_PIN_1 = 22
RELAY_PIN_2 = 23
# Bell Settings
DEFAULT_BELL_DURATION = 5 # seconds
# Security
MASTER_PIN = "1234567890" # Change this!
USER_PIN = "87654321" # Change this!GET /api/pi-status- Check Pi connectivityPOST /api/ring-bell- Manual bell activationGET /api/logs- Retrieve activity logsPOST /api/sync-schedule- Force schedule synchronization
GET /api/status- System status and healthPOST /api/ring- Direct bell controlPOST /api/update_schedule- Schedule updatesGET /api/logs- Local activity logs
# Check Pi service status
sudo systemctl status schoolbell
# View real-time logs
tail -f /home/dietpi/schoolbell/bell.log
# Test GPIO functionality
python3 -c "import RPi.GPIO as GPIO; GPIO.setmode(GPIO.BCM); GPIO.setup(22, GPIO.OUT); GPIO.output(22, GPIO.HIGH)"- Verify network connectivity
- Check service status:
sudo systemctl status schoolbell - Review logs for error messages
- Confirm Firebase configuration
- Test relay connections
- Verify power supply to electromagnet
- Check GPIO pin assignments
- Test with manual API calls
- Enable NTP:
sudo systemctl enable ntp - Manual sync:
sudo ntpdate -s time.nist.gov - Check internet connectivity
- Verify timezone settings
- Vercel (Recommended): Easy deployment with automatic HTTPS
- Firebase Hosting: Integrated with Firebase backend
- Netlify: Alternative static site hosting
- Self-hosted: On-premise deployment option
- Use environment variables for sensitive configuration
- Enable Firebase App Check for additional security
- Set up monitoring and alerting systems
- Configure automated backup procedures
- Implement SSL/TLS certificates
- Change Default PINs: Update all authentication codes before deployment
- Network Security: Use VPN for remote access when possible
- Regular Updates: Keep all dependencies and system packages current
- Access Logging: Monitor and review all system access attempts
- Backup Strategy: Regular data backups and recovery testing
This project is designed for educational institutions. Contributions welcome for:
- Additional schedule templates
- Enhanced security features
- Mobile application development
- Integration with school management systems
Private educational use license. Contact for commercial licensing options.
Currently serving BVB School, Nadiad with:
- β Automated daily bell scheduling
- β Reduced manual intervention requirements
- β Improved schedule adherence
- β Enhanced administrative control
- β Real-time system monitoring capabilities
Built with β€οΈ by Sohel
Making school operations smarter π