Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Node.js
  3. i2c-bus

i2c-bus

MITJavaScript

A Node.js library for I2C serial bus access on Linux boards like Raspberry Pi and BeagleBone.

GitHubGitHub
349 stars60 forks0 contributors

What is i2c-bus?

i2c-bus is a Node.js library that enables communication with I2C (Inter-Integrated Circuit) serial bus devices on Linux-based single-board computers like the Raspberry Pi and BeagleBone. It provides a programmatic interface to read from and write to sensors, displays, and other peripherals connected via I2C, solving the problem of hardware interaction in JavaScript environments.

Target Audience

Node.js developers working on IoT, robotics, or embedded systems projects who need to interface with I2C-based hardware components such as temperature sensors, accelerometers, or LCD screens.

Value Proposition

Developers choose i2c-bus because it offers a mature, feature-complete implementation of I2C and SMBus protocols with support for modern JavaScript patterns, extensive documentation, and proven reliability in production environments.

Overview

I2C serial bus access with Node.js

Use Cases

Best For

  • Reading data from I2C temperature sensors (e.g., MCP9808) on a Raspberry Pi
  • Controlling I2C-based actuators or motor drivers in robotics projects
  • Interfacing with I2C OLED displays or LCD screens from Node.js applications
  • Building IoT data loggers that collect sensor readings via I2C
  • Developing educational projects that teach hardware programming with JavaScript
  • Prototyping embedded systems that require communication with multiple I2C peripherals

Not Ideal For

  • Projects targeting non-Linux operating systems like Windows or macOS for embedded work
  • Applications requiring real-time, deterministic communication with strict timing constraints
  • Developers seeking high-level, device-specific abstractions for quick prototyping without hardware details
  • Teams without physical I2C hardware or needing built-in simulation for testing

Pros & Cons

Pros

Comprehensive Protocol Support

Implements both plain I2C and full SMBus commands, including reads, writes, and block transfers, as detailed in the extensive API section with methods like i2cRead, readWord, and writeByte.

Flexible Programming Styles

Supports promises, async/await, asynchronous callbacks, and synchronous execution, demonstrated in multiple usage examples for different coding preferences, enhancing developer ergonomics.

Robust Compatibility

Works with Node.js versions 10 through 20 and includes official TypeScript definitions, ensuring long-term support and type safety across various environments.

Device Discovery Capabilities

Includes bus scanning and functionality queries to detect connected devices and adapter capabilities, useful for hardware debugging and setup, as shown in the scan and i2cFuncs methods.

Cons

Platform-Specific and Config-Intensive

Only works on Linux-based systems and requires manual configuration for boards like Raspberry Pi, as noted in the installation section, which can be a barrier to quick setup.

Low-Level Complexity

Requires manual handling of buffers and device protocols without high-level abstractions for common devices, increasing development time and error potential, as seen in the raw examples using Buffer objects.

Performance Overheads

As a JavaScript library, it may have higher latency and lower throughput compared to native C/C++ alternatives, making it less suitable for time-sensitive or high-frequency communication tasks.

Frequently Asked Questions

Quick Stats

Stars349
Forks60
Contributors0
Open Issues7
Last commit2 years ago
CreatedSince 2014

Tags

#iot#i2c#hardware#embedded#beaglebone#beaglebone-black#nodejs#linux#javascript#raspberry-pi

Built With

N
Node.js

Included in

Node.js65.5k
Auto-fetched 18 hours ago

Related Projects

johnny-fivejohnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup.

Stars13,408
Forks1,733
Last commit2 years ago
serialportserialport

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!

Stars5,988
Forks1,011
Last commit6 months ago
usbusb

Improved USB library for Node.js

Stars1,652
Forks288
Last commit4 days ago
onoffonoff

GPIO access and interrupt detection with Node.js

Stars1,259
Forks124
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub