Posts with «hid» label

Turning an Arduino into a USB keyboard

The newly released Arduino Leonardo has a few very interesting features, most notably the ability to act as a USB keyboard and mouse thanks to the new ATmega 32U4 microcontroller. This feature isn’t exclusive to the Leonoardo, as [Michael] explains in a build he sent in – the lowly Arduino Uno can also serve as a USB HID keyboard with just a firmware update.

The Arduino Uno (and Mega) communicate to your computer through a separate ATmega8U2 microcontroller. Simply by uploading new firmware with the Arduino Device Firmware Upgrade, it’s easy to have your old Arduino board gain some of the features of newer boards such as the Teensy or Leonardo.

[Michael] goes through the steps required to make this upgrade work and ends his build by showing off an Arduinofied ‘cut, copy and paste’ button project as well as a few multimedia controls. You can check those builds out in the video after the break.

If emulating a USB keyboard isn’t your thing, it’s also possible to install LUFA firmware to emulate everything from joysticks to USB audio devices. Very cool, and very useful.


Filed under: arduino hacks, peripherals hacks
Hack a Day 29 Jun 12:01

USB Keyboard Support with the Arduino Uno


One of the exciting new features of the Arduino Leonardo is its ability to act as a USB human interface device like a keyboard or mouse. This can make interfacing hardware projects with third-party software much easier. For example, if you want to build a physical button to go backwards in your web browsing history, you can have the Arduino send your browser’s keyboard command for back each time you hit the button. But if you have an Arduino Uno, you’re not out of luck.

Michael Mitchell recently shared his tutorial on how to use DFU Programmer to update the firmware on the Atmega8U2, which, according to the Arduino documentation, “acts as a bridge between the computer’s USB port and the main processor’s serial port” on the Uno. Michael also points out that you’ll need to make a slight hardware modification to the board if you have the DIP version of the Uno board—SMD Uno owners can keep their soldering irons holstered for this one. Michael demos his tutorial with a volume controller for his Ubuntu box and naturally he offers all the code you need to make your own.

More:
The AWESOME Button: A Made-to-Measure USB Input Device


MAKE » Arduino 28 Jun 12:30
arduino  atmega8u2  hid  keyboard  usb  

New in the Maker Shed: Arduino Leonardo

We had a small stock of Arduino Leonardos in the Maker Shed for their announcement at Maker Faire but they sold nearly as fast as we could put them out. We finally got them back in stock so you can buy one right now in the Maker Shed (while they last!)

At first glance, the Arduino Leonardo looks just like an SMD version of the Arduino Uno with a micro USB port. It’s blue, has the same foot print, same pin-out, and the same layout as its brother. The internals are also very similar. It features nearly the same RAM, flash, and clock speed as the ATmega328 processor found in the Uno. So why is the Leonardo different? Because it uses the ATmega32u4. This processor has built in USB communication which eliminates the need for a secondary USB to serial converter. The ATmega32u4 creates a virtual (CDC) COM port on your computer every time it runs its bootloader. Since it’s virtual, it can also behave like an HID (Human Interface Device) meaning the Leonardo can “act” like a keyboard or mouse, opening it up to a whole new range of projects. This processor also has additional I/O capabilities, allowing pins 4, 6, 8, 9, 10, and 12 to be used as analog inputs (12 total vs. the UNO’s 6). In addition, the Leonardo has one additional PWM pin (13) and all 20 I/O pins can be used as digital pins.

Of course, this new functionality doesn’t come without a price (although the price is only $20!) Since the Leonardo uses a virtual COM port, it can make certain tasks a bit more complicated (see the Getting Started Guide.) For this reason, we recommend this board to makers with some Arduino experience. Also, some of the pin assignments are slightly different so while the Leonardo is compatible with most shields, it may not be compatible with all. Advanced shields that use I2C or SPI (such as Ethernet shields) will work so long as they were updated to match the new Arduino Uno layout that was released last year. For full shield compatibility and ease of use, see the tried and true Arduino Uno.

Features

  • Microcontroller ATmega32u4
  • Operating Voltage 5V
  • Input Voltage (recommended) 7-12V
  • Input Voltage (limits) 6-20V
  • Digital I/O Pins 20
  • PWM Channels 7
  • Analog Input Channels 12
  • DC Current per I/O Pin 40 mA
  • DC Current for 3.3V Pin 50 mA
  • Flash Memory 32 KB (ATmega32u4) of which 4 KB used by bootloader
  • SRAM 2.5 KB (ATmega32u4)
  • EEPROM 1 KB (ATmega32u4)
  • Clock Speed 16 MHz