Before you go

HNK SafeRoute

Adam Tas Corridor crossing, Stellenbosch · live from device crossing-01
Cloud broker: connecting Device: waiting City link: unknown
Good morning

Know your route before you go

Choose where you are to get your brief.

Checking... Weather, street sensors and trains, in one look.

Next hours

TimeWeatherTempRainGusts
Loading...

Your AI brief

Press the button: the assistant reads the conditions and tells you what to do, in a few sentences.

Warn me while I walk

Sound, vibration and a notification when you near a problem zone.

Weather: Open-Meteo. Street data: your HNK node, live.

Online maps + your street nodes

Plan my route

A safe route: weather, air and street nodes on the way.

No route yetChoose where you are going.

AI route brief

Check a route first, then ask the assistant.

Data: OpenStreetMap, Open-Meteo, RainViewer, Esri and your street node. Map © OpenStreetMap contributors.

The street node

LEFT
Waiting
Mode--
Train--
Railway gate--
Car at barrier--
Car barrier--
Trains / cars counted--
Tunnel (PIR)--
RFID reader--
RIGHT

Device screen

Live copy of the screen on the pole.

People crossing

Waiting now--nobody waiting
Average wait--sent to the city as wait_s
Last wait--press to red
Crossings served---- button presses

Environment

Road temperature----
Humidity--DHT11 sensor
Gas / smoke----
Soil moisture----
Daylight--lamp --

Priority crossing (RFID)

A registered fob gives a longer walk. Other cards work like the button.

Reader--PN532 UART on D27 / D12
Cards tapped---- priority
Last card----
Registered fobs--ready
WALK time--normal
Press "Register next card", then tap the fob on the reader within 20 s.

Live map

Who is near the crossing, live. Risky crossings are logged. Location only if you share it.

Press "Share my location" on a phone to appear here.

Zones

Crossing zone (30 m): on the road and the railway
Approach zone (120 m): about to cross
You  Others  Simulated

People now 0

Nobody is sharing a location yet.

Infractions 0

None so far.

Controls

Closes the crossing for 8 s, like a real train.

Gates move only in maintenance tests, never onto a train.

Data export (CSV)

Readings are saved in this browser (last 3,000). Download them as CSV.

0readings
0events
0infractions
0self-test results
No readings recorded yet.

Event log

Ask the crossing

AI assistant (Gemini 3.8 Flash). It sees the live crossing data with every question.

Hi, I'm the SafeRoute crossing assistant. Ask me about the trains, the wait times, the environment or how the system works.
AI face call

RoboFace Live

Meet SafeRoute

The crossing's robot companion. It sees you through your camera, hears your questions and answers out loud, using the live data from the crossing.

Allow the camera and microphone when the browser asks. Works best in Chrome or Edge.

Sees what you show it

Each question sends a camera frame: show it what you mean.

Voice conversation

Just talk. Tap the face to interrupt.

Knows the crossing

It reads the live state: robots, train, gates, tunnel guard, temperature, gas and wait times.

Has a personality

It blinks, looks around, smiles, winks and thinks visibly while it works out an answer.

Email alerts

Send an email when something needs attention
  • Fire or gas emergency at the crossing
  • Flooded path or ice risk on the road
  • Train on the crossing for more than 60 s
  • Device offline for more than 60 s

One email per alert type every 10 min at most. Keep this page open.

Hardware test

tests locked Tests run only in maintenance mode, so the crossing is out of service while you test.

Robots (both lanes)

Lights

Buzzer

Railway gate

Car barrier

Whole crossing

Tests last 3 s (sweeps 6 s). Device reply: --

Takes about 90 s. Stand by the device and watch and listen.

Boot self-test

no results yet Runs on its own after every reset: 5 s per part, the Serial Monitor says what to do.
PartResultDetail
Reset the ESP32, or press "Run self-test again" in maintenance mode.

Inputs: check each one on the real device

PartReading nowHow to check itResult
DHT temperature--Breathe on it or hold it, temperature and humidity rise--
MQ-5 gas--Unlit lighter gas near it, the value jumps--
Soil moisture--Dip the probe in water, it rises--
LDR light--Cover it with your hand, it drops--
Train sensor (IR)--Pass a hand 1 cm in front of the IR sensor: train detected--
RFID reader (PN532)--Tap the blue fob or any card on the reader--
PIR tunnel guard--Walk in front of it (wait 45 s after power-up)--
Button 1 pedestrian--Press it on the device--
Button 2 railway gate--Press it on the device--
Button 3 car barrier--Press it on the device--
Button 4 street lamp--Press it on the device--
WiFi signal--Better than -75 dBm is solid--
City mainframe link--Needs CITY_HOST in config.h--

Pinout

ESP32 DevKit V1, top view, USB at the bottom.

LightsInputsOutputs EnvironmentPowerBoardFree

Power

Laptop USB powers the ESP32 (3V3 pin feeds DHT, soil, LDR, buzzer, OLED).
Breadboard 5V rail (power module) feeds both servos, MQ-5 and PIR. Use a power bank or adapter, a 9 V battery runs flat fast.
One GND wire joins ESP32 GND to the breadboard GND rail. Never join the two 5V supplies.

Pin connections

Labels as on the board. Buttons: pin to GND. One resistor per LED.

PinPartWiringExtra part
Traffic robots (left and right lane share pins)
D25RED, both robotsD25 → 220Ω → LED → GND, twice2 × 220Ω
D26ORANGE, both robotsD26 → 220Ω → LED → GND, twice2 × 220Ω
D33BLUE, both robotsD33 → 100Ω → LED → GND, twice2 × 100Ω
Push buttons
D13Button 1, pedestrianD13 ↔ button ↔ GNDnone
D18Button 2, railway gateD18 ↔ button ↔ GNDnone
D19Button 3, car barrier (hold 3 s = emergency)D19 ↔ button ↔ GNDnone
D21Button 4, street lamp (hold 3 s = maintenance)D21 ↔ button ↔ GNDnone
Train sensor and gates
VNIR train sensor (TCRT5000 module, 3 pins)OUT → VN, VCC → 3V3, GND → GND; train = OUT goes LOW (range about 1 cm, blue knob)none
RX2Servo, car barrierorange → RX2, red → breadboard 5V rail, brown → GNDnone
TX2Servo, railway gateorange → TX2, red → breadboard 5V rail, brown → GNDnone
Environment
D4DHT temperature + humidity (3-pin module)S → D4, + (middle) → 3V3, − → GNDnone (pull-up on the module)
D34MQ-5 gasAO → 10kΩ → D34 → 10kΩ → GND, VCC → breadboard 5V rail2 × 10kΩ
D35Soil moistureAO → D35, VCC → 3V3, GND → GNDnone
D32LDR light sensor3V3 → LDR → D32 → 10kΩ → GND10kΩ
D22Street lamp LEDD22 → 220Ω → LED → GND220Ω
D23Buzzer module, 3 pins (− , middle, S)S → D23, middle (+) → 5V rail (louder) or 3V3, − → GNDnone
OLED screen (0.96" SSD1306, 7-pin SPI)
D14OLED SCL (clock)SCL → D14none
D15OLED SDA (data)SDA → D15none
D5OLED DCDC → D5; RES → EN; CS → GND; VCC → 3V3; GND → GNDnone
VPPIR tunnel guard (HC-SR501)OUT → VP, VCC → 5V rail, GND → GNDnone
D2Status LEDonboard, nothing to wirenone
RFID reader (Elechouse PN532 V3, UART / HSU mode)
D27RFID TXD (hole marked SDA)SDA/TXD → D27, the ESP32 receives (was the ultrasonic TRIG, free with the IR sensor)none
D12RFID RXD (hole marked SCL)SCL/RXD → D12, the ESP32 sends; VCC → 3V3, GND → GND; BOTH DIP switches OFF (HSU). D12 is safe because this board's flash voltage eFuse is set to 3.3 Vnone
Power
3V33.3V railDHT11, soil moisture, LDR, buzzer, OLED, IR sensor, RFID reader
5V railBreadboard power supply, jumper on 5V9V battery clip → its barrel jack; 5V rail → both servos, MQ-5 VCC, PIR VCCsupply module
USBESP32 powerlaptop USB powers the ESP32; do NOT also link VIN to the 5V rail
GNDCommon groundESP32 GND → breadboard GND rail: the only wire between the two supplies
VINRun without the laptopunplug USB first, then VIN → breadboard 5V rail
Reserved / free
D14Used by the OLED (was for ultrasonic 2, car)VP is now used by the PIR

Device console

Live device log, plus what this website does.

Waiting for the device. Lines appear here as soon as the ESP32 is on WiFi.

Serial Monitor commands (115200 baud, type a letter then Enter)

hlist the commands
pfull status line now
vraw sensor values
nmenormal, maintenance, emergency
1to4act as buttons 1 to 4
trun the boot self-test again
sskip the rest of a self-test

Gallery

Concept art (AI), real hardware and drawings. Tap to enlarge.

Terms and privacy

Updated 4 October 2026. Using this site means you accept these terms.

1. What this is

A prototype by HNK IoT Solutions (Pty) Ltd, Cape Town. Not yet a commercial service.

2. Not a safety system

Never rely on SafeRoute to decide when to cross. Follow the real signals and barriers. Data can be late or wrong.

3. Your location

Your location shows only after you press "Share my location", only while the page is open, with a random name.

4. What data is used

  • The crossing uses no cameras and stores no names. It counts presses, wait times, trains and sensor readings.
  • RFID: only the card number is stored, no personal details.
  • Readings and settings stay in your browser. Clear them any time.
  • Live data: HiveMQ Cloud. Weather: Open-Meteo. Your position is not stored.

5. AI assistant and RoboFace Live

AI questions and photos go to Google Gemini. Do not send private photos. Answers are advice only.

6. Email alerts

Alert emails (Formspree) carry device readings only, never visitor data.

7. Your rights (POPIA)

POPIA: as little data as possible, with your consent. Ask us to see or delete yours.

8. Fair use

Do not misuse the controls or services. We may block abuse.

9. Ownership

SafeRoute is by HNK IoT Solutions. AI pictures are labelled. Map data © OpenStreetMap contributors.

10. No warranty

Provided "as is", without warranty.

11. Changes and contact

Questions: [email protected] · hnkiot.com

About HNK SafeRoute

Know your route before you go. Street sensors, live weather and AI in one place.

A pedestrian checks SafeRoute on a phone at a railway crossing at dawn (concept illustration made with AI)
Henock Mukonkole
Henock Mukonkole Founder, HNK IoT Solutions (Pty) Ltd · Cape Town [email protected]
Features: morning brief, route planner, walking alerts, train warning, air quality, rain radar, RFID priority, AI assistant
How SafeRoute works: street nodes send live data to the cloud and AI, which send a morning brief and zone alerts to your phone
Street nodes, the cloud and AI, and you.

Before you go

Weather, air and street sensors in one spoken brief.

Plan my route

Walking or cycling routes, checked for weather and hazards.

While you walk

Your phone warns you near a problem zone.

The street node

One ESP32: robots, gates, train sensors, RFID, gas, flood and heat.

Privacy

No cameras, no names. Location only when you share it.

Coming next

  • Live traffic
  • More street nodes
  • Camera hazard check
  • Solar + LoRaWAN

Cloud broker

Brokereeb1e83a06da4b44b7a340bc19cd1e75.s1.eu.hivemq.cloud (HiveMQ Cloud)
Device port8883 MQTT over TLS
Website port8884 MQTT over secure WebSocket, path /mqtt
State topicion4/crossing/state, full JSON every 5 s
Command topicion4/crossing/cmd, for example {"cmd":"mode","val":"maintenance"}, {"cmd":"test","val":"train_drill"}, {"cmd":"self_test","val":"run"}
People topicion4/crossing/people, phone positions from the Live map: {"id","name","lat","lng","acc"}
Log topicion4/crossing/log, one line of text per device event (the Device console page)
City mainframehack/qsoju/crossing-01/telemetry every 30 s and hack/qsoju/crossing-01/status (retained), on the Octoco broker