Skip to the content
PCBKitNew board
2 layers50 × 30 mmNirlabsScopeLevel, the printed circuit board in 3D

An ESP32-based anti-cant level for rifle scopes. Uses an ADXL345 accelerometer to detect tilt and provides real-time LED feedback so you know when your rifle is level before taking a shot.

Size
50 × 30 mm
Copper layers
2
Thickness
1.6 mm
Parts
21
Nets
17
Pads
54
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 7.0 (file 20231120)
Created
20 Apr 2026
Updated
2 May 2026

Overview

NirlabsScopeLevel is an open-source printed circuit board by nirinium, from the nirinium/nirlabsScopeLevel repository on GitHub. It is a 2-layer board of 50 × 30 mm with 21 parts on 17 nets.

It is built around the XIAO ESP32C3. Its parts include 7 resistors, 5 diodes, 2 ICs, 1 capacitor and 1 connector. It belongs with the ESP32 and RISC-V boards of this library.

Main components

1

README

README.md

nirlabs Scope Level

An ESP32-based anti-cant level for rifle scopes. Uses an ADXL345 accelerometer to detect tilt and provides real-time LED feedback so you know when your rifle is level before taking a shot.

Features

  • Three-zone indication — Level (green), Near-level (green fade + red flash), and Cant (red heartbeat double-pulse)
  • Directional feedback — Left or right red LED indicates which way you're canted
  • Hysteresis — Prevents flickering at zone boundaries
  • EMA filtering — Exponential moving average smooths sensor noise
  • Auto-calibration — Calibrates on boot assuming the device is held level
  • Battery monitoring — Low-battery warning via red LED double-blink every 5 seconds
  • Power management — Enters light sleep after 1 minute at level to conserve battery

Hardware

ComponentPin
Green LEDGPIO 25
Red LED (Left)GPIO 26
Red LED (Right)GPIO 27
Battery voltage dividerGPIO 34 (ADC)
ADXL345 SDAGPIO 21
ADXL345 SCLGPIO 22

Board: NodeMCU-32S (ESP32)

Zone Thresholds

ZoneRange
Level (green solid)< 0.5°
Near level (green fade + red pulse)0.5° – 1.5°
Cant (red heartbeat)> 1.5°

Build

This project uses PlatformIO.

bash
# Build
pio run

# Upload
pio run --target upload

# Serial monitor
pio device monitor

Dependencies

  • Adafruit Unified Sensor ^1.1.15
  • Adafruit ADXL345 ^1.3.4

Configuration

Key constants in src/main.cpp:

ConstantDefaultDescription
THRESHOLD0.5°Dead-level zone boundary
NEAR_ZONE1.5°Near-level to cant boundary
MAX_CANT5.0°Maximum urgency angle
HYSTERESIS0.15°Zone boundary flicker prevention
EMA_ALPHA0.4Filter smoothing (lower = smoother)
SLEEP_TIMEOUT60000 msIdle time before light sleep
BATT_LOW3.3 VLow battery warning threshold
DEBUG_MODEtrueSerial debug output (set false for production)

License

NIRINIUM|LABS

Parts

21
QtyValueFootprintReferences
5100RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R2, R3, R4, R5
4MH_3.2mmMountingHole:MountingHole_3.2mm_M3MH1, MH2, MH3, MH4
2100kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR6, R7
1100nFCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC1
1ADXL345_BreakoutConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalU2
1LED_GREENLED_THT:LED_D3.0mmD1
1LED_RED_LLED_THT:LED_D3.0mmD3
1LED_RED_RLED_THT:LED_D3.0mmD5
1LED_YEL_LLED_THT:LED_D3.0mmD2
1LED_YEL_RLED_THT:LED_D3.0mmD4
1LiPo_JST_PHConnector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_HorizontalJ1
1Power_Slide_SWButton_Switch_THT:SW_Slide_1P2T_CK_OS102011MA1QN1SW1
1XIAO_ESP32C3Seeed_XIAO:XIAO_ESP32C3U1

Questions

How big is the NirlabsScopeLevel PCB?

It measures 50 × 30 mm and has 2 copper layers, 1.6 mm thick.

What parts does the NirlabsScopeLevel use?

21 parts, built around the XIAO ESP32C3. 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 NirlabsScopeLevel KiCad files?

From the nirinium/nirlabsScopeLevel repository on GitHub, at the commit this page was made from: the board is kicad/nirlabs_scope_level.kicad_pcb and its schematic kicad/nirlabs_scope_level.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the NirlabsScopeLevel design in my own project?

Its repository states no licence, so its author keeps all rights: ask nirinium before reusing the design.

Similar boards

  • 2 layers40 × 30 mmEsphome xiao base, the printed circuit board in 3D

    Esphome xiao base

    0rax/esphome-xiao-base

    XIAO base board PCB & configuration for ESPHome based sensors.

    10 parts5CERN-OHL-S-2.0
  • 2 layers148 × 61 mmIrrigation controller, the printed circuit board in 3D

    Irrigation controller

    adriencarbonaro/irrigation-controller

    Irrigation System Controller

    40 parts2
  • 2 layers82.7 × 51.9 mmHollow Alarm, the printed circuit board in 3D

    Hollow Alarm

    NLEVEL-GIT/Hollow-Alarm

    An Alarm with Hollow Knight features

    11 parts1
  • 2 layers22 × 77.4 mmNB001, the printed circuit board in 3D

    NB001

    uwrov/nanofloat

    18 parts1
  • 2 layers55.5 × 38 mmExiFlexBoard, the printed circuit board in 3D

    ExiFlexBoard

    2525mura/ExiFlex

    15 parts
  • 2 layers34.9 × 56.5 mmHome Automation v1, the printed circuit board in 3D

    Home Automation v1

    aayu0-0/SEEED-RS485-Extension-Board-reverse-engineering-project

    SEEED RS485 Extension Board reverse-engineering project

    64 parts
  • 2 layers150 × 100 mmMemento, the printed circuit board in 3D

    Memento

    AID-IOT/IOT-Memento-Design

    A keepsake PCB built at the AICTE IDEA Lab, Poornima College of Engineering. It is a working board as well as a memento: a Seeed XIAO ESP32C3 drives four WS2812B LEDs and reads a BMP280 pressure/temperature sensor, and…

    13 partsMIT
  • 2 layers48.5 × 48.6 mmHandle bar, the printed circuit board in 3D

    Handle bar

    basic-bitch-foundation/Traffic

    18 parts