Semangoh Park Guard System
IoT intrusion detection for a rainforest wildlife centre — designed on-site, deployed in the field, and built so every alert is one a ranger can act on.
The problem
Semangoh Wildlife Centre sits outside Kuching in the Sarawak rainforest — home to a semi-wild orangutan population and rare, protected plants, some on the verge of extinction and restricted to zones the public can't enter.
Enforcement was manual. Rangers patrol, but a large park with multiple restricted zones and a small team means constant gaps in coverage. When an intrusion happened — a poacher, a visitor ignoring signage, someone interfering with protected flora — there was no early warning, no record, and no data trail for follow-up.
Before designing anything, we visited the park and walked the zones — the humidity, the dense canopy, the wide temperature swings. Any device had to survive those conditions, and any alert had to give rangers something they could act on, not just noise. Most IoT projects are designed from a desk; this one was designed from the terrain.
There was a second problem, too: rangers and guides couldn't always confirm which plant species they were looking at in the field — critical for prioritizing which zones needed attention.
What I built
The intrusion detection device — M5Stack Fire (ESP32)
PIR sensor
Detects physical motion within the monitored perimeter.
ANGLE unit
Detects if the device itself is tilted, moved, or tampered with — a second intrusion signal if someone tries to disable the hardware.
ENV.II sensor
Logs temperature, humidity, and atmospheric pressure continuously.
- Alert deduplication: a PIR sensor outdoors fires repeatedly for as long as motion is in range. A state flag is set on the first alert and cleared only when the reading drops below threshold — so each physical intrusion maps to exactly one database record.
- Rich event payload: sensor type, environmental readings at the moment of detection, and a timestamp — sent as JSON over Wi-Fi to the backend.
- On-device display: the M5Stack screen shows alert type, sensor status, and live environmental readings for staff at the device.
AI plant identification
I trained a classification model on labelled image data to identify rare and endangered plant species. In the app, rangers and guides point their camera at a plant and get an identification with species information — useful for both conservation fieldwork and guided visitor education.
The ranger dashboard (React)
- Real-time alert feed: incident type (motion / device tampered), time, and the environmental conditions logged at that moment.
- Incident log with a timeline view for reviewing historical events.
- Live sensor status and the plant identification interface.
Why I built it this way
Deduplication was a day-one requirement, not a patch
One person crossing a zone slowly keeps a PIR active for 30–60 seconds — potentially dozens of database writes for a single event. A database full of duplicates in week one would have destroyed trust in the system immediately. The boolean flag is simple to implement; deciding to implement it before deployment is what mattered.
Environmental data rides along with every alert
Temperature, humidity, and pressure aren't the detection signal — they're context. A ranger reviewing a 2am alert the next morning sees what the environment was like at that moment. Over time, the dataset surfaces patterns: intrusions correlating with weather, plant stress alongside temperature spikes. One extra sensor read per event buys a rich historical record at zero infrastructure cost.
The site visit shaped the engineering
The restricted zones aren't uniform — some dense canopy, some open ground. Walking them determined where PIR coverage actually works, where ANGLE tamper detection adds value, and what the realistic Wi-Fi range back to the access point is. A desk-designed version would have been optimized for the wrong environment.
Outcome
A deployed intrusion detection system covering restricted zones at Semangoh Wildlife Centre, with real-time alerts piped to a ranger-facing dashboard. Each intrusion generates one clean record with full environmental context. Plant identification is available in-field.
The ENV.II dataset builds passively over time — a growing historical record of conditions across every monitored zone.