Easy Way to Connect I2C Sensor to PC (No Code, Browser Only)

by pinelab in Circuits > Sensors

36 Views, 0 Favorites, 0 Comments

Easy Way to Connect I2C Sensor to PC (No Code, Browser Only)

4759441767217793979.png
9801891768868762762.jpg

polluSensWeb lets you connect virtually any pollution sensor to a web interface using the Web Serial API — no firmware flashing, no custom drivers, no cloud lock-in, no code required. For I2C sensors specifically, version 2.1 introduced USB-to-I2C KEL adapter support, so you can now connect other I2C sensors to a PC similarly.

Supplies

What You Need

Hardware:

  1. Your I2C sensor (e.g. Sensirion SEN66, SCD41, SEN63C)
  2. The KEL USB-I2C adapter (available on Tindie)

Software:

  1. Chrome, Edge, Brave, or Opera (≥ v89) — Web Serial API is not supported in Firefox (with plugin possible) or Safari
  2. The polluSensWeb web app at wespeakenglish.github.io/polluSensWeb (no install needed)
  3. Many examples of JSON configuration for dozens of different sensors in sensors.json, some of them are I2C, on GitHub

How It Works (Concept)

I2C sensors don't have a USB port. The KEL USB-I2C adapter bridges that gap: the module is self-powered from the USB host and can supply up to 70 mA at 3.3 V or 5 V for external circuitry. After connecting the module to the PC's USB port, an extra (virtual) serial port is created. Application software accesses the adapter in the same way as a standard serial port — no special drivers or libraries are needed. Tindie

polluSensWeb then speaks to that virtual serial port directly in the browser.

Here's the full guide. Let me draw the connection diagram first:


Get the KEL USB-I2C Adapter

The KEL USB-I2C module (available on Tindie) is a small board that bridges I2C and USB. It self-powers from the USB host and supplies up to 70 mA at 3.3 V or 5 V for the sensor — so you usually need no external power supply. Once plugged into your PC it creates a virtual serial (COM) port automatically, with no special driver installation needed.

If you need to drive more for your sensor, an external power supply for the sensor needed.

Wire Your I2C Sensor to the Adapter

Connect four wires from your sensor to the adapter's header: VCC → VCC (choose 3.3 V or 5 V to match your sensor's rating), GND → GND, SDA → SDA, SCL → SCL. The adapter has no built-in pull-up resistors on the I2C lines, so you need to check if the sensor already have those resistors or you need to add external ones (from 2.2kOhm to 10kOhm). Check your sensor's datasheet to confirm the correct voltage level. The KEL adapter have maximum power limited by descriptor to 100mA. Up to this current you may dry from 5V bus, or up to 70 mA from 3.3V bus. Othervise, if higher currents needed, use the external power supply for the sensor.

Plug Into PC and Confirm the COM Port

Plug the adapter's USB end into your PC. On Windows, look in Device Manager under 'Ports (COM & LPT)' for a new COM port. On macOS, it will appear as /dev/cu.usbmodem…; on Linux as /dev/ttyACM0 or similar. No driver installation is required — the adapter enumerates as a standard USB CDC serial device.

Open PolluSensWeb in a Chromium-based Browser

Screenshot 2026-09-09 115141.png

Navigate to https://wespeakenglish.github.io/polluSensWeb/ or https://pollusensweb.pages.dev/ in Chrome, Edge, Brave, or Opera (version 89+). The Web Serial API — which the tool relies on — is not available in Firefox or Safari. You can also run it fully offline by downloading a release archive from GitHub and opening index.html locally, then loading sensors.json via the Custom JSON Sensor Configuration input.

Load Your Sensor's JSON Configuration

polluSensWeb identifies sensors via JSON config files. For built-in support, simply choose your sensor from the dropdown — the Sensirion SEN63C and SCD41 via KEL adapter are already included. For a different I2C sensor create your JSON based on examples from the repo and upload it using the 'Custom JSON Sensor Configuration' button in the interface. This JSON defines the serial port settings (baud rate, parity), the multi-command initialization sequence, frame structure, checksum rules, and how to parse each byte field into a readable value.

Connect and Visualize Live Data

Click Connect in the header bar, then select the virtual COM port the adapter created. polluSensWeb will send the initialization commands to the sensor and start parsing incoming frames. Create charts by clicking 'Create Chart', selecting which signals to plot (PM2.5, CO2, temperature, humidity, VOC, NOx, etc.), and adjusting colors and line styles. You can also enable the CSV export button to log all data with timestamps, or configure a webhook to forward readings to any HTTP endpoint.