<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: murat avcı</title>
    <description>The latest articles on DEV Community by murat avcı (@muratavci).</description>
    <link>https://dev.to/muratavci</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4252494%2Fffbda2cc-eb5d-4d35-8ac6-5bcad4cd440d.jpg</url>
      <title>DEV Community: murat avcı</title>
      <link>https://dev.to/muratavci</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/muratavci"/>
    <language>en</language>
    <item>
      <title>DriveSignal: From a Live Eye Signal to a Simulated Roadside Stop</title>
      <dc:creator>murat avcı</dc:creator>
      <pubDate>Sun, 22 Nov 2026 15:10:27 +0000</pubDate>
      <link>https://dev.to/muratavci/drivesignal-from-a-live-eye-signal-to-a-simulated-roadside-stop-3o3l</link>
      <guid>https://dev.to/muratavci/drivesignal-from-a-live-eye-signal-to-a-simulated-roadside-stop-3o3l</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/presage-2026-11-04/"&gt;Presage SmartSpectra SDK Challenge&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;DriveSignal is a desk prototype of a driver monitoring cockpit. Its virtual vehicle displays speed, hazard lights, eye signals and alert stages in one view. Reviewers can play the driving demo with the camera off, acknowledge the stronger warning to see the driver's response, or let the demo continue to a simulated roadside stop. The live SmartSpectra mode uses a participant's consented camera measurement and personal eye calibration.&lt;/p&gt;

&lt;p&gt;The dashboard plots both eye measurements over the last eight seconds and keeps the count and last trigger visible after the camera stops. Decision cards explain which signal can trigger an alert and which provides context. A separate experiment compares mouth measurements during speech, laughter, ordinary mouth opening, and a simulated yawn. DriveSignal is designed for use at a desk and has no vehicle integration.&lt;/p&gt;

&lt;p&gt;A guided 40-second run aligns those decisions with five prompted movements. Its report compares the expected and actual cue and alert counts for each movement and marks tracking interruptions explicitly. This makes scenarios with unintended alerts visible during review.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Decision timeline&lt;/strong&gt; shows when each eye crosses its personal threshold, when tracking drops, and which evidence led to an alert or a simulated stop. Live monitoring, synthetic playback and imported traces run through the same decision engine. In the latest live cockpit test, the first warning was recorded at 2.03 seconds, escalation at 3.52 seconds and the simulated stop request at 5.03 seconds. The slow-closure check recorded separate low-opening intervals of 1.50 and 6.10 seconds. The second interval triggered the sustained-closure response. A new paced check tests the advisory with two timed closures and reports how many the rule counted. The paced flow passed with synthetic samples. Live advisory validation remains open.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;20-second live drive test&lt;/strong&gt; puts the same decisions on a reviewer's own face. After camera consent and personal calibration, one button starts six prompts on the cockpit windshield: talk normally, look at the camera, squint, yawn, look away, then close your eyes and keep them closed. DriveSignal should stay calm through the first five. In the last one, the virtual vehicle slows from 50 to 40 km/h at the first alert and to 30 km/h at the pull-over warning, announces that it is pulling over at five seconds, and brakes to a stop with the hazard lights on. The report lists each step with its expected outcome and what was measured: alerts, yawn-like cues, tracking interruptions and the lowest eye opening. Each step is judged on its decisions. Yawn-like mouth cues are shown as context, not as a pass criterion: in my own live runs, one yawn was recognised and another widened the mouth corners enough to look like a wide opening, which mouth geometry alone cannot resolve. An on-device voice can read the prompts aloud, so the driver knows when to open their eyes again.&lt;/p&gt;

&lt;p&gt;When a scenario ends, the cockpit windshield answers the driver's obvious question in plain language: &lt;strong&gt;why did the vehicle stop?&lt;/strong&gt; It lists each decision with its time, from the early warning and the first alert to the missing acknowledgement and the simulated stop. If the driver acknowledged the warning, it explains why the vehicle kept driving instead. The same explanation appears after a live simulated stop.&lt;/p&gt;

&lt;p&gt;I found this challenge on a Thursday evening, started building on Friday morning and completed DriveSignal solo by Sunday, directing AI coding agents and running the live desk tests myself and with a second adult participant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/RFu7wprO0-A" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The video is one continuous screen recording with sound. It opens with the camera-free driving demo: the virtual vehicle slows down through the alert stages, pulls over with the hazard lights on, and the windshield explains why it stopped. I then give camera consent, calibrate my eyes and run the 20-second live drive test with Presage SmartSpectra. Talking, looking at the camera, squinting, yawning and looking away leave the vehicle cruising. When I keep my eyes closed, it slows from 50 to 40 and then 30 km/h, announces that it is pulling over and stops. The report shows 6 of 6 steps as expected. The video ends with the engineering and privacy notes and with me stopping the camera.&lt;/p&gt;

&lt;p&gt;The small face view in the corner is a separate camera preview I added for the recording so viewers can see the movements. DriveSignal itself never shows or records camera images.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/muratavci05" rel="noopener noreferrer"&gt;
        muratavci05
      &lt;/a&gt; / &lt;a href="https://github.com/muratavci05/drivesignal" rel="noopener noreferrer"&gt;
        drivesignal
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Driver monitoring desk prototype with Presage SmartSpectra: personal eye calibration, explainable alerts, a 20-second live drive test and a simulated roadside stop.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;DriveSignal&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;DriveSignal is a desk-based prototype inspired by driver attention alerts. In SmartSpectra mode, it shows the live SDK blink signal and uses face landmarks to compare eye opening against a personal calibration. The optional demo gives its first alert after two continuous seconds under both personal thresholds. At 3.5 seconds, it shows a more prominent warning, plays a distinct tone if available, and requests vibration on devices that support it. The count, last trigger, and any escalation stay visible after the camera stops.&lt;/p&gt;
&lt;p&gt;Start with &lt;strong&gt;Play driving demo&lt;/strong&gt; in the cockpit. The simulated vehicle, eye graph, speed and warnings share one view. During the stronger warning, select &lt;strong&gt;Acknowledge alert&lt;/strong&gt; to see the driver-response branch. Let the same warning run without an acknowledgement to see the vehicle pull over with the hazard lights on. Both branches run from example data with the camera off. When the demo ends, the windshield…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/muratavci05/drivesignal" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Repository: &lt;a href="https://github.com/muratavci05/drivesignal" rel="noopener noreferrer"&gt;https://github.com/muratavci05/drivesignal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On a supported machine with Node.js 20 or later, run &lt;code&gt;npm ci&lt;/code&gt; and &lt;code&gt;npm start&lt;/code&gt;. Open &lt;code&gt;http://127.0.0.1:3847/&lt;/code&gt; and follow the English quick start in the README. The dashboard opens in English by default, with German and Turkish available in the language menu. Live SmartSpectra mode requires your own Presage key and available credits.&lt;/p&gt;

&lt;p&gt;The decision rules and trace reader are independent of the browser views and the camera provider. The same decision engine handles live measurements and replay. The repository includes an architecture guide and one verification command, &lt;code&gt;npm run check&lt;/code&gt;. It type-checks the JavaScript sources with TypeScript, runs the unit and workflow tests (including a complete live drive test from countdown to the stopped vehicle), runs property tests that drive 1,500 seeded random sessions through the decision engine, and starts the server against an SDK double. A GitHub Actions workflow runs the same checks on Node 20 and 22.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Responds to Human Signals
&lt;/h2&gt;

&lt;p&gt;The Node.js app requests &lt;code&gt;faceMetrics&lt;/code&gt; from the SmartSpectra SDK. It decodes the live blink events and face landmarks, then sends measurements to the local dashboard. A blink updates a counter in real time. The app also calculates eye opening from landmarks and estimates a threshold for each eye from separate open and closed samples.&lt;/p&gt;

&lt;p&gt;Once the participant enables the demo, two continuous seconds below both personal eye thresholds trigger an on-screen alert and a tone if available. At 3.5 seconds of sustained low opening, the simulation shows a take-a-break message, changes the tone, and requests vibration where supported. Tracking loss or an interruption at the threshold resets the timer. Mouth opening, duration and width can flag a movement as yawn-like context, with no alert from the mouth cue. The timing settings and mouth rules are experimental. The project has no validated estimates of fatigue, drowsiness, or driving safety.&lt;/p&gt;

&lt;p&gt;If the signal continues for five seconds without an acknowledgement, the dashboard turns on the virtual hazard lights and animates the vehicle pulling over and stopping. An acknowledgement or tracking loss before the request prevents the action. This browser simulation can also be played with the camera off.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;DriveSignal remains a desk prototype. These are the next steps I would explore. Each builds on signals the app already handles, and none of them would diagnose a condition or make a medical decision.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Breathing and pulse as early-warning context.&lt;/strong&gt; SmartSpectra measures breathing rate and pulse without contact. A slowing breathing rhythm alongside repeated slow eye closures could support the early notice before a sustained closure begins. These signals would add context to the eye-based decision and never trigger an alert on their own. They would need validation against independently labeled simulator data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A 30-second readiness check before driving.&lt;/strong&gt; The driver looks at the camera before setting off. The app compares blink rate and eye opening with that driver's own calibration and says when today's readings differ from their usual pattern. The check informs the driver. It does not decide whether they may drive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A summary of the whole drive.&lt;/strong&gt; The cockpit already explains the latest alert episode. A summary after the drive would cover every episode in the same plain language.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A personal fatigue pattern that the driver owns.&lt;/strong&gt; With explicit consent, stored only on the driver's device and deletable at any time, repeated sessions could show when slow closures tend to increase, for example late at night or after long drives.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Thoughtful Real-World Use.&lt;/strong&gt; Driver attention alerts inspired this desk demo. I focused on three things a participant can see and control: when the camera is on, how their personal baseline is measured, and when the app has enough data to trigger an alert.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consent and Data Handling
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The camera starts off. Participants read the camera notice, check the consent box, and start the camera themselves. They can stop it at any time. The local server stops SmartSpectra capture about five seconds after the last dashboard disconnects.&lt;/li&gt;
&lt;li&gt;DriveSignal does not store camera footage. The server keeps live measurements in process memory, and the dashboard keeps calibration, trial measurements, and alert counts in page memory. Reloading or closing the page clears its records. Closing the server clears process memory.&lt;/li&gt;
&lt;li&gt;The participant can export recorded comparison trials to a local JSON file. The export includes eye and mouth ratios and session participant numbers. Delete the downloaded file to remove that copy. DriveSignal does not upload the export.&lt;/li&gt;
&lt;li&gt;The optional decision trace contains relative sample timestamps, experimental eye and mouth ratios, calibration, and decision inputs. It excludes camera frames and credentials. To share a trace, obtain the participant’s consent. Replay reads the file locally.&lt;/li&gt;
&lt;li&gt;Two adults took part in the live desk tests: me and a friend who gave verbal consent to the camera test. She repeated the eye, speech, yawn and eye-closure trials three times. No camera footage was recorded, and she does not appear in the demo video. No names or other identity details were collected; the app labels sessions only with a participant number that resets when the page reloads.&lt;/li&gt;
&lt;li&gt;The app configures SmartSpectra with &lt;code&gt;enableTelemetry: false&lt;/code&gt;. Presage authentication and other SDK service requests can still require a connection. See the &lt;a href="https://smartspectra.presagetech.com/docs/telemetry-and-privacy" rel="noopener noreferrer"&gt;SmartSpectra SDK privacy documentation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;An optional MediaPipe mode processes camera measurements in the browser with a separately downloaded model. The live flow does not call an LLM or an external AI inference service from the app.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The live demo uses the &lt;a href="https://smartspectra.presagetech.com/docs/nodejs/" rel="noopener noreferrer"&gt;Presage SmartSpectra Node.js SDK&lt;/a&gt;. The optional local mode uses &lt;a href="https://developers.google.com/edge/mediapipe/solutions/vision/face_landmarker" rel="noopener noreferrer"&gt;Google MediaPipe Face Landmarker&lt;/a&gt;. I built this as a solo project. I defined the driver-warning concept, directed development through prompts with Codex, used Claude Code for the final quality review and improvements, and ran the live desk tests myself and with a second consenting adult participant.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>presagechallenge</category>
    </item>
  </channel>
</rss>
