Office & Workspace Setup Guide
Automate office lighting based on time of day, track energy usage per floor, and get alerts when equipment needs attention. Cut costs without cutting comfort.
Overview
Modern offices consume more energy than necessary. Lights stay on in empty rooms, HVAC runs at full blast on unoccupied floors, and equipment failures go unnoticed until they cause real problems. Giantronic turns every floor of your office into a smart, self-managing workspace that responds to the people inside it.
Deploy ESP32 microcontrollers across each floor and zone, wire them to relay modules, motion sensors, and energy meters, and connect everything to a single dashboard. From there you can automate lighting schedules, track kilowatt-hour consumption per floor, configure instant alerts for energy spikes or equipment failures, and generate monthly cost-savings reports — all without replacing your existing electrical infrastructure.
Smart Lighting
Motion-based and scheduled lighting that adapts to real occupancy patterns.
Energy Tracking
Per-floor, per-circuit energy monitoring with real-time dashboards and daily reports.
Equipment Alerts
Instant notifications when devices go offline or energy consumption spikes.
Cost Reduction
Typical offices save 25-40% on lighting energy within the first quarter of deployment.
Hardware You Need
Every component listed below is off-the-shelf, inexpensive, and compatible with Giantronic out of the box. Start with one floor and scale to the entire building as budget allows.
ESP32 DevKit (per floor/zone)
One ESP32 per floor or zone handles all sensors, relays, and cloud connectivity. Dual-core 240 MHz, built-in Wi-Fi and Bluetooth.
8-Channel Relay Module
Switch lighting circuits, HVAC controls, and equipment outlets. Optoisolated for safety with the ESP32's 3.3 V logic.
PIR Motion Sensors
Passive infrared detectors for occupancy-based lighting. Wide 120° detection angle, adjustable sensitivity up to 7 meters.
Current Sensors (ACS712)
Hall-effect current sensors for real-time energy measurement. Available in 5 A, 20 A, and 30 A variants depending on circuit load.
Energy Meters
Dedicated energy metering ICs (e.g., SCT-013 clamp-on) for whole-floor kWh tracking and daily consumption reports.
Ethernet / Wi-Fi Module
ESP32 ships with Wi-Fi. For mission-critical installs, add a W5500 Ethernet module for a stable wired backhaul.
Fleet Setup
A fleet groups ESP32 devices by physical location or function. Create one fleet per floor, then add individual devices for each zone (e.g., "Floor 1 – Lobby", "Floor 1 – Open Office"). Fleets let you apply bulk firmware updates, shared pin configurations, and unified alert rules across every device on a floor.
Organizing devices into fleets makes it easy to apply changes at scale. When you update a lighting schedule on the fleet, every ESP32 in that floor picks up the new configuration automatically.
Creating Your First Fleet
-
Navigate to Fleets
Open the Giantronic dashboard and click Fleets in the sidebar. This lists all fleets across your organization.
-
Click "Create Fleet"
Enter a name like
Floor 1 – Mainand select a region. Optionally assign tags such asfloor-1orlightingfor filtering. -
Register ESP32 Devices
Flash each ESP32 with the Giantronic firmware. On first boot, the device registers itself and requests enrollment. Approve it from the dashboard and assign it to your fleet.
-
Assign Pin Templates
Upload a pin configuration template to the fleet (see Pin Configuration below). All devices in the fleet inherit the same pin mapping automatically.
-
Configure Shared Rules
Set fleet-wide alert thresholds, energy reporting intervals, and automation schedules. These propagate to every enrolled device within seconds.
Repeat this process for each floor. For large buildings, use fleet tags like wing-a and wing-b to sub-divide floors into manageable groups.
Pin Configuration
The table below shows a representative pin mapping for a single-floor ESP32 controller managing lighting relays, a motion sensor, and a current sensor. Adjust GPIO numbers to match your actual wiring.
| Function | GPIO Pin | Sensor / Module | Mode | Notes |
|---|---|---|---|---|
| Floor 1 Lights | GPIO2 |
Relay Module | Output | Controls main lighting circuit for Floor 1 open office area. |
| Floor 2 Lights | GPIO4 |
Relay Module | Output | Controls lighting circuit for Floor 2 conference rooms and corridors. |
| HVAC Control | GPIO5 |
Relay Module | Output | Engages HVAC relay to trigger heating/cooling cycle on schedule. |
| Motion Sensor | GPIO14 |
PIR Sensor | Input | Digital input with internal pull-down. Triggers on HIGH signal from PIR. |
| Current Monitor | GPIO34 |
ACS712 | Analog Input | Reads analog voltage proportional to current draw. ADC1 channel, Wi-Fi safe. |
GPIO34 is input-only on the ESP32. Do not assign it to any output function. It is ideal for analog sensor reads because it is on ADC1, which remains active while Wi-Fi is running.
Motion-Based Automation
PIR sensors let lights turn on only when someone is actually in the room. When the zone is empty, lights switch off automatically — no timers to manage, no energy wasted.
The automation flow is simple: the PIR sensor detects human movement, the ESP32 immediately activates the corresponding relay, and a configurable inactivity timer shuts the relay off after the zone has been empty for a set period.
Automation Flow
-
Detect Motion
The PIR sensor on
GPIO14goes HIGH when it detects infrared movement within its 120° cone. The ESP32 interrupts its idle loop and registers the event. -
Turn On Lights
The ESP32 immediately drives
GPIO2HIGH to close the relay for Floor 1 lights. Lights reach full brightness within milliseconds — faster than a human can notice. -
Reset Inactivity Timer
Every time motion is detected, a 5-minute countdown resets. As long as someone remains in the zone, the timer keeps restarting and lights stay on.
-
Auto-Off After 5 Minutes
If no motion is detected for 5 consecutive minutes, the ESP32 drives the relay LOW, turning off the lights. The device returns to motion-watching mode.
Pin Configuration
| Pin | Device | Direction | Trigger |
|---|---|---|---|
GPIO14 |
PIR Motion Sensor | Input | HIGH when motion detected, LOW when idle |
GPIO2 |
Relay Module (Lights) | Output | HIGH to close relay (lights ON), LOW to open (lights OFF) |
Schedule Logic
// Simplified motion-based lighting logic if (digitalRead(GPIO14) == HIGH) { digitalWrite(GPIO2, HIGH); // Turn lights ON lastMotionTime = millis(); // Reset inactivity timer } if (millis() - lastMotionTime > 300000) { // 5 minutes = 300 000 ms digitalWrite(GPIO2, LOW); // Turn lights OFF }
Energy Tracking
Real-time energy monitoring is the foundation of cost savings. By reading current sensors on each floor, you can pinpoint waste, validate savings claims, and catch equipment anomalies before they become expensive problems.
Giantronic reads ACS712 current sensor values at configurable intervals, converts them to wattage using the measured voltage, and streams the data to your dashboard in real time. Daily, weekly, and monthly reports are generated automatically.
Reading Current Sensor Values
The ACS712 outputs an analog voltage centered at VCC/2 (≈2.5 V for a 5 V supply).
The voltage shifts ±185 mV per amp (for the 5 A variant). The ESP32 reads this via
its 12-bit ADC on GPIO34, and the firmware converts the raw value into
amps and watts.
-
Sample the ADC
Read
GPIO34at 1 kHz over a 200 ms window (200 samples) to capture a full AC cycle at 50 Hz. Average the samples for stability. -
Convert to Current
Apply the ACS712 sensitivity formula:
current = (adcValue - 2048) * (5.0 / 4096) / 0.185. This yields instantaneous amps. -
Calculate Power
Multiply current by measured voltage (230 V for EU, 120 V for US) to get watts. Integrate over time for watt-hours and kilowatt-hours.
-
Stream to Dashboard
Push energy readings to Giantronic every 10 seconds. The dashboard aggregates data per fleet and displays live consumption graphs.
Dashboard Display
The energy dashboard shows per-floor consumption in real time. You can switch between live view (instantaneous watts), daily view (cumulative kWh), and monthly view (cost estimates based on your electricity rate). Compare floors side-by-side to identify outliers immediately.
Daily Reports
Configure Giantronic to email a daily summary at midnight. The report includes total kWh consumed per floor, peak demand, average load, and a comparison with the previous day. Alerts fire automatically if consumption exceeds your configured threshold.
Energy Data Format
{
"device_id": "esp32-floor1-lobby",
"fleet": "floor-1-main",
"timestamp": "2026-07-28T14:30:00Z",
"sensors": {
"current_a": 4.82,
"voltage_v": 230.1,
"power_w": 1109.1,
"energy_wh": 3081.4,
"energy_kwh": 3.08
},
"status": "ok"
}
Scheduled Operations
Time-based schedules ensure lights and HVAC follow your office's working hours. Motion automation handles edge cases, but schedules form the backbone of energy savings by enforcing baseline off-hours shutdowns.
Work Hours Schedule
-
8:00 AM — Lights ON
ESP32 drives all lighting relays HIGH at 8:00 AM on weekdays. Occupancy sensors still override if a room is unoccupied — the scheduled ON is a floor-wide baseline, not a hard rule.
-
6:00 PM — Lights OFF
All lighting relays are driven LOW at 6:00 PM. If someone is working late, the motion sensor re-activates lights in their zone only, and those lights auto-off 5 minutes after they leave.
-
HVAC Integration
HVAC relays follow a parallel schedule. Heating starts at 7:00 AM (pre-warm) and cooling at 5:00 PM (pre-cool for the next morning). Setback temperatures apply outside work hours.
-
Weekend Mode
On Saturdays and Sundays, all lights and HVAC remain off by default. Motion sensors still operate for security — any movement triggers lights in the affected zone and sends a notification to the facilities team.
Night Security Schedule
-
10:00 PM — Motion Lights Only
After 10:00 PM, scheduled lighting is fully disabled. The only way lights activate is through motion detection. This keeps energy at near-zero while maintaining basic security illumination.
-
Alert on After-Hours Motion
Any motion event between 10:00 PM and 6:00 AM triggers a push notification to the security team. The notification includes the zone name, timestamp, and a snapshot of current energy consumption for context.
-
Automatic Logging
All after-hours events are logged to the Giantronic audit trail. Review them in the dashboard under Activity Log → Security to track patterns over time.
Schedules are configured at the fleet level and propagate to every device in the fleet. You can override schedules for individual devices if a specific zone has different working hours.
Alerts & Monitoring
Giantronic monitors every registered device continuously. When something goes wrong — a device goes offline, energy consumption spikes unexpectedly, or a relay fails — you receive an alert within seconds.
Fleet Alerts for Offline Devices
Each ESP32 sends a heartbeat to the Giantronic cloud every 60 seconds. If a device misses three consecutive heartbeats (3 minutes), the fleet marks it as offline and fires an alert. This is critical for office environments where a dead device means lights or HVAC stop responding with no visible warning.
Energy Spike Detection
Configure a maximum wattage threshold per floor. If real-time consumption exceeds this threshold for more than 30 seconds, an alert fires. Common causes include equipment left running overnight, HVAC faults, or wiring issues causing ground faults.
Set realistic thresholds. An energy spike alert on a 20 A circuit at 230 V means anything over 4,600 W is abnormal. Set your threshold 10-15% above expected peak load to avoid false positives while catching genuine issues.
Equipment Failure Alerts
Relay modules can fail open or closed. Giantronic detects this by reading a feedback pin (or by comparing expected vs. actual energy draw). If a relay is commanded ON but current doesn't change, the system flags a potential relay failure and notifies the maintenance team.
Alert Configuration
{
"fleet": "floor-1-main",
"alerts": {
"offline_threshold_min": 3,
"energy_spike_watts": 4600,
"spike_duration_sec": 30,
"relay_mismatch_enabled": true,
"after_hours_motion": true,
"notify_channels": ["email", "push", "slack"]
}
}
Always configure multiple notification channels. If the email server goes down, push notifications and Slack messages ensure critical alerts still reach someone on the facilities team.
Cost Savings
The combination of motion-based automation, scheduled shutdowns, and energy tracking delivers measurable, provable savings. Most offices recoup the hardware investment within 3 to 6 months.
Motion Sensors — 30% Lighting Energy Savings
In a typical office, lights burn in empty rooms for 30-40% of working hours. PIR sensors cut this waste entirely. Rooms without occupants have their lights off, while occupied rooms stay lit only while someone is present. Over a quarter, this translates to a 30% reduction in total lighting energy.
Scheduled Shutdown — Eliminate Off-Hours Waste
Without automation, lights and HVAC frequently run overnight, on weekends, and during holidays. Scheduled operations enforce a strict power-down after 6:00 PM and on non-workdays. This eliminates the baseline energy waste that accumulates when humans rely on memory and manual switching. Typical offices report an additional 15-20% reduction from scheduling alone.
Energy Tracking — Identify and Eradicate Waste
You can't fix what you can't see. Per-floor energy tracking surfaces anomalies instantly — a floor drawing 40% more power than its neighbors tells you something is wrong. Common findings include HVAC units running with clogged filters, servers in storage closets left on, and lighting zones stuck in manual override. Fixing these issues typically saves another 5-10%.
Combined savings: 25-40% on total lighting and HVAC energy. For a 200-seat office spending $8,000/month on electricity, that's $2,000–$3,200 in monthly savings — paying for the entire ESP32 fleet in under 3 months.
ROI Summary
| Savings Source | Estimated Reduction | Monthly Savings* |
|---|---|---|
| Motion-based lighting | 30% | $1,200 |
| Scheduled shutdown | 15–20% | $800 |
| Waste identification | 5–10% | $400 |
| Total | 25–40% | $2,400 |
* Based on a 200-seat office with $8,000/month electricity cost.
Next Steps
You've seen the full Office & Workspace setup. Now it's time to dig deeper into the platform and start building your fleet.
Full Documentation
Complete reference for every Giantronic feature — from device onboarding to advanced automation rules.
API Reference
REST API docs for integrating Giantronic with building management systems, custom dashboards, and third-party tools.
Questions about this setup guide? Reach out through the documentation hub or open a support ticket from your dashboard.