Skip to the content
4 layers25 × 40 mmMiniParMain, the printed circuit board in 3D

Repository firmware for the ambit PAR meter version

Size
25 × 40 mm
Copper layers
4
Thickness
1.58 mm
Parts
36
Nets
37
Pads
159
Tracks, vias
372, 104
Pours
2
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
7 Apr 2026
Updated
3 Nov 2026

Overview

MiniParMain is an open-source printed circuit board by Jan-IngenHousz-Institute, from the Jan-IngenHousz-Institute/miniPar repository on GitHub, published under the MIT licence. It is a 4-layer board of 25 × 40 mm with 36 parts on 37 nets, routed with 372 tracks and 104 vias.

It is built around the ESP8685H4, AS7341-DLGT and BME280, with the IP4234CZ6, LIS2DE12 and 1N4148WT among its other parts. Its parts include 12 capacitors, 10 resistors, 6 ICs, 3 diodes and 3 connectors.

Main components

6

README

README.md

Mini PAR meter - minimum tool to get a good numerical sense of light intensity

vis

Commands

Commands are sent as plain text terminated with \n. JSON mode is also supported — send a valid JSON object and the device will respond in JSON.

  • hello
    • Response: MiniPAR,1.1 (plain) / {"device":"MiniPAR","version":"1.1"} (JSON)
  • reboot
    • Restarts the device. Prints boot info ending with Ready.
  • delay_ms,<value>
    • Example: delay_ms,500
    • Blocks for <value> milliseconds, then responds with the delay value: 500 (plain) / {"delay_ms":500} (JSON). Missing/negative value is treated as 0.
  • battery
    • Response: NaN (plain) / {"battery":"NaN"} (JSON)
    • Battery measurement not yet implemented.
  • i2c_scan
    • Response: comma-separated list of I2C addresses that ACK (e.g. 0x39)
  • spec[,<count>]
    • Response: {"spectrometer":{"model":"AS7341","channels":{"f1_415":1.2345,"f2_445":6.7890,...},"par":123.45}} (JSON) / model,ch0,ch1,...,par (plain)
    • Returns basic counts per channel: raw_reading / gain / integration_time_ms (counts per millisecond per gain unit). Values are comparable across different gain and integration-time settings.
    • ⚠️ Firmware ≤ 1.05 divided by the integration time in seconds, so these values were 1000× larger. Check hello's firmware version if you interpret them.
    • Also includes the calculated PAR value (same as the par command), computed from this same reading.
    • <count> repeats the measurement that many times (omit, or 1, for a single reading); each reading is printed as soon as it's taken. With <count> > 1: JSON response becomes an array of the single-reading objects ([{"spectrometer":{...}},{"spectrometer":{...}},...]); plain response is the single-reading lines joined with ; on one line.
  • spec_raw
    • Response: same format as spec but raw unscaled integer counts (no normalization applied).
  • spec_flash,<mA>
    • Example: spec_flash,10
    • Dark read → LED on → lit read. Response: dark:<values>;lit:<values>;diff:<values> (plain).
  • spec_set_atime,<0-255>
    • Set spectrometer ATIME integration register. Response: the value set.
  • spec_set_astep,<0-65534>
    • Set spectrometer ASTEP register. Response: the value set.
  • spec_set_gain,<0-10 (AS7341) | 0-12 (AS7343)>
    • Set spectrometer gain index. Response: the value set.
  • spec_status or status
    • Response: model=<name>,available=<0|1>,atime=<val>,astep=<val>,gain=<val> (plain)
  • set_led,<mA>
    • Example: set_led,20
    • Response: {"spectrometer":{"led_current_ma":20}} (JSON) / actual mA set (plain)
    • LED current capped at 20 mA.
  • par[,<count>]
    • Response: 123.45
    • PAR value in µmol/m²/s, scaled by linear calibration: y = a·par_raw + b
    • <count> repeats the measurement that many times (omit, or 1, for a single reading); each reading is printed as soon as it's taken. With <count> > 1: JSON response becomes an array ([{"par":1.2},{"par":3.4},...]); plain response is the values joined with ; on one line.
  • par_raw
    • Response: 1.23
    • Weighted dot product of basic counts (raw / gain / integration_time_ms) and per-channel PAR coefficients. Independent of gain and integration-time settings.
  • cal_par_slope,<value>
    • Example: cal_par_slope,10.0
    • Response: {"calibration":{"slope":10.0}}
    • Set the a coefficient for y = ax + b scaling. Persisted to NVS.
  • cal_par_intercept,<value>
    • Example: cal_par_intercept,2.3
    • Response: {"calibration":{"intercept":2.3}}
    • Set the b coefficient for y = ax + b scaling. Persisted to NVS.
  • get_cal_par
    • Response: {"calibration":{"slope":10.0,"intercept":2.3}} (JSON) / slope=10.0,intercept=2.3 (plain)
    • Get the current a (slope) and b (intercept) coefficients for y = ax + b scaling.
  • set_spec_coeff,<channel>,<value>
    • Example: set_spec_coeff,0,0.614975
    • Response: {"spectrometer_coeff":{"channel":0,"value":0.614975}}
    • Set per-channel PAR coefficient (channel 0–17). Coefficients are applied to basic counts (raw / gain / integration_time_ms), so they must account for the desired normalization. Persisted to NVS.
    • Default coefficients are pre-scaled for the default AS7341 settings (ATIME=100, ASTEP=999, GAIN=2×); re-derive from calibration if defaults are changed.
    • Since firmware 1.06 these are per-millisecond basic counts, matching basic_counts() in new_calibration_miniPAR/as7341_calibrate.py — upload host-fitted coefficients directly, with no factor of 1000. Coefficients written by an earlier firmware are rescaled once on the first 1.06 boot.
  • get_spec_coeff
    • Response: {"spectrometer_coeffs":{"channels":{"0":0.614975,"1":0.053037,...}}}
    • Get all 18 per-channel PAR coefficients.
  • get_spec_coeff,<channel>
    • Example: get_spec_coeff,0
    • Response: {"spectrometer_coeff":{"channel":0,"value":0.614975}}
    • Get a specific per-channel PAR coefficient.
  • set_name,<string>
    • Response: {"device_name":"MyDevice"}
    • Set custom device name. Persisted to NVS.
  • get_name
    • Response: {"device_name":"MyDevice"}
    • Get current device name.

BME280 (optional temperature/pressure/humidity sensor)

Detected automatically at boot (I2C address 0x76 or 0x77); all commands below respond with error:not_available (plain) / {"bme280":{"error":"not_available"}} (JSON) if no BME280 is fitted. Temperature, pressure, and humidity are all enabled by default, at the highest oversampling (x16), IIR filter off, one-shot read mode.

  • bme_status
    • Response (plain): continuous=<0|1>,continuous_active=<0|1>,temp_comp=<value>,temp_en=<0|1>,temp_osrs=<0-5>,press_en=<0|1>,press_osrs=<0-5>,hum_en=<0|1>,hum_osrs=<0-5>,iir=<0-4>
    • Response (JSON): {"bme280_status":{"available":true,"continuous_mode":false,"continuous_active":false,"temperature_compensation_c":0.00,"temperature":{"enabled":true,"oversampling":5},"pressure":{"enabled":true,"oversampling":5},"humidity":{"enabled":true,"oversampling":5},"iir_filter":0}}
  • bme_set_temp_enable,<0|1>
    • Enable/disable temperature in bme_get_tph output. Temperature is still sampled internally regardless (pressure/humidity compensation depend on it) — this only affects reporting.
  • bme_set_press_enable,<0|1>
    • Enable/disable pressure in bme_get_tph output.
  • bme_set_hum_enable,<0|1>
    • Enable/disable humidity in bme_get_tph output.
  • bme_set_temp_oversample,<0-5>
    • Oversampling: 0=off (clamped to 1, since temperature must always be sampled), 1=x1, 2=x2, 3=x4, 4=x8, 5=x16 (default).
  • bme_set_press_oversample,<0-5>
    • Same scale as above; 0=channel skipped by the sensor.
  • bme_set_hum_oversample,<0-5>
    • Same scale as above; 0=channel skipped by the sensor.
  • bme_set_iir,<0-4>
    • IIR filter coefficient: 0=off (default), 1=x2, 2=x4, 3=x8, 4=x16.
  • bme_set_continuous,<0|1>
    • 0 (default) = one-shot: every bme_get_tph call takes its own forced-mode measurement.
    • 1 = continuous: the chip free-runs in normal mode; bme_get_tph blocks only on the first call after enabling (waiting for that first conversion), then returns whatever the chip's background cycle last produced.
  • bme_set_temp_comp,<value>
    • Set the temperature compensation offset in °C, added to every raw temperature reading (and folded into the pressure/humidity compensation math) to null out self-heating bias. Persisted to NVS.
  • bme_get_temp_comp
    • Response: current temperature compensation offset in °C.
  • bme_get_tph[,<count>] (alias: tph[,<count>])
    • Response (plain): <temperature_c>,<pressure_hpa>,<humidity_pct> — positional CSV, blank field for a disabled channel.
    • Response (JSON): {"bme280":{"temperature_c":23.45,"pressure_hpa":1013.25,"humidity_pct":45.20}} — null for a disabled channel.
    • Behavior depends on bme_set_continuous: one-shot mode (default) takes a fresh forced-mode reading every call; continuous mode waits for the first conversion only on the first call after being enabled, then returns the most recent free-running reading on every call after that.
    • <count> repeats the measurement that many times (omit, or 1, for a single reading); each reading is printed as soon as it's taken. With <count> > 1: JSON response becomes an array of the single-reading objects; plain response is the single-reading CSV rows joined with ; on one line.

Status LED (GPIO 10)

The LED on GPIO 10 provides a visual indication of spectrometer state:

LED stateMeaning
OffNo spectrometer detected at boot
Solid onSpectrometer detected, all channels within range
Blinking 20 HzAt least one spectrometer channel is saturated

Saturation is checked automatically on every spectrometer read (spec, spec_raw, par, par_raw, etc.). The LED returns to solid-on as soon as the next read finds all channels within range. Reduce gain or integration time (spec_set_gain, spec_set_atime, spec_set_astep) to clear saturation.

Protocol

  • Command terminator: \n (\r is ignored)
  • PAR units: µmol/m²/s
  • Basic counts: raw_reading / gain / integration_time_ms, where integration_time_ms = (ATIME+1) × (ASTEP+1) × 2.78e-3 ms. Used by spec, par, and par_raw — values are gain/integration-time independent. This is the ams AN000633 §2.1 convention; firmware ≤ 1.05 used seconds instead, see CALIBRATION.md.
  • Default AS7341 settings: ATIME=100, ASTEP=999, GAIN=2× (integration time ≈ 280.8 ms). Per-channel PAR coefficients stored in NVS are calibrated for basic counts at these defaults.

FW Design (L. Grabowski, L. Caracciolo),

HW Design (L. Grabowski)

Parts

36
QtyValueFootprintReferences
112.2uCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC1, C2, C3, C4, C5, C7, C8, C9, C10, C11, C12
65.1KResistor_SMD:R_0603_1608MetricR2, R12, R13, R14, R29, R30
20RResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR3, R6
210KResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR7, R8
2LEDDiode_SMD:D_0805_2012MetricD2, D3
110uCapacitor_SMD:C_0603_1608MetricC6
11N4148WTDiode_SMD:D_SOD-123D1
140MHzCrystal:Crystal_SMD_2016-4Pin_2.0x1.6mmY2
1AP7312-1833W6-7Package_TO_SOT_SMD:TSOT-23-6U5
1AS7341-DLGTambit_library:PSON80P310X200X110-8NU1
1BME280Package_LGA:Bosch_LGA-8_2.5x2.5mm_P0.65mm_ClockwisePinNumberingU3
1Conn_01x02_PinConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ4
1ESP8685Package_DFN_QFN:QFN-28-1EP_4x4mm_P0.4mm_EP2.6x2.6mmU8
1IP4234CZ6Package_TO_SOT_SMD:SC-74-6_1.55x2.9mm_P0.95mmU2
1LIS2DE12Package_LGA:LGA-12_2x2mm_P0.5mmU9
1SW_PushButton_Switch_SMD:SW_SPST_EVQP2_ShortPushTravel_H2.1mmSW2
1USB_C_ReceptacleConnector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12J2
1secondBoardConnector_PinSocket_1.27mm:PinSocket_1x04_P1.27mm_VerticalJ5

Similar boards

  • 2 layers48.2 × 24.9 mmTemp sensor, the printed circuit board in 3D

    Temp sensor

    juniper-garden/twig_temp_humidity_sensor

    Hardware files for the temperature and humidity sensor

    56 partsGPL-3.0
  • 4 layers94 × 140 mmPower, the printed circuit board in 3D

    Power

    LokiMetaSmith/handheld-scanner

    A handheld version of the PlasticScanner

    131 parts5
  • 4 layers20.6 × 42.5 mmRoundScanner, the printed circuit board in 3D

    RoundScanner

    Global-Health-Engineering/plastic-scanner

    Especially for small-scale recycling facilities and projects with limited financial resources, commercial plastic scanners are extremly expensive.

    79 parts3GPL-3.0
  • 2 layers39.6 × 18 mmSnowBackpack, the printed circuit board in 3D

    SnowBackpack

    wandering-nora/SnowBackpack

    A little driver for SnowPixel displays

    110 parts1CERN-OHL-S-2.0
  • 2 layers60 × 77.7 mmHard EnvSens, the printed circuit board in 3D

    Hard EnvSens

    IgorFJensen/Hard-EnvSens

    106 parts
  • 6 layers16 × 11 mmPTR nano pcb, the printed circuit board in 3D

    PTR nano pcb

    PTR-projects/PTR_nano_hardware

    Welcome to the KPPTR-hardware repository! This repository contains the design files for the hardware components used in the KPPTR project.

    65 partsMIT
  • 2 layersNeopixel project v3.0, the printed circuit board in 3D

    Neopixel project v3.0

    Scrarf/Neopixel-project-v3.0

    PCB for ESP8685H4 WIFI based RGBW led driver.

    64 parts
  • 4 layers21 × 58 mmPico2350-W R1, the printed circuit board in 3D

    Pico2350-W R1

    zeankundev/boards

    A collection and an archive of KiCad projects I made. Contains projects from 2023 - 2024.

    71 parts1

Questions

How big is the MiniParMain PCB?

It measures 25 × 40 mm and has 4 copper layers, 1.58 mm thick.

What parts does the MiniParMain use?

36 parts, built around the ESP8685H4, AS7341-DLGT, BME280 and IP4234CZ6. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the MiniParMain KiCad files?

From the Jan-IngenHousz-Institute/miniPar repository on GitHub, at the commit this page was made from: the board is KiCad/miniParMain.kicad_pcb and its schematic KiCad/miniParMain.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the MiniParMain design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).