Link Search Menu Expand Document


Maven CI Build Maven Central Status License: MIT Javadoc

A Device I/O library implemented in Java that is portable across Single Board Computers to provide an intuitive and frictionless way to get started with physical computing.


try (LED led = new LED(18)) {

Components can easily be connected together, e.g.:

try (Button button = new Button(12); LED led = new LED(18)) {
  button.whenPressed(nanoTime -> led.on();
  button.whenReleased(nanoTime ->;

As well as providing interfaces for interacing directly with physical hardware (i.e. GPIO, I2C, SPI and Serial), diozero also provides support for simple devices including LDRs, Buttons, and Motors through to complex environmental sensors such as the Bosch Sensortec Gas Sensor BME60.

This library makes use of modern Java features such as automatic resource management, Lambda Expressions and Method References to simplify development and improve code readability.

Supported Boards

diozero has out of the box support for the following Single Board Computers and micro-controllers:

Maven dependency:


Create your own application using the diozero-application Maven archetype:

mvn archetype:generate -DinteractiveMode=false \
  -DarchetypeGroupId=com.diozero \
  -DarchetypeArtifactId=diozero-application \
  -DarchetypeVersion=1.3.1 \
  -DgroupId=com.mycompany \
  -DartifactId=mydiozeroproject \

A distribution ZIP file containing all JARs and their dependencies is also available via Maven Central - locate com.diozero:diozero-distribution, select a version and click the “” option in the Downloads link top right. It is also available in mvnrepository by locating diozero-distribution, selecting a version and clicking the Files View All link.



Created by Matt Lewis (email (blog), inspired by GPIO Zero and Johnny Five. If you have any issues, comments or suggestions please use the GitHub issues page.

This project is hosted on GitHub, please feel free to join in:

  • Make suggestions for fixes and enhancements
  • Provide sample applications and device implementation classes
  • Contribute to development

Release History

This work is provided under the MIT License.


  • pigpio
  • gpoizero
  • Johnny Five
  • rpi_ws281x
  • Many more…