Back to Kitchen Monitoring

Sentrava hardware setup

Use USB serial for sensor telemetry and a reachable HTTPS snapshot endpoint for an ESP32-CAM. Set up and verify each connection with the prototype before relying on the resulting dashboard information.

Arduino or ESP32

  1. Preserve a copy of your existing sketch. For a telemetry-only bench test, save SentravaSerial.ino in a folder named SentravaSerial. Open it in Arduino IDE and select the exact ESP32 or classic Arduino AVR board and port. Configure only pins and signal polarity verified against your specific modules. The starter ships with all inputs disabled. Install Adafruit’s DHT sensor library if you enable a DHT11.
  2. For an existing sketch, add the JSON output below after reading your sensors. Keep the board’s existing safety logic independent of the browser. Print a complete object and a newline for each sample, using a unique device ID for each board and the same ID across its sessions.
  3. Open the website over HTTPS or localhost in desktop Chrome or Edge. Plug in the board and close other programs using the port. Open Connect Hardware, match the baud rate, and choose the board’s USB port. This grants access for this origin. A previously approved port reconnects on later visits and on plug-in when its identified device can be matched. If several approved ports match, choose the correct one again. Disconnect USB clears Sentrava’s saved selection.
  4. Confirm the device ID and accepted frame count under Device diagnostics. Open Sensor health to see the measurements the board has reported.

Telemetry format · version 1

{"type":"telemetry","version":1,"deviceId":"sentrava-kitchen-01","adcMax":1023,"ts":123456,"seq":123,"readings":{"gas":128,"temperature":23.4,"humidity":45,"flame":false,"smoke":false,"waterLeak":false}}

Example values illustrate the format. Send only configured readings. A version 1 frame may also report health entries using offline or faulty for individual keys. The starter sends one frame per second and includes board ADC metadata, elapsed milliseconds and a sequence counter. The simple flat JSON format is accepted after manual port selection. Use version 1 and a stable device ID for automatic reconnect.

KeyFormat
gasRaw integer ADC counts
temperatureNumber in °C
humidityRelative humidity as a number from 0 to 100
flame, smoke, waterLeakBoolean, true when the device reports detection
waterPressureNumber in kPa

A version 1 frame can optionally include dashboard thresholds, for example {"thresholds":{"temperature":{"high":[40,46,50]}}}. Inside the telemetry frame, use the sensor key and an optional high or low array. Each array contains the elevated, near-alarm, and alarm boundaries in that order. Upper limits must increase and lower limits must decrease. These numbers illustrate the format.

Send limits in the same units as the transmitted readings. For gas, use raw ADC counts for the controller and sensor configuration. An adjustment in the browser changes the displayed value and leaves the supplied status boundaries in raw units. Limits are retained for the current connection. A null entry clears that sensor’s limits. Numeric readings without limits appear as Not configured.

Use one JSON object per line, up to 4096 characters, and a device ID of 1–48 letters, digits, underscores or hyphens. The dashboard marks sensors offline after 15 seconds without a fresh sample. If the board supplies a supported ADC range, a gas input pinned at either end for 60 seconds is flagged as faulty. Normal, steady digital readings do not establish a fault or prove detector operation. Charts show received numeric readings or their display-adjusted values. The raw panel preserves received values for inspection.

Demo mode and diagnostics

Use Demo scenario to exercise simulated flame, smoke, disconnection and fault states. Test everything checks the synthetic scenarios in Demo mode. Hardware mode checks received data and can probe a configured HTTPS snapshot endpoint. It cannot confirm physical sensor response or alarm, shutoff or suppression behavior. Board and sensor module identification are required before a pin-specific wiring diagram can be verified.

Sensor configuration and calibration

Choose a discovered sensor to set its display name and visibility. For a numeric sensor, capture the raw reading at a known reference or enter an observed value from a controlled test. Use a second known point when scale and offset both need adjustment.

The gas option subtracts a recorded baseline and displays the change in ADC counts. A suitable gas calibration procedure and reference equipment are needed to report a gas concentration. Dashboard adjustments are stored per device ID in this browser and affect display values and chart history.

ESP32-CAM

Provide an HTTPS URL that returns a single JPEG, PNG or WebP image. The endpoint must be reachable from the browser and allow this site’s origin with Access-Control-Allow-Origin. A local camera that serves HTTP can be reached through a properly secured HTTPS reverse proxy. Consult the Espressif camera driver for the capture interface.

Use Reference images for manual comparison. To correct lens geometry, capture at least eight clear photos of a checkerboard from varied positions at the same resolution as the camera, then run the calibration utility with OpenCV installed. Count the checkerboard’s inner corners.

python -m pip install opencv-python
python calibrate_camera.py --cols 9 --rows 6 --output camera.json capture01.jpg capture02.jpg capture03.jpg capture04.jpg capture05.jpg capture06.jpg capture07.jpg capture08.jpg

Import camera.json in Camera geometry. Review the correction against a reference image. Camera geometry and sensor calibration are separate from image-based classification.

References Chrome Web Serial · Winsen MQ-2 · OpenCV camera calibration