Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 22, 2026·3 min de lecture

Johnny-Five — JavaScript Robotics and IoT Platform

An open-source JavaScript framework for programming Arduino, Raspberry Pi, and other IoT hardware using a consistent, event-driven API in Node.js.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Johnny-Five
Commande d'installation directe
npx -y tokrepo@latest install 1f97ab25-85cf-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

Johnny-Five is a JavaScript robotics and IoT programming framework that lets Node.js developers control hardware like servos, sensors, LEDs, and motors using a familiar event-driven API. It supports over 75 board types including Arduino, Raspberry Pi, Intel Edison, and BeagleBone, making it the go-to library for building hardware projects in JavaScript.

What Johnny-Five Does

  • Provides a hardware-abstraction layer for controlling pins, sensors, servos, motors, and displays from JavaScript
  • Supports 75+ board platforms via IO plugins (Firmata, Raspi-IO, BeagleBone-IO, and more)
  • Offers an event-driven API with component classes like Led, Servo, Sensor, Button, and LCD
  • Includes a REPL for live interaction with connected hardware during development
  • Enables rapid prototyping of robotics and IoT projects using npm and the Node.js ecosystem

Architecture Overview

Johnny-Five communicates with microcontrollers through IO plugins that implement a standardized interface. The default protocol is Firmata, which runs on the microcontroller and exposes pin control over serial. The framework maps physical components to JavaScript objects with intuitive methods and event emitters, running the logic in Node.js on the host machine while delegating low-level I/O to the board firmware.

Self-Hosting & Configuration

  • Install via npm: npm install johnny-five
  • For Arduino, flash StandardFirmata from the Arduino IDE first
  • For Raspberry Pi, install raspi-io: npm install raspi-io
  • No additional system dependencies beyond Node.js and a supported board
  • Configuration is code-driven; pass board and pin options directly in constructors

Key Features

  • Unified API across 75+ board types with swappable IO plugins
  • Rich component library: LED, Servo, Motor, Sensor, Accelerometer, GPS, LCD, Relay, and more
  • Built-in REPL for live debugging and experimentation with connected hardware
  • Composable multi-board support for controlling several devices in one script
  • Active community with extensive examples covering drones, robots, wearables, and home automation

Comparison with Similar Tools

  • Arduino IDE — C/C++ based, compiled to hardware; Johnny-Five uses JavaScript and runs logic on the host
  • MicroPython — runs Python directly on the microcontroller; Johnny-Five keeps logic in Node.js with lower memory constraints
  • Cylon.js — similar JS robotics framework but less actively maintained and smaller component library
  • Firmata.js — low-level Firmata protocol library; Johnny-Five adds high-level component abstractions on top
  • PlatformIO — full embedded IDE and build system; Johnny-Five focuses on rapid prototyping, not firmware compilation

FAQ

Q: Does Johnny-Five run JavaScript on the microcontroller? A: No. JavaScript runs in Node.js on the host computer. The microcontroller runs Firmata firmware and receives commands over serial or network.

Q: Which boards are supported out of the box? A: Arduino (via Firmata) works by default. Raspberry Pi, BeagleBone, Intel Edison, Tessel, and ESP8266 are supported through IO plugins.

Q: Can I use Johnny-Five for production IoT deployments? A: It is best suited for prototyping and education. For production, consider pairing it with process managers like PM2 and a message broker for reliability.

Q: How do I add support for a new board? A: Implement a custom IO plugin that conforms to the IO Plugin interface, then pass it to the Board constructor.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires