Link Search Menu Expand Document


License: MIT Maven CI Build Maven Central Status Javadoc

A device I/O library implemented in Java that is portable across Single Board Computers and micro-controllers 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 APIs for interfacing 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 built-in support for the following Single Board Computers and micro-controllers. Its adoption of common userspace APIs means that it should work on all SBCs that can run Linux and all micro-controllers that can support the Firmata protocol.


diozero requires Java 11 or later - it has been tested on all JDK versions from Java 11 through to 17. Most use cases will only require the diozero-core JAR file which has just one other dependency - tinylog.

The best way to use diozero is via a Maven dependency:


You can initialise your own application using the diozero-application Maven archetype:

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

A full distribution ZIP file containing all JARs and associated dependencies is also available from 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.