GardenSense – Smart Garden Monitoring with Blazor & Raspberry Pi
🌿 GardenSense Dashboard
“Smart garden monitoring — simulated today, Raspberry Pi tomorrow.”
GardenSense is a Blazor Server prototype for a modular smart gardening system. Its interface simulates environmental sensor data, while preparing for future integration with physical devices such as Raspberry Pi-based controllers and GPIO-controlled hardware. It serves as a template for home automation or greenhouse monitoring setups.
Tech Stack
- Frontend: Blazor Server (.NET 8), Bootstrap 5
- Backend: C#, Razor Components
- Database: EF Core with modular component structure
- Future Plans: Raspberry Pi GPIO integration, real-time charts, authentication
🏡 Home Dashboard

Zone Manager

Sensor History Viewer

Controls Panel

🚧 Planned Enhancements
- Live sensor integration with Raspberry Pi GPIO
- Authentication and secure zone editing
- Data visualization with real-time charts
- Remote access and mobile-friendly controls
🧠 Code Highlights
Managing Zones in Blazor (Zones.razor)
This component allows users to add and manage custom garden zones. Each zone has a name and a location, handled using Blazor’s @bind
syntax for real-time updates.

GardenZone Model (C# Class)
Each zone is represented by a GardenZone
class with properties for name, location, and zone-specific sensor data. Clean model definition supports scalable state.

SensorReading Class
Sensor readings are logged using this C# class, including temperature, humidity, light, and moisture levels. This powers both the history view and real-time control logic.

Zone Controls UI (Controls.razor)
This component simulates hardware toggles for each garden zone — including lights, fans, and heaters. It binds to zone state and updates the database, mimicking GPIO triggers.

Sensor History Table (History.razor)
A sortable, filterable table that displays past sensor readings per zone. Users can select a zone, view time-stamped values, and visually monitor trends over time.

Sensor Simulation Logic
This logic generates simulated sensor values and logs them for testing. Later, this will be replaced with live Raspberry Pi GPIO input.

🔧 Next Steps
- Data visualization with real-time charts — Add responsive line or bar charts using Chart.js, Blazorise, or a JSInterop wrapper.
- Live sensor integration — Connect to Raspberry Pi GPIO input using
System.Device.Gpio
and log actual readings. - GPIO command output — Replace current toggles with real-world hardware control (relays, LEDs, etc.).
- Authentication and authorization — Use ASP.NET Identity or a simple token-based system to protect zone controls.
- Mobile responsiveness — Improve UX for tablets and phones; consider swipeable cards or collapsible zone displays.
- Remote dashboard access — Deploy behind HTTPS and allow external users to monitor/control via login.
View the full source code: GitHub Repository
Have a project like this in mind? Get in touch.