BagTag
The machine-readable identification standard for Grove5 Cultivar Select bags.
BagTag uses two codes with two completely separate audiences and two completely separate jobs.
Two codes. Two audiences. Two jobs.
| AprilTag (Front) | QR Code (Back) | |
|---|---|---|
| Faces | Cultivar camera | Human / phone |
| Readable by | Machine | Human and machine |
| Payload | 12-bit grow profile | Full GMP traceability record |
| Capability | 6DOF pose estimation | Unlimited data |
| Job | Predeterminant grow intelligence | Supply chain, recall, transparency |
| Human input required | Zero | On demand |
The QR code is a strict superset of the AprilTag payload. If the AprilTag is damaged or obscured by mycelium growth, the human scans the QR and the Cultivar receives the same grow information. Neither code is a single point of failure.
How it works
The Cultivar camera reads one AprilTag41h12 tag at bag insertion. 12 bits. In milliseconds.
Bit 0 → Small or Large bag (1 bit)
Bits 1–5 → Substrate recipe (5 bits = 32 slots)
Bits 6–12 → Species (7 bits = 128 slots, table selected by substrate)
Physical encoding: Packed enumeration maps only valid (size, substrate, species) combinations to sequential tag IDs 0–1905.
From those 12 bits the Cultivar knows:
- Temperature targets for colonization and fruiting
- Humidity profile
- CO₂ and FAE schedule
- Colonization timeline estimate
- Biological efficiency baseline for yield tracking
- Fruiting trigger conditions
No app interaction. No human input. Just put the bag in.
Tag family
AprilTag41h12 — 2,115 valid tag IDs, Hamming distance 12.
Co-recommended alongside 36h11 by industrial machine vision vendors. Selected for the Cultivar because:
- Sufficient IDs for the full BagTag encoding space
- Hamming distance 12 tolerates up to 5 misread bits — robust against condensation, mycelium occlusion, and angle
- Native 6DOF pose estimation from a single camera frame
- Lightweight decode on vision coprocessor
Repository structure
BagTag/
├── README.md ← this file
├── SPEC.md ← full encoding specification
├── LICENSE ← MIT
├── tables/
│ ├── substrates.md ← all 32 substrate slots
│ └── species/ ← per-substrate species lookup tables
│ ├── aio-00.md
│ ├── aio-01.md
│ └── ...
└── tools/
└── decode.py ← reference decoder (tag ID → substrate + species)
Quick decode reference
tag_id = 2048
bits = format(tag_id, '012b') # '100000000000'
size = int(bits[0], 2) # 1 = Large
substrate = int(bits[1:6], 2) # 0 = Masters Mix + Millet
species_code = int(bits[6:], 2) # 0 = Hericium erinaceus (Lion's Mane)
See tools/decode.py for the full reference implementation with lookup tables.
License
MIT — see LICENSE
BagTag uses the AprilTag library (BSD 2-Clause License). See LICENSE for third-party attribution.
Part of Grove5
BagTag is one component of the Cultivar ecosystem.
- Cultivar — smart dual-chamber home mushroom cultivation appliance
- Cultivar Select — subscription bag service
- BagTag — machine-readable bag identification standard
Open source software, honest hardware.