Connecting a USB device to the Edison Mini breakout board
November 6, 2014
In this post, we will connect a USB device to the Edison mini breakout board. If you haven't set up Edison yet, please go here, then come back to this post.
These are the supplies you will need:
- Micro USB OTG to USB Adapter (like this one)
- 9V battery snap connector (like this one; in my case, I soldered a 2-pin connector to a snap connector with open leads)
- 9V battery
- A USB device (I'm using the Creative Live! Cam Sync HD 720P Webcam)
Supplying power to the Mini breakout board
There are four primary ways to supply power to Edison using the Mini breakout board (more info can be found here):
- J2 (upper left)—a battery connector to supply power, such as a rechargeable Lithium Ion battery
- Micro USB port labeled J16 (2nd port from the top)—this is how the board was powered when we first set up Edison, but it can also act as a USB host
- J21 (lower right)—this is the main power input, where 7-15 VDC should be applied
- J22 (on the bottom of the board directly underneath J21)—a power jack can be soldered onto the circle and square solder pads to supply power; again 7-15 VDC should be applied
In order to use Edison as a USB host, power must be supplied externally using either J21 or J22. If you supply power with a battery on J2, it will not power the USB connector. So, let's connect a 9V battery to J21:
Make sure that the red wire is connected to the left pin and the black wire is connected to the right pin (ground). The board lights should now turn on!
Connecting a USB device
Attach the Micro USB OTG to USB adapter to J16 and connect the USB device (I am using a webcam in this example):
Let's check if the USB device is detected. First, SSH into Edison:
myedison is the name of your Edison.
lsusb at the prompt. This is a Linux command for displaying information about connected USB devices. Hopefully, your console output looks something like this:
The first line shows that my Creative Cam is detected.
You should be good to go with a lot of USB devices after following these steps. However, you may need to install drivers, as well. For example, if you want to use a webcam, I highly recommend using a UVC-compatible webcam, so that you can use the UVC Linux driver.
To install the UVC driver, type:
If the webcam was already plugged into the board, unplug and plug it back in to make sure the webcam is detected properly.
Verify that the webcam is detected by typing
dmesg -c. The console output should look similar to this:
Also, verify that the video device node has been created by typing
ls -l /dev/video0:
Congratulations! You have now successfully connected a USB device!