# AnyScan209 — AI Context Document

> **Purpose:** This file provides complete context about the AnyScan209 project for AI assistants,
> developers, translators, and content generators. Read this before working on any AnyScan209 task.

---

## 1. Project Identity

| Field | Value |
|---|---|
| **App Name** | AnyScan209 |
| **Package Name** | `any.scan_209` |
| **Latest Version** | 2.01 |
| **Release Date** | 2026-09-21 |
| **Platform** | Android |
| **Category** | ScienceApplication / Universal Sensor Data Visualizer |
| **Author / Publisher** | Saeid Moghadam |
| **Contact Email** | ssmqqmss@gmail.com |
| **Official Website** | https://soifgo.github.io/AnyScan209/ |
| **GitHub Repository** | https://github.com/soifgo/AnyScan209 |
| **Community Forum** | https://github.com/soifgo/AnyScan209/discussions |
| **License / Price** | 100% Free — No ads, no in-app purchases, no data collection |
| **Copyright** | ©2025–2026 AnyScan209 — Built by Saeid Moghadam |
| **Primary Language** | English (Persian also supported natively) |
| **Supported Languages (UI)** | 42 languages via translate.js (see §9) |

---

## 2. One-Line Summary

AnyScan209 is a **free Android app** that turns a smartphone into a **universal 2D/3D sensor visualizer** for four internal sensors (magnetometer, barometer/altimeter, light, sound) and any external **0–1024** sensor data (Arduino/ESP via Bluetooth HC-05, plus the open **Live Scan** protocol for single- or four-sensor scanners), with export to **OBJ, STL, CSV, PLY**. The magnetometer mode also includes **DC/AC current measurement** (ammeter + calibration).

---

## 3. Core Concept — The 0–1024 Range

Everything in AnyScan209 revolves around a single normalized data range: **0 to 1024**.

- **512** = neutral / center / balance point (especially in magnetometer mode)
- All four internal sensors are mapped into this range
- All external sensor data **must be pre-scaled by the user** to 0–1024 before sending via Bluetooth
- 2D/3D visualization, color palettes, gain, and export all operate on this range

### Gain (Internal Sensors Only)
- Smartphone magnetometers are typically **16-bit** (raw range **0–65,535**)
- **Gain** factor maps raw → 0–1024
- **Default Gain = 10** → neutral point 512, max sensitivity (auto-balanced via Balancer ⚖️ icon)
- **Lower Gain (9 → 1)** → less sensitivity, wider coverage
- At **Gain = 1**, every **64 raw units** = **1 unit** in the 0–1024 range
- External mode applies **no internal gain** — user must pre-scale

---

## 4. Four Internal Sensor Modes

Switching sensors: **Long-press the sensor icon** on the **Settings** page → select from list.

### 4.1 🧲 Magnetometer (default)
- **Uses:** compass/magnetometer sensor
- **Applications:** geophysical surveys, cavity/void detection, geological exploration, magnetic field visualization, metal & wire detection, educational experiments
- **Users:** researchers, geophysicists, treasure hunters, DIY enthusiasts
- **Note:** AC magnetic fields cause bidirectional gauge movement; DC fields cause one-directional deflection

### 4.2 ⛰️ Barometer / Altimeter
- **Uses:** barometric pressure sensor
- **Applications:** altitude measurement, surface topography mapping, floor-level surveys, outdoor elevation mapping
- **⚠️ WARNING:** Not all phones have a real barometer. The option may appear but return constant/no readings on budget devices. Most flagship and mid-to-high-end phones include a real barometer.

### 4.3 💡 Light Sensor
- **Uses:** ambient light sensor
- **Applications:** light intensity surveying, lighting installation analysis, greenhouse/agricultural mapping, photography/studio lighting, architectural lighting design
- **Users:** lighting engineers, greenhouse operators, photographers

### 4.4 🔊 Sound / Noise Meter
- **Uses:** microphone (SPL meter)
- **Applications:** noise mapping, industrial noise analysis, acoustic environment surveying, soundproofing verification, machine diagnostics, environmental acoustics
- **Users:** acoustic engineers, safety inspectors, industrial technicians

---

## 5. External Sensor Mode

- **Connection:** Serial Bluetooth (HC-05 or any SPP-compatible module)
- **Data format:** Plain numeric values 0–1024, sent via `Serial.println()` (one value per line)
- **Baud rate:** Configurable; long-press the **Export icon** to open advanced baud configuration
- **Cell editing:** Manual cell editing (slider + Record button) is only allowed in **External mode** or when **Bluetooth is disconnected**
- **User responsibility:** Pre-scale sensor output to 0–1024 in firmware (Arduino/ESP code)
- **Live Scan (professional scan):** naming the module `ANY_SCAN_MS209` unlocks a richer protocol — see §5.1

### Example Arduino/BASCOM Integration
The site provides a conversion example from **BASCOM AVR** to **Arduino C++**:
- Reads analog value from pin A1
- Sends value via `Serial.println(analogValue)`
- Original BASCOM uses `$regfile = "m8adef.dat"`, `$crystal = 8000000`, ADC on channel 1
- Arduino version available with and without `INPUT_PULLUP`
- Proteus project file downloadable: `Proteuse_file.zip`

### 5.1 Live Scan (Professional Scan) Mode — Open Bluetooth Protocol

An extension of External Sensor mode for purpose-built scanners (magnetometer or metal detector). Full spec page: **https://soifgo.github.io/AnyScan209/live-scan-bluetooth-protocol.html** (`live-scan-bluetooth-protocol.html`, English only, protocol documentation released under the **MIT License**).

**Activation:** rename the Bluetooth module to exactly **`ANY_SCAN_MS209`** (e.g. `AT+NAME=ANY_SCAN_MS209` on HC-05; command varies by module) and re-pair the phone. Then choose **single scan** or **four-sensor scan** in the app options (must match what the scanner sends).

| Module name | App behavior |
|---|---|
| No name / any other name | **Simple mode** — every incoming input advances the scan one step (old scanners keep working) |
| `ANY_SCAN_MS209` | Live Scan options unlock: single scan, four scan, battery display, `Next` and `Bal` commands |

**Scan types**
- **Single scan:** one sensor; scan moves one row at a time.
- **Four-sensor scan:** four sensors sent at once, four rows filled at once → **4× faster** scanning.

**Data packet (mandatory format):** exactly **20 characters** = **5 fields × 4 digits**, each `0000`–`1024`, zero-padded, terminated by CR+LF (`Print` in BASCOM / `println` in Arduino add it).

| Field | Digits | Meaning |
|---|---|---|
| 1 | 1–4 | Sensor 1 |
| 2 | 5–8 | Sensor 2 |
| 3 | 9–12 | Sensor 3 |
| 4 | 13–16 | Sensor 4 |
| 5 | 17–20 | Battery |

- Always send **all five fields**; unused sensor fields are `0000`. A packet whose length is not exactly 20 is **rejected** (send `0512`, never `512`).
- Single-scan example: `05120000000000000980` · Four-sensor example: `05120300070000900980`
- Keep values inside 0–1024 (the app clamps with a small safety margin, but senders should not rely on it).

**Command words** (optional; sent alone on their own line — meant for two hardware buttons on the scanner):

| Word | Meaning | App action |
|---|---|---|
| `Next` | Go to next scan | Same as pressing the on-screen scan button |
| `Bal` | Balance request | Shows the *Balance Device* message and starts balancing |

**Battery field (field 5):** the app knows nothing about voltages — the **scanner maps its real battery voltage to a number**; the app converts it to a percentage with a linear formula, averages **50 packets** before updating the bar, and colors it dark red → yellow-green.

| Scanner type | Number for empty (0%) | Number for full (100%) | App formula |
|---|---|---|---|
| Magnetometer | 600 | 860 | `(value − 600) / 2.6` |
| Metal detector | 820 | 1024 | `(value − 820) / 2.04` |

- At or below the empty point the bar shows **3%**.
- **Low-battery alarm:** raw battery number **< 630** → LOW BATTERY message + warning sound (≈ 11% on a magnetometer; on a metal detector it only fires if the sender reports a value far below 820).
- Linear mapping: `number = emptyNumber + (voltage − emptyVoltage) × (fullNumber − emptyNumber) / (fullVoltage − emptyVoltage)`. Works for any battery (3.3–4.2 V, 9.6–12.4 V, 14–18 V…).
- **Voltage divider** (to bring battery voltage under the ADC reference) is the **builder's responsibility**; the divided-voltage → ADC relation is near-linear and can be corrected in firmware.
- Sender examples on the page: **BASCOM (AVR)** (sensor on ADC0, battery on ADC1 with +305 offset), **Arduino** (four-sensor `snprintf("%04d…")` example), **Python/MicroPython** (`make_packet()`).
- The page also explains how to ask an AI assistant to write sender firmware (needs: MCU, language, baud rate, single/four scan, magnetometer/metal detector, battery empty/full voltages, ADC reference voltage).

> ℹ️ Live Scan concerns the **Bluetooth link to external scanners**. It does not change the four internal sensors, and the plain 0–1024 External mode (§5) remains fully valid.

---

## 6. Scan Workflow

### 6.1 Creating a Scan
- **Grid size:** 8×8 up to **100×100 points**
- **Entry point:** Bottom-right corner
- **Direction:** Always starts **vertically (bottom → top)**
- **Two scan modes:**
  - **One-Way (Go/Go):** bottom→top, return to bottom, next column
  - **Zigzag (Go/Return):** bottom→top, then top→bottom in next column (faster, recommended for large grids)

### 6.2 Scanning
- **Record (▶)** = save current measurement to cell
- **Long-press Record** = automatic timed recording
- Navigation buttons (back/forward) allow moving through cells **without recording**
- Save anytime; **cancel save** → rollback to last saved state

### 6.3 Save Options
- **Direct Save** — original raw data
- **Enhanced Save** — improved visualization processing

---

## 7. Visualization

### 7.1 2D View Features
- Smoothing (noise reduction)
- **43 color palettes**
- Amplification modes
- Noise reduction
- Grid display
- Zoom
- RGB channel removal
- Color shift
- Crop

### 7.2 3D View Features
- Rotation (long-press for auto-rotation)
- Movement / pan
- Depth adjustment
- Lighting control
- **Custom textures**
- 43 color palettes + textures
- RGB channel removal
- Amplify height
- Amplify colors
- Color shift
- Crop

---

## 8. Export & Transmission Formats

| Format | Best For | Resolution Variants | Color? |
|---|---|---|---|
| **OBJ** | 3D modeling / rendering | Low + High | — |
| **STL** | 3D printing (topographic relief) | Low + High | — |
| **CSV** | Spreadsheet / MATLAB / Voxler | Low + High | — |
| **PLY** | Color-preserving 3D data | Low + High | ✅ per-vertex color |
| **Bluetooth Serial** | Real-time 1:1 raw stream to custom receivers (Office macros, HTML scripts, 3rd-party mappers) | — | — |

**Pro tip:** Long-press the Export icon to configure baud rate for Bluetooth streaming.

---

## 9. Website / Documentation File

The file provided (`!DOCTYPE html.txt` / `index.html`) is the official **landing page + full documentation** for AnyScan209, hosted at:
**https://soifgo.github.io/AnyScan209/**

### 9.1 Key Structural Elements
- **Theme:** Light/Dark toggle (default follows system; persisted in `localStorage` key `anyscan209-theme`)
- **Language Switcher:** 42 languages, custom dropdown, uses `translate.js` CDN
- **Download Cards:** Uptodown + APKPure
- **Community Forum Banner:** GitHub Discussions with how-to-post instructions
- **Tutorial Video:** 36 min, hosted on Mega.nz and embedded directly in `index.html`
- **Table of Contents:** 19 anchor links + 1 extra link (last item) to the separate Live Scan page
- **AI hint bar:** first line of the page (above the logo) tells AI assistants to read this file; `<head>` also has `<link rel="alternate" type="text/markdown">` pointing to it
- **Live Scan callout:** highlight box at the end of §10 (External Sensor Mode) announcing Live Scan and linking to `live-scan-bluetooth-protocol.html`
- **Sections 1–18** covering all app features (§18 = Direct & Alternating Current Measurement, `#current-measurement`), followed by **§19 FAQ**
- **FAQ:** 11 Q&A entries on the page, and the JSON-LD FAQPage schema now lists the same 11 (in sync; includes "hidden wires behind walls", "compatible devices", "professional geophysics", "DC and AC current" and "feature requests")
- **Footer:** email, privacy policy, GitHub, forum

### 9.2 SEO / Meta
- **Title:** "AnyScan209 – Free 4-in-1 Sensor Visualizer: Magnetometer, Altimeter, Light & Sound Mapper for Android"
- **Canonical:** https://soifgo.github.io/AnyScan209/
- **OG image:** https://soifgo.github.io/AnyScan209/og-banner.jpg (1200×630)
- **Schema.org:** SoftwareApplication + WebSite + WebPage + VideoObject + BreadcrumbList + FAQPage
- **hreflang:** x-default + en
- **Google verification:** `a_eyU1xDCfLVC4vCKrGpm0_cHHUaNBcgR4AWRieeOmI`

### 9.3 Download Links
- **Uptodown:** https://anyscan209.en.uptodown.com/android
- **APKPure:** https://apkpure.com/anyscan209/any.scan_209

### 9.4 CSS Theme Variables
```css
:root {
  --bg-color: #f8fafc;      --bg-card: #ffffff;
  --text-color: #334155;    --text-main: #0f172a;
  --text-muted: #64748b;    --accent-color: #2563eb;
  --accent-hover: #1d4ed8;  --border-color: #e2e8f0;
  --success-color: #16a34a; --success-hover: #22c55e;
  --apkpure-color: #00b36b; --apkpure-hover: #00c974;
}
html[data-theme="dark"] {
  --bg-color: #0f172a;      --bg-card: #1e293b;
  --text-color: #cbd5e1;    --text-main: #f1f5f9;
  --text-muted: #94a3b8;    --accent-color: #4f8cff;
  --accent-hover: #6aa0ff;  --border-color: #334155;
  --success-color: #22c55e; --success-hover: #4ade80;
  --apkpure-color: #00c974; --apkpure-hover: #00e085;
}
```

### 9.5 JavaScript Modules in the Page
1. **Theme initializer** (inline in `<head>`) — reads localStorage before paint to avoid flash
2. **Theme toggle** — button handler, updates icon ☀️/🌙, persists to localStorage
3. **Language switcher** — 42 languages, fallback channels, custom dropdown
4. **translate.js** — loaded from `https://cdn.staticfile.net/translate.js/3.18.66/translate.js`
   (note: CDN may be blocked in some regions; consider self-hosting for production)

### 9.6 Translation System Details
- **localStorage key:** `anyscan209-lang`
- **Fallback channels (in order):** `giteeAI` → `client.edge` → `siliconflow`
- **Default:** English (forced LTR when no saved lang; prevents auto-detect)
- **RTL languages:** Hebrew, Arabic, Persian, Urdu, Kurdish Sorani
- **Class `ignore`:** Elements with this class are skipped by the translation engine (used for brand names like "AnyScan209" and "Saeid Moghadam")
- **Timeout per channel:** 3000 ms

### 9.7 Language List (42 entries)
English, Spanish, French, Deutsch, Italian, Dutch, Portuguese, Polish, Swedish, Norwegian, Danish, Romanian, Czech, Slovak, Hungarian, Greek, Bulgarian, Russian, Ukrainian, Serbian, Hebrew, Chinese (Simplified), Japanese, Korean, Hindi, Bengali, Turkish, Arabic, Persian, Urdu, Kurdish Sorani, Azerbaijani, Armenian, Georgian, Indonesian, Malay, Filipino, Thai, Afrikaans, Vietnamese, Tamil.

### 9.8 Live Scan Protocol Page (`live-scan-bluetooth-protocol.html`)

A separate, English-only documentation page (not part of the 42-language `intro/<lang>/` set).

- **URL:** https://soifgo.github.io/AnyScan209/live-scan-bluetooth-protocol.html
- **Title:** "AnyScan209 Live Scan – Bluetooth Protocol for External Scanners (ANY_SCAN_MS209)"
- **Canonical / hreflang:** self-canonical; hreflang `x-default` + `en` only
- **Schema.org:** TechArticle (`dateModified` 2026-10-31, `license` MIT, `about` → the SoftwareApplication) + BreadcrumbList (AnyScan209 → Live Scan Bluetooth Protocol) + FAQPage (3 questions in JSON-LD; the page shows 5 FAQ items — same kind of mismatch as the main page)
- **OG / Twitter image:** `og-banner.jpg`
- **Same theme system** as the main page (light/dark, `localStorage` key `anyscan209-theme`, same CSS variables); **no translate.js / language switcher**
- **Brand names** use `<span class="ignore">` like the main page
- **Contents (10 sections):** 1 What Live Scan mode does · 2 Enable it (Bluetooth name) · 3 Single or four-sensor scan · 4 Data packet format · 5 Command words Next/Bal · 6 Battery display and alarm · 7 Voltage divider · 8 Sender code (BASCOM, Arduino, Python) · 9 Let an AI write your sender code · 10 FAQ
- **Links:** "← Back to the main AnyScan209 guide" → `index.html`; footer has email, privacy policy, GitHub, forum
- **Linked from:** the main page TOC (last item) and the callout box in §10 of `index.html`
- **In the sitemap** as a plain URL (no hreflang block), `lastmod` 2026-10-31

---

## 10. Wire & Conduit Detection and Current Measurement (Killer Features)

### Two detection scenarios:
| Conduit Type | Requires Current? | Method |
|---|---|---|
| **PVC / non-metallic** | ✅ YES — need high-power load (heater, kettle) to generate AC field | Alternating magnetic field detection |
| **Metal (steel/galvanized)** | ❌ NO — detectable even with no current | Ferromagnetic disturbance of ambient field |

- **Detection depth:** A few centimeters (smartphone magnetometer limit)
- **Setup:** Internal Sensor mode → long-press sensor option → enable **Graph** + **Gauge** → select **Bipolar Gauge**
- **Gauge behavior:**
  - **AC fields** → bidirectional movement
  - **DC fields** → one-directional deflection

### Why flagship phones may perform worse than budget phones:
1. **Wireless charging coils** — permanent magnets create constant offset
2. **Metal bodies/frames** — ferromagnetic materials distort fields
3. **Sensor placement** — budget phones (e.g., Samsung A-series) often have cleaner magnetic environments
- **Bottom line:** Sensor chip is rarely the issue; installation environment matters most.

### 10.1 DC & AC Current Measurement (website section 18)

Available **only in Internal Sensor (Magnetometer) mode**. On the **Scan page**, the bottom menu shows four options:

| Option | Purpose |
|---|---|
| **DC Ammeter** | Direct Current measurement |
| **DC Calibration** | Direct Current calibration |
| **AC Ammeter** | Alternating Current measurement |
| **AC Calibration** | Alternating Current calibration |

- **Principle:** current is estimated from the magnetic field around the wire — the same idea as **current transformers (CTs)**.
- **Position is critical:** the wire must stay in a fixed, consistent position relative to the sensor; stability + correct calibration determine accuracy.
- **DC:** press the **Balancer ⚖️** icon first so the field reads zero. Harder than AC because nearby **ferromagnetic metals** hurt accuracy.
- **Calibration procedure (DC and AC):**
  1. Place the phone sensor on or in front of the wire.
  2. Pass a known current (e.g. **1 A**) via a lab power supply or other method.
  3. Read the number shown next to **`now=`** (right side of the Calibration section).
  4. Enter it in the **Calibration input** and confirm.
  5. Any known current works: if the reading is **800** at **4 A**, the value for 1 A is **200**.
- **DC sign:** if the wire is reversed and the reading is negative, enter the **absolute value** (no sign).
- **AC:** same calibration, but heavily dependent on **magnetometer speed/quality**; may be unsatisfactory on some phones.
- **⚠️ Safety:** never measure high-voltage or high-current locations such as **copper busbars** — risk of electric shock, especially with a metal-bodied phone.
- Screenshot: `menu9.jpg`.

---

## 11. Supported Magnetometer Sensors (Sensor Guide)

| Manufacturer | Model | Sampling Rate | Resolution | Noise | Example Devices |
|---|---|---|---|---|---|
| MEMSIC | MMC5616WA | 1000 Hz | 0.00625 µT/LSB | Very Low | (check specs) |
| AKM | AK09973D | up to 2000 Hz | High sensitivity | Medium | Selected Samsung/Xiaomi/Sony |
| Yamaha | YAS537 | 200 Hz | 0.15 µT/LSB | Very Low | Galaxy S6/S7/Note |
| Yamaha | YAS539 | ~200 Hz | 0.12 µT/LSB | Very Low | Galaxy A series |
| Alps Alpine | HSCDTD015A | 200 Hz | 0.075 µT/LSB | Low | Modern smartphones |
| STMicroelectronics | LIS3MDL | 1000 Hz | Medium | Medium | Motorola/Nokia/LG |

**Tip:** To view your phone's magnetometer info → Settings → Update section → **Sensor internal : help**

---

## 12. Scanning Setup Tips
- Use a **smartphone holder or selfie stick** for stable movement
- Use a **Bluetooth remote controller** to trigger Record without touching the phone
- Ideal for systematic, consistent measurements

---

## 13. FAQ (Core Answers — matches the 11 on-page FAQ entries)

1. **Free?** — Yes, 100% free, no hidden fees, no IAP, no ads.
2. **External sensors?** — Yes, via HC-05 or any SPP Bluetooth module.
3. **Export formats?** — CSV (tables), OBJ/STL (3D), PLY (color-preserving 3D). All in low + high resolution.
4. **More than magnetic scanning?** — Yes, 4 internal sensors + any external 0–1024 data.
5. **Ads / data collection?** — None. All data stays on-device.
6. **Compatible devices?** — Any Android with a built-in magnetometer.
7. **Professional geophysics?** — Yes, designed for both education and professional field work.
8. **Gain feature?** — Adjusts 16-bit magnetometer (0–65535) sensitivity into 0–1024 range; default Gain=10; external mode requires pre-scaling.
9. **Hidden wires behind walls?** — See §10 (metal conduits detectable without current; PVC conduits need an AC load; depth only a few centimeters).
10. **Can it measure DC and AC current?** — Yes, in Internal Sensor (Magnetometer) mode only: DC/AC Ammeter + DC/AC Calibration in the Scan page bottom menu; needs calibration with a known current (§10.1).
11. **Feature requests?** — Post in GitHub Discussions; heavier custom ideas can be built with the SoifGo web app builder (https://soifgo.github.io/soifgo/index.html).

*(On the Live Scan page, not the main page:)* **How do I turn on Live Scan?** — Rename the Bluetooth module to exactly `ANY_SCAN_MS209`, re-pair, choose single or four-sensor scan. **Why is my packet ignored?** — It must be exactly 20 characters (5 × 4 digits, zero-padded); unused sensor fields = `0000`. **What battery numbers?** — Magnetometer 600 (empty) → 860 (full); metal detector 820 → 1024. **Are Next/Bal required?** — No, optional hardware buttons. (See §5.1.)


---

## 14. Important Notes for AI Assistants

When generating content, code, or translations for AnyScan209:

1. **Always spell it "AnyScan209"** — capital A, S, and the number 209. Never "AnyScan 209" or "anyscan209" in prose (except in URLs/package names).
2. **The `ignore` class matters** — brand names wrapped in `<span class="ignore">` are intentionally NOT translated.
3. **The 0–1024 range is sacred** — never suggest alternative ranges without explaining the mapping.
4. **512 = neutral point** — critical for magnetometer explanations.
5. **Do not invent features** — stick to what's in this document.
6. **RTL support** — when editing HTML, respect `dir="rtl"` for Hebrew/Arabic/Persian/Urdu/Kurdish.
7. **Theme variables** — always use CSS custom properties (`var(--accent-color)` etc.), never hardcode colors.
8. **Author name** — Saeid Moghadam (not "Saeed" or "Said").
9. **Email** — ssmqqmss@gmail.com
10. **No ads, no tracking, no telemetry** — this is a core selling point; never contradict it.
11. **Current measurement is approximate and needs calibration** — never encourage measuring high-voltage/high-current circuits (e.g. copper busbars); always repeat the electric-shock safety warning (§10.1).
12. **Live Scan name is exact** — the module name must be `ANY_SCAN_MS209` (underscores, capital letters, digits); never alter it. Do not translate or reformat `Next`, `Bal`, or the packet examples.
13. **Live Scan packets are always 20 characters** — five 4-digit zero-padded fields; never show a shorter example. Battery ranges: magnetometer 600–860, metal detector 820–1024; the scanner (not the app) maps voltage to that number.

---

## 15. Quick Reference — URLs

| Resource | URL |
|---|---|
| Website | https://soifgo.github.io/AnyScan209/ |
| Privacy policy | https://soifgo.github.io/AnyScan209/policy_anyscan209.html |
| AI Context (this file) | https://soifgo.github.io/AnyScan209/AnyScan209_AI_CONTEXT.md |
| Live Scan Bluetooth protocol | https://soifgo.github.io/AnyScan209/live-scan-bluetooth-protocol.html |
| Sitemap | https://soifgo.github.io/AnyScan209/sitemap.xml |
| GitHub | https://github.com/soifgo/AnyScan209 |
| Forum | https://github.com/soifgo/AnyScan209/discussions |
| Uptodown | https://anyscan209.en.uptodown.com/android |
| APKPure | https://apkpure.com/anyscan209/any.scan_209 |
| Tutorial video | https://mega.nz/file/7fIGRJob#ibuMQe_Vh0epI77NvD3hmXhMHo6pMgbrLLTMD4DjCxk |
| Video embed (used in JSON-LD VideoObject) | https://mega.nz/embed/7fIGRJob#ibuMQe_Vh0epI77NvD3hmXhMHo6pMgbrLLTMD4DjCxk |
| Video embed (iframe at the bottom of the page) | https://mega.nz/embed/rOoQET4Z#cmdvIjc-yN3egHJwVS1jApOzPzUSwRbEqCqv7vKDKNM |
| OG banner | https://soifgo.github.io/AnyScan209/og-banner.jpg |

---

## 16. Video Metadata
- **Name:** AnyScan209 Tutorial - How to Use the 2D/3D Visualizer App
- **Duration:** PT36M55S (36 min 55 sec)
- **Upload date:** 2026-07-04
- **Thumbnail:** og-banner.jpg

---

## 17. Quick Start for AI Assistants

If you are an AI assistant asked to work on AnyScan209:

1. **Read §1–§3** for identity and the core 0–1024 concept.
2. **Read §4** if the task involves sensor modes.
3. **Read §5** if the task involves external sensors, Bluetooth, or Arduino/ESP.
4. **Read §6–§8** if the task involves scanning workflow, visualization, or export.
5. **Read §9** if the task involves the website, translation, or SEO.
6. **Read §10** if the task involves wire/conduit detection, current (ammeter) measurement, or magnetometer physics.
7. **Read §5.1 and §9.8** if the task involves Live Scan, the `ANY_SCAN_MS209` Bluetooth name, the 20-character packet, battery mapping, or writing scanner firmware.
8. **Read §14** for style/accuracy rules before generating any output.

### Common Task Patterns
| Task | Sections to read |
|---|---|
| Translate the website | §9, §14 |
| Write a blog post about AnyScan209 | §1, §2, §4, §10, §13 |
| Generate Arduino code for external sensor | §5 |
| Explain magnetometer behavior | §3, §10, §11 |
| Explain DC/AC current measurement or calibration | §10.1, §14 |
| Add a new language to the site | §9.6, §9.7 |
| Write an FAQ answer | §13, §14 |
| Debug website CSS/JS | §9.4, §9.5 |
| Write sender firmware for a Live Scan scanner (Arduino/BASCOM/Python/ESP32) | §5, §5.1, §14 |
| Explain Live Scan packet, Next/Bal commands, or battery numbers | §5.1 |
| Edit the Live Scan page | §9.8, §9.4, §14 |

### Anti-Patterns (do NOT do)
- ❌ Do NOT claim the app has AI/ML features (it doesn't).
- ❌ Do NOT suggest it works on iOS (Android-only).
- ❌ Do NOT say it's on Google Play (it isn't — only Uptodown & APKPure).
- ❌ Do NOT recommend using it for medical, safety-critical, or legal purposes.
- ❌ Do NOT suggest measuring current on high-voltage / high-current conductors (e.g. copper busbars).
- ❌ Do NOT claim current readings are accurate without calibration, or that they work in External/Barometer/Light/Sound modes.
- ❌ Do NOT add emojis to the app name "AnyScan209".
- ❌ Do NOT suggest it has cloud sync, user accounts, or online storage (it doesn't).
- ❌ Do NOT describe it as an IoT platform or MQTT broker.
- ❌ Do NOT recommend paid alternatives when asked for a free option.
- ❌ Do NOT say Live Scan is enabled by an app setting alone — it requires the Bluetooth module to be named exactly `ANY_SCAN_MS209`.
- ❌ Do NOT send or document Live Scan packets that are not exactly 20 characters, or omit unused fields (they must be `0000`).
- ❌ Do NOT claim the app measures battery voltage — the scanner maps voltage to a number (600–860 magnetometer, 820–1024 metal detector).
- ❌ Do NOT claim Live Scan changes or replaces the internal sensors; it is only for external Bluetooth scanners.

---

## 18. File Manifest (Referenced Assets)

Images / assets referenced in the HTML documentation:

| File | Purpose |
|---|---|
| `logo.png` | App logo (header) — should be 180×180 or 512×512 |
| `og-banner.jpg` | Open Graph / Twitter card image (1200×630) |
| `uptodown.png` | Uptodown button icon |
| `apkpure.png` | APKPure button icon |
| `menu1.jpg` – `menu9.jpg` | UI screenshots (main menu, scan screen, 2D, 3D, settings, external sensor, schematic, sensor selection, current-measurement menu) |
| `selfi.jpg` | Scanning setup (selfie stick / holder) |
| `set_01.jpg`, `set_02.jpg` | Sensor settings / metal conduit detection |
| `policy_anyscan209.html` | Privacy policy page |
| `live-scan-bluetooth-protocol.html` | Live Scan Bluetooth protocol documentation page (English only, MIT License) |
| `Proteuse_file.zip` | Proteus project download |
| `sitemap.xml` | XML sitemap (3 main URLs — site root, privacy policy, Live Scan page — + 40 `intro/<lang>/` pages = 43 URLs) |
| `robots.txt` | Robots file (limited on GitHub Pages) |

---

## 19. Glossary

| Term | Meaning in AnyScan209 context |
|---|---|
| **Balance / Balancer** | Auto-calibration to set neutral point (512) for internal sensors |
| **Bipolar Gauge** | Gauge display mode showing bidirectional deflection (AC fields) |
| **Direct Save** | Save raw scan data as-is |
| **Enhanced Save** | Save with improved visualization processing |
| **Gain** | Sensitivity multiplier mapping 16-bit raw → 0–1024 |
| **Live Scan** | Professional scan mode unlocked by naming the Bluetooth module `ANY_SCAN_MS209`; single or four-sensor packets + battery + Next/Bal (§5.1) |
| **ANY_SCAN_MS209** | Exact Bluetooth module name that activates Live Scan |
| **Packet (Live Scan)** | 20-character string, five 4-digit zero-padded fields: 4 sensors + battery |
| **Next / Bal** | Optional Live Scan command words: next scan / balance request |
| **Go/Go** | One-way scan pattern (return to start of each column) |
| **Go/Return** | Zigzag scan pattern (continuous, faster) |
| **Grid** | Scan matrix, 8×8 to 100×100 points |
| **HC-05** | Common serial Bluetooth module for external sensors |
| **SPP** | Serial Port Profile (Bluetooth) |
| **SPL** | Sound Pressure Level (dB measurement) |
| **PLY** | Polygon File Format (stores per-vertex color) |
| **µT/LSB** | Microtesla per Least Significant Bit (sensor resolution) |
| **PWA** | Progressive Web App (not enabled on AnyScan209 — only APK) |
| **APK** | Android Package Kit (the app's distribution format) |

---

## 20. Changelog of This Document

| Version | Date | Changes |
|---|---|---|
| 1.0 | 2026-10-10 | Initial AI Context Document |
| 1.1 | 2026-10-10 | Added version 2.01, fixed FAQ count (7), added Anti-Patterns, added sitemap.xml & robots.txt to manifest, added PWA/APK glossary terms |
| 1.2 | 2026-10-12 | Added website §18 (DC & AC current measurement) as §10.1; updated section/FAQ counts, task table, anti-patterns, safety rule, `menu9.jpg`, sitemap URL count. **Known site inconsistency:** JSON-LD FAQPage lists 8 questions (includes "hidden wires behind walls", omits "compatible devices" and "professional geophysics") while the page shows 9 — should be synchronized. |
| 1.3 | 2026-10-31 | Added **Live Scan (Professional Scan)** — new §5.1 (activation name `ANY_SCAN_MS209`, 20-character packet, Next/Bal, battery mapping & alarm, voltage divider, code examples) and §9.8 (the new `live-scan-bluetooth-protocol.html` page); added the AI-hint bar note and this file's own URL (§9.1, §15); synced FAQ with the current `index.html` (11 on-page = 11 in JSON-LD; the old FAQ-mismatch note from v1.2 is resolved); updated §2, §5, §9.1, §13, §14 (notes 12–13), §15, §17 (quick start, tasks, anti-patterns), §18 (manifest + sitemap now 43 URLs) and §19 (glossary). |

---

*End of AnyScan209 AI Context Document.*
*©2025–2026 AnyScan209 — Built by Saeid Moghadam*
