Start here

Teach FIELD a sensor it doesn't know.

FIELD ships understanding a handful of senses — touch, tilt, light, sound, and more. A plugin teaches it one more chip, without changing FIELD itself.

This guide picks up after Your First FIELD. It assumes you already know the four words — Actor, Role, Cue, Mechanism — and have wired at least one real sensor to a board.

By the end you will have written, installed, and tested one small plugin file — for a sensor chip of your choice.

The one rule that never bends

A plugin adds a new hardware option to a sense FIELD already has (TOUCH, LIGHT, SOUND…). It never invents a brand‑new kind of sense. A plugin for a new touch chip makes the TOUCH role smarter — it does not create a "TOUCH_2" role type.

scroll · or use back / next below
Chapter 1

A plugin is one small file.

No install step, no build, no code review, nothing to compile. A plugin is a single file that ends in .field-plugin.json — plain text you could write in Notes.

You writeone .json file
FIELD readsPlugin Gallery
Role getsa new option

Inside the file you describe three things: which role the chip belongs to (TOUCH, LIGHT, SOUND…), how to wire it (which pin goes where), and a few short fragments of Arduino code that read the chip and hand FIELD a number from 0 to 1.

Component

What a plugin adds

One new hardware option inside an existing role — like a new item in a dropdown.

Wiring

Where wires go

A short human‑readable line — "VCC → 5V | GND → GND | OUT → A0" — shown to whoever wires the board.

What you do NOT need
  • No npm, no package manager, no build step.
  • No changes anywhere else in FIELD — the plugin is the whole thing.
  • No code that runs on your computer — only Arduino code that runs on the board, later.
Chapter 2

Anatomy of a plugin file.

Every plugin has the same shape: a few lines describing the plugin, then a list of components — usually just one, for your one chip.

my-sensor.field-plugin.json

{
  // Always the number 1. Tells FIELD which plugin format this is.
  "fieldPluginVersion": 1,

  // A name only you use, in reverse order, like a website address backwards.
  "id": "com.yourname.mysensor",
  "name": "My Sensor",
  "version": "1.0.0",
  "author": "Your Name",
  "description": "One line: what it reads and why someone would want it",

  "components": [ /* one entry per chip — see next chapter */ ]
}
  1. Pick an id nobody else will pick — your name plus a short word for the sensor.See "com.jordan.tmp36" or similar.
  2. Write one honest sentence for description. This is the only line most people will read before installing.See it shown in the Plugin Manager's "Installed" list.
  3. Leave components empty for now — the next chapter fills it in.See a file that is valid but does nothing yet.
Why so little metadata

FIELD only checks the shape of these fields, not their meaning — there is no review queue, no approval wait. That is what makes "write it, install it, test it" possible in one sitting. It also means: double‑check your own file, nobody else will.

Chapter 3 · worked example

Write a plugin for a simple analog sensor.

Most beginner sensors — a photoresistor, a sound module, a soil moisture probe, a potentiometer — work the same way: power, ground, and one wire that outputs a voltage FIELD reads with analogRead(). Start there before touching I2C chips.

This example teaches the LIGHT role about a photoresistor module. The pattern is the same for any single‑wire analog sensor — only the role, name, and wording change.

photoresistor.field-plugin.json

{
  "fieldPluginVersion": 1,
  "id": "com.yourname.photoresistor",
  "name": "Photoresistor Module",
  "version": "1.0.0",
  "author": "Your Name",
  "description": "3-pin analog light sensor module (LDR + resistor on a breakout board)",
  "components": [
    {
      "roleId": "LIGHT",
      "kind": "input",
      "id": "photoresistor",
      "name": "Photoresistor Module",
      "description": "Higher light = higher value. Wire OUT to any analog pin.",
      "wiring": "VCC → 5V | GND → GND | OUT → analog pin",
      "codegen": {
        "loopRead": "  fieldSend(\"{{roleEventKey}}\", analogRead({{pin}}) / 1023.0f);"
      }
    }
  ]
}
  1. roleId: "LIGHT" — this chip is teaching the LIGHT role a new trick, not inventing a new sense.See it appear inside LIGHT's own hardware list, next to any built‑in options.
  2. wiring is just a sentence a human reads while holding a screwdriver. Write it the way you would tell a friend.See the exact text shown in the Actor panel once installed.
  3. codegen.loopRead is one line of real Arduino code, run every loop. {{pin}} and {{roleEventKey}} are filled in automatically by FIELD — you never hand‑type a pin number here.See this exact line appear inside the generated sketch.
Do this now

Copy the file above into a text editor. Change id, name, and description to match a sensor you actually own. If it is analog and single‑wire, that loopRead line usually works unchanged.

Chapter 4 · going further

Chips with a library, or a setting to pick.

Some chips need more than one wire and one line — they talk over I2C, need a library, or have a setting like an address or a channel number. The shape grows, but stays the same idea.

libraries

optional

Arduino library names FIELD installs before compiling — e.g. "libraries": ["Adafruit_MPR121"].

extraConfig

optional

A dropdown or number field shown in the Actor panel — like an I2C address, or which of 12 electrodes to read.

excerpt — an I2C touch chip with a setting

"noMainPin": true,
"libraries": ["Adafruit_MPR121"],
"extraConfig": [
  { "key": "electrode", "label": "Electrode (0–11)",
    "type": "number", "default": 0 }
],
"codegen": {
  "includes": ["<Wire.h>", "<Adafruit_MPR121.h>"],
  "globals": "Adafruit_MPR121 mpr_{{varName}};",
  "setup": "  mpr_{{varName}}.begin();",
  "loopRead": "  fieldSend(\"{{roleEventKey}}\", mpr_{{varName}}.touched() & (1<<{{cfg.electrode}}) ? 1.f : 0.f);"
}

Whatever you type as {{cfg.electrode}} above is whatever the person using your plugin picked in that number field — filled in the same way {{pin}} is. noMainPin: true means "this chip has no single main pin" (it uses two fixed I2C wires instead).

A real one to copy from

FIELD's own MPR121 plugin uses every feature described here — includes, a global variable, setup code, a config dropdown, and two components on two different roles in one file. It ships with FIELD as a working reference, not just documentation.

Chapter 5

Install it and test it — no restart needed.

A plugin installs into the canvas you already have open. There is no separate build or restart.

  1. Open the Connect menu and choose Plugins to open the Plugin Manager.See two tabs: Installed, and Add Plugin.
  2. Under Add Plugin, choose Paste JSON and paste your file in — or just drag the .field-plugin.json file anywhere onto the window.See the text land in the box, or a drop message while dragging.
  3. Click Install Plugin.See a green line: "installed — 1 component added."
  4. Add an Actor, give it a LIGHT input (or whichever role your plugin targets), and open its hardware dropdown.See your plugin's name in the list, wiring text and all.
  5. Wire the real chip to a board, upload with one‑click upload, and watch the Actor panel.See a live number move as you cover or uncover the sensor.
If the number never moves
  • Check {{roleEventKey}} matches the role your codegen sends — a copy‑paste from a different role is the most common mistake.
  • Open the board's Serial log — a bad wiring line, not a bad plugin, is behind most silent failures.
  • Re‑read the file for a missing comma. There is no error message for broken JSON beyond "not valid JSON" — a JSON validator online will point at the exact character.
Chapter 6 · what we changed

We looked at making this even simpler.

The format itself was already about as small as a hardware‑description file can get: one JSON file, no build step, no eval, three ways to load it in. The friction we found was smaller and more specific — the blank page.

Before

The Paste JSON box in the Plugin Manager started empty. You had to go find an example somewhere else and copy it in by hand.

Now

A "Start from a template →" link fills the box with a minimal working analog‑sensor skeleton — the same shape as Chapter 3's example — so the first edit is changing three words, not writing from nothing.

We kept the format itself untouched rather than adding a wizard or form‑builder on top of it. A form would hide the JSON shape instead of teaching it — and the JSON shape is also exactly what an AI coding assistant needs to generate a whole plugin for you from one sentence like "I have a DHT22 temperature sensor," if you'd rather not hand‑write one at all.

The fastest path of all

Point an AI coding assistant at FIELD's repo and ask it to write the plugin for your exact chip, using AI-PLUGINS.md as its reference. It follows the same rules this guide just taught you — just faster.

You can teach FIELD a chip now

One file, one chip, no build step.

You wrote a plugin, installed it, and watched a real number move. That is the whole system — everything else in this guide was detail.

  • Write a plugin for a sensor you actually own, using Chapter 3 as a starting shape.
  • Try the "Start from a template" link in the Plugin Manager's Add Plugin tab.
  • Add an extraConfig field if your chip has a setting — an address, a channel, a range.
  • Share the finished .field-plugin.json file with anyone who owns the same chip — it is the whole install, nothing else needed.

← Back to Your First FIELD  ·  Connect two things  ·  FIELD home

Chapter 1 / 8