Project

breadkit

0.0
The project is in a healthy, maintained state
Breadkit resolves breadboard wiring descriptions into deterministic circuit connectivity and JSON IR.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0.4
~> 1.6
~> 2.0
 Project Readme

breadkit

Describe breadboard circuits in Ruby, YAML, or TOML. See how every connection fits together.

RubyGems version CI status Ruby 3.3 or newer MIT license

Breadkit resolves board holes, part pins, wires, and switch states into connected nets. It exports JSON IR for other tools and checks declared connection intent.

RP2040 breadboard circuit with an OLED, two SHT31 sensors, switches, and IR modules

Circuit source ยท Explore its layers

Quick start

Install with Ruby 3.3 or newer:

gem install breadkit

Save this as circuit.bk.rb:

title "Button and LED"
board :half

supply :USB, voltage: 5.0, plus: "B+1", minus: "B-1"
net :VCC, at: "B+1"
net :GND, at: "B-1"

button :SW1, at: "e10"
resistor :R1, "330", pins: %w[a12 a16]
led :D1, color: :red, anode: "b16", cathode: "b17"

wire "a10", "B+", color: :red
wire "a17", "B-", color: :black
breadkit nets circuit.bk.rb
breadkit ir circuit.bk.rb > circuit.json

This README follows main (0.2.0). If breadkit --version shows an older published release, use the source checkout for newer features. The same circuit is available in YAML and TOML.

Layered module example

The sensor demo combines an RP2040 module with an OLED, two SHT31 sensors, switches, and IR modules. Its layer: declarations group parts and wires in the interactive SVG. These lines are from the full example:

offboard :OLED, :ssd1306_oled, side: :right, at: "a7", address: "0x3C", layer: "2 I2C"
offboard :SHT31A, :sht31, side: :right, at: "a12", address: "0x44", unused: ["ALR"], layer: "2 I2C"
offboard :SHT31B, :sht31, side: :right, at: "a19", address: "0x45", unused: ["ALR"], layer: "2 I2C"

wire "j5", "T+5", color: "#E24B4A", layer: "1 Power"
wire "OLED.SDA", "g24", color: "#378ADD", route: :edge, layer: "2 I2C"

Run bundle exec ruby exe/breadkit nets examples/05_sensor_demo.bk.rb from a source checkout to inspect the full circuit. The optional 5 V emitter layer is an alternative: disconnect its 3.3 V feed before using it.

Explore

The companion repositories are breadkit-render for diagrams, breadkit-lint for circuit checks, breadkit-rspec for connection matchers, and breadkit-parts for model-specific definitions. Each gem is released independently.

Ruby DSL files execute code; load only files you trust. YAML, TOML, and JSON IR are parsed as data.

Development

git clone https://github.com/breadkit/breadkit.git
cd breadkit
bundle install
bundle exec ruby exe/breadkit nets examples/01_led_button.bk.rb
bundle exec rake

Clone companion repositories beside this checkout when working on their main branches. See the compatibility policy before changing a public data format.

License

MIT.