Skip to content

Lab: Build a Virtual Device and Event Script

Course 2 · Module 3 Type: Hands-on (Virtual Device + optional Blender → GLB) Suggested time: ~3–3.5 hours for the Virtual Device (+ ~1–1.5 hours for Lab E)

Read first: Lesson · Device checklist · Blender cheatsheet · Template · ← Table of Contents · ← M02 · M04 →

Document Use when
M02 lab Getting a Studio / Simulator session ready
Hackathon Scene presets / web-app evidence
Course 1 M05 What the sensor values mean
Blender Manual 4.5 Modeling / Texturing / Animation
INC111-2021 playlist (Thai) A Thai-language video tutorial
ternion-3d-assets-free Sample GLB / textures

  • Have a Virtual Device with at least 2 kinds of sensor defined
  • Have at least 1 behaviour path (an input → an observable state)
  • Have a repeatable event script/timeline, with the result visible in the visualization
  • Fill in device-model-checklist.md
  • (Recommended) a short Blender exercise: model, or texture, or animation → export GLB

Suggested time: ~3–3.5 hours (the Virtual Device) + ~1–1.5 hours (Lab E Blender, if done)


  • Lab M02 passed (you can open Bitstream Studio)
  • Choose a path: Simulator and/or a board that can stream
  • Have a lab-notes/ folder for model files + evidence
  • (Lab E) install Blender

  1. Copy sample-virtual-device.template.json to your own file, such as lab-notes/device-model.json
  2. Set deviceId / displayName to something your team can recognise
  3. Enable at least 2 sensor kinds from: switch, temperature/pressure, IMU
  4. Set default and the min/max range (or equivalent) sensibly
  5. Name at least 1 actuator (an LED / a flag / a log sink)

On the host: open the Simulator or a board, then choose a scene matching the model (such as Lab Quiet for a slow demo, Motion when there’s an IMU)

Pass when: the model file reads sensibly, and the host shows at least one value related to the sensors you chose


Define and demonstrate at least one rule, such as:

  • A command/button → an LED, or a UI status
  • Temperature over a threshold → an event / a log message / a mode change

Write it as a WHEN … THEN … sentence in the checklist

Pass when: a teammate can trigger the input and point to the result on screen without guessing


Write a timeline of at least 4 beats (see the example in the lesson), then actually run it:

  1. Start from the default values / Lab Quiet
  2. Trigger a scalar or a switch at a set time
  3. Trigger the IMU, or switch to Motion (if the model has an IMU)
  4. Record what you saw (before/after screenshots, or a short clip)

You may run it with a stopwatch + by hand if the tool has no automatic script file yet — but it must be repeatable on a second round.

Pass when: rerunning the script gives roughly the same sequence of results


  • Add a second behaviour (a threshold + a command)
  • Compare the Lab Quiet vs Motion scene on the same sensor set
  • Open the Hackathon web-app/ as an outer Visualization screen

Use blender-twin-cheatsheet.md as your link map. A Thai-language tutorial: the INC111-2021 playlist

Choose at least one track to complete:

  1. Install Blender
  2. Build a simple part (a box case / a flat board) from a mesh primitive
  3. Use Extrude / Bevel / Mirror per the Modeling intro
  4. Set the origin + Apply Scale
  1. Unwrap the UV (UV unwrapping)
  2. Add Principled BSDF + a Base Color
  3. (Optional) use a texture from ternion-3d-assets-free textures
  1. Keyframe a rotation or a lid opening for 2–3 seconds (Keyframes)
  2. Play it in the Timeline to see it clearly
  1. Export → glTF 2.0 → .glb per the glTF exporter
  2. Load it into Bitstream Studio (or compare it against a model in the free assets)
  3. Record a screenshot + the .glb filename in the checklist

Pass when (Lab E): there is a .glb file and evidence it opens in the host, or at least opens again in Blender after re-importing


  • device-model.json (or equivalent)
  • Labs A–C passed
  • device-model-checklist.md filled in completely
  • Evidence the script ran (an image/clip)
  • (Recommended) Lab D
  • (Recommended) Lab E + a .glb

Symptom Approach
The model is written but the screen doesn’t change Not Linked yet / it’s in a different mode, Simulator vs Bitstream
The IMU doesn’t move You’re on the Environment or Lab Quiet scene — switch to Motion, or trigger per the script
A behaviour shows no result You haven’t clearly set an observation point (LED/UI/log)
The values look too “fake” Normal for the Simulator — note in the model that it’s synthetic
Can’t reproduce a run Write times in seconds, and always start from the same default
The GLB has no texture You forgot the UV / didn’t use Principled / turned off Materials on export — see glTF materials
The GLB has no animation The Action wasn’t active / Animation wasn’t turned on for export
The model is too big in Studio Reduce subdivision · decimate · check the scale

Lesson · Device checklist · Blender cheatsheet · Table of Contents · M04 →

Cite this lesson

If you teach from this lesson or reuse it in slides or documents, credit it with the text below. If you changed it, add (adapted) after the title.

"Lab: Build a Virtual Device and Event Script" from TESA Open Knowledge by the Thai Embedded Systems Association (TESA), https://github.com/tesaiot/tesa-qualification-program, licensed under CC BY-NC 4.0

Thai attribution: "แล็บ: สร้าง Virtual Device และ event script" จาก TESA Open Knowledge โดยสมาคมสมองกลฝังตัวไทย (Thai Embedded Systems Association: TESA) https://github.com/tesaiot/tesa-qualification-program สัญญาอนุญาต CC BY-NC 4.0

Lesson link: https://tesaiot.github.io/tesa-qualification-program/en/courses/digital-twin/m03-virtual-device/l02-lab/

This lesson adapts the source below; keep its credit too.
https://github.com/drsanti/TESAIoT-Courses/blob/287c21814ba8c75f693136616dcd270349a15966/C2/M03/lab.md · Original content by Asst. Prof. Dr. Santi Nuratch (ผศ.ดร.สันติ นุราช), KMUTT. Course 2 (C2/) of drsanti/TESAIoT-Courses. TESA funded the work and holds the rights; published here under CC BY-NC 4.0. The upstream repository carries no licence file. Text kept faithful; structure, front matter, quizzes and notes added by TESA Open Knowledge.

Full guide: how to cite TESA

TESA Open Knowledge · © 2026 สมาคมสมองกลฝังตัวไทย (TESA) · CC BY-NC 4.0

Content is licensed CC BY-NC 4.0. Reuse it non-commercially and credit the Thai Embedded Systems Association (TESA) every time. · How to cite TESA