Maker of open-source software and hardware.

Getting started with the USB host shield

Feature image

A week ago I wrote about building a USB host to Bluetooth LE bridge. I then ordered a Sparkfun USB Host Shield from one of the UK distributors, CPC Farnell.

The shield doesn't come without any headers, which prompted me to start organising the electronic components I have at the Swansea Hackspace, as I knew I had a spare set of headers there. I managed to find the headers last week, and soldered them on at the hackspace last night.

This morning I wanted to see if it works, so I plugged it into my old Arduino Duemilanove, released in 2009 and still going. I installed the USB Host Shield Arduino library[1] and loaded up the board_qc self-test sketch. The Arduino sketch uploaded without any problems. On the shield, I first had to connect the D7 pin to the RESET pin[2]. Also, note that there is a little power switch on the shield that you have to turn on ;)

The self-test ran without any issues. Note that to skip the GPIO test, you have to enter any character into the serial monitor and press Send. You also need to have a USB device (like a keyboard) connected during the self-test. As part of the self-test it connects to the device and displays the USB descriptor in the serial monitor. Very cool!

I then loaded up a HID keyboard sketch, and it worked flawlessly! I was able to type letters on the keyboard connected to the shield and see them appear in the serial monitor. It's pretty impressive that I could just plug a shield into a piece of hardware almost a decade old, load some code on it and it just works. Open-source hardware FTW!

usbShield2

If you'd like even more details on getting started with the USB host shield, see this great tutorial.


  1. See the README file for how to install the library ↩︎

  2. Why? I have no idea, but it was mentioned in the comments on the Sparkfun website ↩︎

#Electronics