Skip to content

feat: docs: create BOM and wiring guide for data center monitoring kit#8

Open
Kasionchen wants to merge 8 commits into
Clawland-AI:mainfrom
Kasionchen:feat-1-20260421000000
Open

feat: docs: create BOM and wiring guide for data center monitoring kit#8
Kasionchen wants to merge 8 commits into
Clawland-AI:mainfrom
Kasionchen:feat-1-20260421000000

Conversation

@Kasionchen

@Kasionchen Kasionchen commented Apr 20, 2026

Copy link
Copy Markdown

Description

Create the complete hardware kit documentation for the data center night shift monitoring scenario (replaces $48,000/yr operator with $88 kit).

Changes Made

  • Added Bill of Materials (BOM) with purchase links
  • Added Wiring diagram with ASCII art and pin mappings
  • Added Assembly instructions with detailed connection steps
  • Added PicoClaw skill configuration
  • Added Alert thresholds and escalation rules
  • Added sensor drivers (DHT22, MQ-2, Water Leak)

Bounty Information

Cost Summary

Category Cost
Kit components $88
Annual operator salary $48,000
Payback period < 1 day

Files Added

  • kits/dc-guardian/README.md - Overview and use case
  • kits/dc-guardian/BOM.md - Complete parts list with purchase links
  • kits/dc-guardian/WIRING.md - Connection diagram and assembly instructions
  • kits/dc-guardian/skill.yaml - PicoClaw skill configuration
  • kits/dc-guardian/alerts.yaml - Alert thresholds and escalation rules
  • kits/dc-guardian/drivers/dht22.py - Temperature/humidity sensor driver
  • kits/dc-guardian/drivers/mq2_smoke.py - Smoke/gas sensor driver
  • kits/dc-guardian/drivers/water_leak.py - Water leak sensor driver

Note

Low Risk
Mostly additive kit documentation and example configuration files; risk is low, limited to potential confusion/breakage if the newly added MicroPython drivers/configs are treated as production-ready.

Overview
Adds a new kits/dc-guardian hardware kit package with end-to-end setup materials for data-center environmental monitoring.

Includes a BOM with purchase links, wiring/assembly guide, PicoClaw skill.yaml, and an alerts.yaml describing thresholds/escalation plus webhook/SMS hooks, along with initial MicroPython sensor drivers for dht22, mq2_smoke, and water_leak for on-device testing.

Reviewed by Cursor Bugbot for commit 6e411e0. Bugbot is set up for automated code reviews on this repo. Configure here.

@Kasionchen Kasionchen requested a review from Tonyfudecai as a code owner April 20, 2026 16:13

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6e411e0. Configure here.


# Step 5: Parse data
humidity = (data[0:16].count(1) / 16) * 100
temperature = ((data[16:32].count(1) / 16) * 100) - 40

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DHT22 bit parsing uses count instead of reconstruction

High Severity

The DHT22 data parsing logic is fundamentally incorrect. It counts the number of 1-bits in the 16-bit sequences (data[0:16].count(1)) instead of reconstructing the actual integer values from the bit array. The DHT22 protocol encodes humidity and temperature as 16-bit integers (divided by 10), so the bits need to be assembled positionally (e.g., shifting and OR-ing). Counting 1-bits loses all positional information and produces completely wrong sensor readings for virtually all real-world values.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6e411e0. Configure here.

return float('inf')
# Vcc = 5V, RL = 10K (load resistor)
# Rs = ((5V - Vout) / Vout) * RL
Rs = ((3.3 - voltage) / voltage) * 10.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resistance formula uses wrong Vcc voltage constant

Medium Severity

The read_resistance method uses 3.3V in the voltage divider formula, but the comment on the preceding line and the wiring documentation both specify the MQ-2 sensor is powered by 5V. The formula Rs = ((Vcc - Vout) / Vout) * RL requires the actual supply voltage of the sensor circuit (5V), not the ADC reference voltage. Using 3.3V systematically underestimates Rs, producing inaccurate PPM readings that could miss dangerous smoke levels.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6e411e0. Configure here.


# Use smoke curve as general indicator
if ratio < 0.5:
return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke sensor returns zero at dangerous gas concentrations

High Severity

The read_ppm method returns 0 when ratio < 0.5, but a low Rs/Ro ratio corresponds to high gas concentration (sensor resistance drops as gas increases). This means at the most dangerous smoke levels—when the ratio falls below 0.5—the driver reports 0 PPM ("all clear"). This is a safety-critical inversion: the sensor goes silent precisely when danger is highest. The subsequent clamp on line 72 already bounds extreme values; this early-return guard silently discards them instead.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6e411e0. Configure here.

bit = pin.value()
data.append(bit)
while pin.value() == 1:
pass

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DHT22 bit-reading loops lack timeout, risk infinite hang

Medium Severity

The two while pin.value() == 0: pass and while pin.value() == 1: pass loops in the bit-reading phase have no timeout protection. If the DHT22 sensor disconnects, stalls, or sends a stuck signal mid-read, the monitoring system enters an unrecoverable infinite loop. The initial response wait (line 40–43) correctly uses a timeout, but the 80 subsequent busy-wait loops within the data phase do not. For a 24/7 unattended monitoring system, this means a single sensor glitch permanently hangs the device.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6e411e0. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant