Cambium is an intelligent grow platform that monitors plants and automatically optimizes their environment for healthier, more consistent growth
Cambium - a smart grow platform that combines software, AI, and custom-connected hardware to monitor and optimize plant environments in real time. By automatically managing factors like light, temperature, humidity, and growth cycles, Cambium removes guesswork and helps users grow healthier plants with consistency and precision.
Cambium - Enterprise IoT Grow Room Management System
Cambium is a sophisticated full-stack web application designed for professional agricultural operations, specifically targeting controlled environment agriculture (CEA) for specialty crops. The system provides real-time environmental monitoring, automated equipment control, AI-powered health assessments, and comprehensive analytics through a modern, responsive interface. Built with enterprise-grade architecture, the platform seamlessly integrates custom IoT hardware with cloud-based intelligence to optimize growing conditions and maximize crop yields.
Backend Infrastructure
The backend is built on a robust Node.js/Express foundation, architected for reliability and real-time performance. The server implements a RESTful API architecture with JWT-based authentication and role-based access control, ensuring secure multi-user access with granular permissions. Data persistence is handled through SQLite, providing a lightweight yet powerful relational database that maintains referential integrity across complex relationships between rooms, equipment, sensors, automation rules, and historical data.
The system's real-time capabilities are powered by WebSocket connections that maintain bidirectional communication channels between the server, web clients, and IoT devices. This architecture enables instant sensor data propagation, live equipment status updates, and immediate alert notifications without polling overhead. The server implements sophisticated connection management, tracking client subscriptions to specific rooms and broadcasting targeted updates only to relevant subscribers, optimizing bandwidth and reducing latency.
Scheduled automation forms a critical component of the backend, with multiple concurrent interval-based processes managing equipment schedules, alert monitoring, time-lapse photography capture, and AI health assessments. The scheduler system uses configurable intervals and implements intelligent retry logic with exponential backoff for failed operations. Equipment scheduling supports complex time-based rules including day-of-week specifications and schedules that cross midnight boundaries, with automatic state reconciliation to handle missed execution windows
Hardware Integration
The system integrates with two distinct custom hardware components that work in tandem to provide comprehensive monitoring and control capabilities. The first component is an ESP32-CAM module equipped with the SCD41 environmental sensor, providing high-accuracy CO₂, temperature, and humidity measurements along with visual monitoring capabilities. This sensor module implements a push-based architecture where the device actively uploads sensor readings and camera images to the server at configurable intervals, eliminating the need for continuous polling and reducing network overhead.
The second component is a custom-built smart power strip featuring an integrated ESP32 microcontroller and four dedicated relay channels. This intelligent power distribution unit enables independent control of up to four high-power devices per grow room, such as grow lights, exhaust fans, humidifiers, and heaters. Each relay channel is individually addressable via GPIO pins, allowing the system to control equipment with precision timing and state verification. The smart power strip communicates with the central server over WiFi, receiving control commands and reporting equipment status in real-time.
The dual-hardware architecture separates sensing from actuation, providing several key advantages. The sensor module can be positioned optimally for environmental monitoring without being constrained by equipment locations, while the smart power strip can be mounted near electrical connections for safe, professional equipment control. This separation also enhances system reliability—if one component experiences issues, the other continues operating independently. The server maintains authoritative state for all equipment and synchronizes commands to the smart power strip, ensuring consistent operation even after power cycles or network interruptions.
Camera integration supports both live streaming and snapshot capture, with images stored directly in the database as binary blobs for immediate access. The system implements intelligent image rotation based on camera mounting orientation, and supports multiple image formats (JPEG, PNG, WebP) with automatic content-type detection. Time-lapse functionality captures images at configurable intervals and stores them with metadata for later compilation into growth progression videos.
The control system implements safety interlocks and state verification protocols. Before executing equipment state changes, the system validates that the requested operation is safe given current environmental conditions and other equipment states. After sending control commands to the smart power strip, the server monitors for state confirmation and logs any discrepancies. This closed-loop control architecture ensures equipment operates as intended and provides an audit trail for troubleshooting and compliance purposes.
Frontend Architecture
The frontend is a modern React application built with TypeScript, leveraging functional components and hooks for state management. The UI framework utilizes Tailwind CSS for responsive design, ensuring seamless experiences across desktop, tablet, and mobile devices. The application implements a comprehensive context-based architecture with multiple providers managing authentication state, WebSocket connections, temperature unit preferences, and timezone handling.
The routing system uses React Router with protected route wrappers that enforce authentication requirements and redirect unauthorized users. The layout system adapts dynamically based on screen size, with dedicated mobile navigation components and responsive grid layouts that reflow content appropriately. Chart.js integration provides rich data visualization capabilities for historical sensor data, growth analytics, and environmental trend analysis.
Real-time data updates are handled through custom WebSocket context providers that maintain connection state, automatically reconnect on disconnection, and provide subscription management for room-specific updates. The frontend implements optimistic UI updates for equipment control actions, immediately reflecting state changes while awaiting server confirmation, then reconciling any discrepancies.
core feature set
Environmental Monitoring & Automation
The platform provides real-time monitoring of temperature, humidity, and CO₂ levels across multiple grow rooms with support for both Celsius and Fahrenheit units. The system calculates Vapor Pressure Deficit (VPD) with color-coded indicators for optimal growing conditions. Automated control implements threshold-based rules that trigger equipment when sensor readings exceed configured ranges, with intelligent conflict resolution for competing actions. Schedule-based automation supports complex time-of-day controls including lighting schedules, day/night temperature differentials, and timed ventilation cycles with day-of-week restrictions and midnight-crossing support.
AI-Powered Health Assessment
Integration with OpenAI's GPT-4 Vision API provides automated crop health analysis using specialized prompts for cannabis and mushroom cultivation. The system evaluates pest infestations, diseases, nutrient issues, environmental stress, and harvest readiness, returning health scores (0-100), confidence ratings, detailed analysis, and actionable recommendations. Assessments run on configurable schedules and generate automatic alerts for detected issues, with historical tracking enabling correlation of health trends with environmental changes.
Alerts, Analytics & Reporting
A sophisticated alerting engine monitors conditions continuously, implementing intelligent aggregation to prevent alert spam by requiring threshold violations to persist beyond configurable time windows. Alerts are categorized by type and severity with color-coded indicators, acknowledgment tracking, and multi-channel notification support. Comprehensive analytics dashboards display time-series charts with statistical metrics, growth cycle tracking with stage-specific environmental data, and equipment utilization reports tracking runtime, automation effectiveness, and maintenance needs. The system maintains complete audit trails of all equipment state changes and supports CSV export for external analysis and regulatory compliance.
Visual Documentation & Multi-Room Management
Automated time-lapse capture creates visual documentation of crop development with configurable intervals and metadata storage. The platform supports unlimited grow rooms with independent configurations, equipment assignments, automation rules, and alert thresholds. The dashboard provides at-a-glance status of all rooms with aggregate statistics, and the modular API architecture enables integration with external systems through RESTful endpoints with JWT authentication.
Security & Reliability
Authentication is implemented using industry-standard JWT tokens with secure password hashing via bcrypt. The system enforces password complexity requirements and supports session management with token expiration and refresh capabilities. Role-based access control differentiates between administrative users with full system access and standard users with read-only or limited control permissions.
CORS policies are configured to restrict API access to authorized origins while supporting local network access for IoT devices. The system implements input validation on all endpoints, sanitizing user inputs to prevent SQL injection and XSS attacks. Database transactions ensure data consistency during complex operations involving multiple related records.
Error handling is comprehensive throughout the stack, with try-catch blocks, promise rejection handling, and graceful degradation when external services are unavailable. The system logs errors with context for debugging while presenting user-friendly error messages in the interface. WebSocket connections implement automatic reconnection with exponential backoff, maintaining real-time functionality despite network interruptions.
Deployment & Scalability
The application is designed for on-premises deployment, running on local servers within the facility network for optimal performance and data sovereignty. The lightweight SQLite database eliminates external database dependencies while providing robust relational data management. The system can be deployed on modest hardware (Raspberry Pi or similar) while supporting dozens of concurrent users and hundreds of IoT devices.
The architecture supports horizontal scaling through load balancing and database replication for high-availability deployments. WebSocket connections can be distributed across multiple server instances using Redis pub/sub for message broadcasting. The modular design enables feature-specific scaling, with AI assessment processing offloaded to dedicated workers or cloud services as needed.