API & MCP

Everything a person can do on Ohmforge LED Resistor Calculator, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Ohmforge LED Resistor Calculator

Calculates the series resistor for one or more LEDs in series: R = (Vs − n·Vf) / I, rounds up to the next E6/E12/E24 value, and then verifies the actual current, LED voltage and resistor dissipation by simulating the circuit with Ohmforge's diode model. Suggests a power rating with 2× margin.

Inputs of Ohmforge LED Resistor Calculator
FieldTypeDefaultDescription
supply (required)number9Supply voltage
colourselect (red, orange, yellow, green, blue, white, ir, custom)"red"LED colour
vfnumber—Forward voltage (custom). Only used for "Custom".
current (required)number20LED current
countinteger1LEDs in series
seriesselect (E6, E12, E24)"E12"Resistor series

Example request

Red LED on 9 V at 20 mA

curl -X POST https://ohmforgeledresistor.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"supply":9,"colour":"red","current":20,"count":1,"series":"E12"}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "ohmforge-led-resistor": { "type": "http", "url": "https://ohmforgeledresistor.usefulweb.site/mcp" }
  }
}