# Using WebUSB with Arduino and TinyUSB

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/080/077/medium800thumb/arduino_compatibles_webusb.jpg?1566937518)

This guide will show how the combination of the Open Source TinyUSB USB port software and the Chrome WebUSB browser capability provides programmers and users the ability to plug in microcontroller-based projects and have them interact with the user in a web browser. No additional code is required on the display computer other than a standard Chrome browser window (ie. no plug-ins, etc.)

This capability is ideal for schools, learning, ease of use, and assistive technology applications.

![](https://cdn-learn.adafruit.com/assets/assets/000/079/418/medium800/arduino_compatibles_webusb_and_tinyusb.jpg?1565794396)

## What is WebUSB?

[WebUSB](https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web) is a recent standard for securely providing access to USB devices from web pages. It is available in Chrome 61 since September, 2017 and all current versions.

One of the reasons the WebUSB API has been created: to provide a way to expose USB device services to the Web. With this API, hardware manufacturers are able to build cross-platform JavaScript SDKs for their devices. But most importantly, this&nbsp; **makes USB safer and easier to use by bringing it to the Web**.

Let's see what you can expect with the WebUSB API:

1. Buy a USB device.
2. Plug it into your computer.
3. A notification appears right away, with the right website to go to for this device.
4. Simply click on it. Website is there and ready to use!
5. Click to connect and a USB device chooser shows up in Chrome, where you can pick your device.
6. Tada!

What would this procedure be like without the WebUSB API?

- Read a box, label, or search on line and possibly end up on the wrong website.
- Have to install a native application.
- Is it supported on my operating system? Make sure you download the "right" thing.
- Scary OS prompts popup and warn you about installing drivers/applications from the Internet.
- Malfunctioning code harms the whole computer. The Web is built to&nbsp;[contain malfunctioning websites](https://www.youtube.com/watch?v=29e0CtgXZSI).
- Only use the USB device once? On the Web, the website is gone once you closed tab. On a computer the code sticks around.

![](https://cdn-learn.adafruit.com/assets/assets/000/079/417/medium800/arduino_compatibles_tinyusb-single.png?1565793872)

## How does TinyUSB Help?

[TinyUSB](https://github.com/hathach/tinyusb) is an open-source cross-platform USB Host/Device stack for embedded system. It is designed to be memory-safe with no dynamic allocation and thread-safe with all interrupt events are deferred then handled in the stack's task function.

While there are some other USB stacks for microcontrollers, notably the Arduino stack, TinyUSB is compatible with a wide range of microcontrollers, has better device support, and is MIT licensed.

The TinyUSB library is on Adafruit's GitHub repo [here](https://github.com/adafruit/Adafruit_TinyUSB_Arduino).

## WebUSB and TinyUSB Together

Adafruit has worked to ensure TinyUSB works with WebUSB. Together, they allow Adafruit and compatible microcontrollers to work with WebUSB browsers like Chrome with no drivers on the host computer/tablet/phone/chromebook. Super simple and this works well in environments like schools.

- [Next Page](https://learn.adafruit.com/using-webusb-with-arduino-and-tinyusb/computer-and-mobile-hardware.md)

## Featured Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### USB A/Micro Cable - 2m

[USB A/Micro Cable - 2m](https://www.adafruit.com/product/2185)
This is your standard USB A-Plug&nbsp;to Micro-USB cable. It's 2 meters long so you'll have plenty of cord to work with for those longer extensions.

Out of Stock
[Buy Now](https://www.adafruit.com/product/2185)
[Related Guides to the Product](https://learn.adafruit.com/products/2185/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
### USB C to Micro B Cable - 3 ft 1 meter

[USB C to Micro B Cable - 3 ft 1 meter](https://www.adafruit.com/product/3878)
As technology changes and adapts, so does Adafruit! Rather than the regular USB A, this cable has&nbsp; **USB C to Micro B** &nbsp;plugs!

USB C is the latest industry-standard connector for transmitting data _and_ power. Like Lightning and MagSafe cables, USB C has no...

In Stock
[Buy Now](https://www.adafruit.com/product/3878)
[Related Guides to the Product](https://learn.adafruit.com/products/3878/guides)
### Micro USB to Micro USB OTG Cable - 10-12" / 25-30cm long

[Micro USB to Micro USB OTG Cable - 10-12" / 25-30cm long](https://www.adafruit.com/product/3610)
This cable is a little unusual, rather than having a USB A plug on one end, it has _two_ Micro B USB connections! What is this for? It's for when you have a "USB On-The-Go (OTG)" device, and you want to plug in another USB device. For example, a Pi Zero or Pi Zero W has a...

In Stock
[Buy Now](https://www.adafruit.com/product/3610)
[Related Guides to the Product](https://learn.adafruit.com/products/3610/guides)
### USB 3-in-1 Sync and Charge Cable - Micro B / Type-C / Lightning

[USB 3-in-1 Sync and Charge Cable - Micro B / Type-C / Lightning](https://www.adafruit.com/product/3679)
As USB technology evolves you'll want the **One Cable To Sync/Charge All Things** (or, at least, portable devices with Micro-B, Type C, or Lightning ports) and this cable will do the job nicely

This very nice **USB 3-in-1&nbsp;Charging Cable** looks like...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3679)
[Related Guides to the Product](https://learn.adafruit.com/products/3679/guides)
### iOS Lightning to USB OTG Cable

[iOS Lightning to USB OTG Cable](https://www.adafruit.com/product/3940)
Your iOS phone or tablet may not have a USB port on the bottom but that doesn't mean you can't use it to connect USB devices. Secretly known as a 'Camera Connector' or 'MIDI Connector' cable, this doohicky plugs into the bottom of your iOs device and gives you a USB A...

In Stock
[Buy Now](https://www.adafruit.com/product/3940)
[Related Guides to the Product](https://learn.adafruit.com/products/3940/guides)

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Cam Follower Automaton](https://learn.adafruit.com/cam-follower-automaton.md)
- [Creating and sharing a CircuitPython library](https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library.md)
- [Adventure Time Coffee Cup Lamp with MakeCode](https://learn.adafruit.com/adventure-time-coffee-cup-lamp.md)
- [Circuit Playground Morse Code Flasher](https://learn.adafruit.com/circuitplayground-morse-code-flasher-makecode-circuit-python.md)
- [Make It Plot](https://learn.adafruit.com/make-it-graph-plot.md)
- [Sipping Power With NeoPixels](https://learn.adafruit.com/sipping-power-with-neopixels.md)
- [Custom Controllers for MakeCode Arcade](https://learn.adafruit.com/custom-controllers-for-makecode-arcade.md)
- [Using Piezo Buzzers with CircuitPython & Arduino](https://learn.adafruit.com/using-piezo-buzzers-with-circuitpython-arduino.md)
- [Anatomical 3D Printed Beating Heart with MakeCode](https://learn.adafruit.com/anatomical-3d-printed-beating-heart-with-makecode.md)
- [Con Badge with Circuit Playground Express](https://learn.adafruit.com/circuit-playground-express-con-badge.md)
- [Music Box with Dancing Adabot](https://learn.adafruit.com/music-box-with-circuit-python.md)
- [Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express](https://learn.adafruit.com/controlling-a-classic-nintendo-r-o-b-robot-using-circuit-playground-express.md)
- [Circuit Playground Minecraft Gesture Controller](https://learn.adafruit.com/circuitplayground-minecraft-gesture-controller.md)
- [Stand-alone programming AVRs using CircuitPython](https://learn.adafruit.com/stand-alone-programming-avrs-using-circuitpython.md)
- [¡Bienvenido a CircuitPython!](https://learn.adafruit.com/bienvenido-a-circuitpython-2.md)
