Posts | Comments

Planet Arduino

Archive for the ‘USB’ Category

The USB interface is being increasingly used as a power supply and charging port for all kinds of devices, besides data transfer. A meter to measure the electrical parameters of devices connected to a USB socket or charger would be handy on any hacker workbench. The folks at [electro-labs] designed this simple USB power meter which does just that.

The device measures voltage and current and displays them, along with the calculated power, on the small 0.5″ OLED display. The circuit is built around an ATmega328. To keep the board size small, and reduce component count, the microcontroller is run off its internal 8MHz clock. A low-resistance shunt provides current sensing which is amplified by the LT6106 a high side current sense amplifier before being fed to the 10 bit analog port of the ATmega. A MCP1525 precision voltage reference provides 2.5V to the Analog reference pin of the microcontroller, resulting in a 2.44mV resolution. Voltage measurement is via a resistive divider that has a range of up to 6V. An Arduino sketch reads voltage and current data on the analog ports and displays measurements on the display. The measured data is averaged to filter out noise.

The OLED display has a SPI interface and requires the u8glib library. The project uses all SMD parts, but is fairly easy to assemble by hand and could be a nice starter project if you want to wet your feet on surface mount assembly techniques. It’s designed using SolaPCB EDA software, and the source files for schematic and board layout are available as a ZIP archive. Download the BoM and Arduino code and you have everything needed to build this nifty device.

Thanks to [Abdulgafur] for sending in this tip. And if you are looking for a more comprehensive solution, check the awesome Friedcircuits USB Tester which we reviewed earlier and is available in the Hackaday Store.


Filed under: Arduino Hacks
Lug
15

Using A TeensyLC To Emulate The XBOX 360 Controller

32-bit, 360, arduino, arduino hacks, ARM, fight stick, Programming, Teensy, teensyduino, teensylc, USB, xbox Commenti disabilitati su Using A TeensyLC To Emulate The XBOX 360 Controller 

After the release of Mortal Kombat X, [Zachery’s] gaming group wanted to branch out into the fighter genre. They quickly learned that in order to maximize their experience, they would need a better controller than a standard gamepad. A keyboard wasn’t going to cut it either. They wanted a fight stick. These are large controllers that look very much like arcade fighting controls and include a joystick and large buttons. [Zachery’s] group decided to build their own fight stick for use with a PC.

[Zachery] based his build around the TeensyLC, which is a 32 bit development board with an ARM processor. It’s also compatible with Arduino. The original version of his project setup the controller as a HID, essentially emulating a keyboard. This worked for a while until they ran into compatibility issues with some games. [Zachery] learned that his controller was compatible with DirectInput, which has been deprecated. The new thing is Xinput, and it was going to require more work.

Using Xinput meant that [Zachery] could no longer use the generic Microsoft HID driver. Rather than write his own drivers, he decided to emulate the XBOX 360 controller. When the fight stick is plugged into the computer, it shows up as an XBOX 360 controller and Windows easily installs the pre-built driver. To perform the emulation, [Zachery] first had to set the VID and PID of the device to be identical to the XBOX controller. This is what allows the Microsoft driver to recognize the device.

Next, the device descriptor and configuration descriptor had to be added to the Teensy’s firmware. The device descriptor includes information such as USB version, device class, protocol, etc. The configuration descriptor includes additional information about the device configuration. [Zachery] used Microsoft Message Analyzer to pull the configuration descriptor from a real XBOX 360 controller, then used the same data in his own custom controller.

[Zachery] programmed the TeensyLC using the Arduino IDE. He ran into some trouble here because the IDE did not include the correct device type for an Xinput device. [Zachery] had to edit the boards.txt file and add three lines of code in order to add a new hardware device to the IDE’s menu. Several other files also had to be modified to make sure the compiler knew what an Xinput device type was.  With all of that out of the way, [Zachery] was finally able to write the code for his controller.


Filed under: Arduino Hacks, ARM
Mag
06

A Tool For Spying On Serial Data

arduino, arduino hacks, com, eavesdrop, ESP8266, Microcontroller, microcontrollers, port, serial, snoop, terminal, USB Commenti disabilitati su A Tool For Spying On Serial Data 

[Piotr] was working on a recent Arduino project when he ran into a problem. He was having trouble getting his Arduino Pro Mini to communicate with an ESP8266 module. He needed a way to snoop on the back and forth serial communications. Since he didn’t have a specialized tool for this task, [Piotr] ended up building his own.

The setup is pretty simple. You start with a standard serial cable containing the TX, RX, DTR, and GND wires. This cable connects the Arduino to the ESP8266 WiFi module. The TX and RX lines are then tapped into. Each wire is routed to the RX pin of two different serial to USB adapters. This way, the data being sent from the Arduino shows up on one COM port and the data being transmitted from the module shows up on the other.

The next piece of the puzzle was coming up with a way to see the data more clearly. [Piotr] could have opened two serial terminals simultaneously, but this wasn’t ideal because it would be difficult to compare the timing of the data. Instead, [Piotr] spent less than an hour writing his own simple serial terminal. This one connects to two COM ports at the same time and prints the data on the same screen. The data from each COM port is displayed in a separate color to make it easy to differentiate. The schematic and source code to this project can be found on [Piotr’s] website.


Filed under: Arduino Hacks, Microcontrollers

[Gr4yhound] has been rocking out on his recently completed synth guitar. The guitar was built mostly from scratch using an Arduino, some harvested drum pads, and some ribbon potentiometers. The video below shows that not only does it sound good, but [Gr4yhound] obviously knows how to play it.

The physical portion of the build consists of two main components. The body of the guitar is made from a chunk of pine that was routed out by [Gr4yhound’s] own home-made CNC. Three circles were routed out to make room for the harvested Yamaha drum pads, some wiring, and a joystick shield. The other main component is the guitar neck. This was actually a Squire Affinity Strat neck with the frets removed.

For the electronics, [Gr4yhound] has released a series of schematics on Imgur. Three SoftPot membrane potentiometers were added to the neck to simulate strings. This setup allows [Gr4yhound] to adjust the finger position after the note has already been started. This results in a sliding sound that you can’t easily emulate on a keyboard. The three drum pads act as touch sensors for each of the three strings. [Gr4yhound] is able to play each string simultaneously, forming harmonies.

The joystick shield allows [Gr4yhound] to add additional effects to the overall sound. In one of his demo videos you can see him using the joystick to add an effect. An Arduino Micro acts as the primary controller and transmits the musical notes as MIDI commands. [Gr4yhound] is using a commercial MIDI to USB converter in order to play the music on a computer. The converter also allows him to power the Arduino via USB, eliminating the need for batteries.

[Thanks Wybren]


Filed under: Arduino Hacks, musical hacks
Gen
27

[Nikhil] has been experimenting with human interface devices (HID) in relation to security. We’ve seen in the past how HID can be exploited using inexpensive equipment. [Nikhil] has built his own simple device to drop malicious files onto target computers using HID technology.

The system runs on a Teensy 3.0. The Teensy is like a very small version of Arduino that has built-in functionality for emulating human interface devices, such as keyboards. This means that you can trick a computer into believing the Teensy is a keyboard. The computer will treat it as such, and the Teensy can enter keystrokes into the computer as though it were a human typing them. You can see how this might be a security problem.

[Nikhil’s] device uses a very simple trick to install files on a target machine. It simply opens up Powershell and runs a one-liner command. Generally, this commend will create a file based on input received from a web site controlled by the attacker. The script might download a trojan virus, or it might create a shortcut on the user’s desktop which will run a malicious script. The device can also create hot keys that will run a specific script every time the user presses that key.

Protecting from this type off attack can be difficult. Your primary option would be to strictly control USB devices, but this can be difficult to manage, especially in large organizations. Web filtering would also help in this specific case, since the attack relies on downloading files from the web. Your best bet might be to train users to not plug in any old USB device they find lying around. Regardless of the methodology, it’s important to know that this stuff is out there in the wild.


Filed under: Arduino Hacks, security hacks
Gen
27

A Remote for CHDK Cameras Made Possible with Arduino

arduino, arduino hacks, atmega 328p, bluetooth, camera, chdk, control, Infrared, IR, photo, Photography, remote control, USB Commenti disabilitati su A Remote for CHDK Cameras Made Possible with Arduino 

[AlxDroidDev] built himself a nice remote control box for CHDK-enabled cameras. If you haven’t heard of CHDK, it’s a pretty cool software modification for some Canon cameras. CHDK adds many new features to inexpensive cameras. In this case, [AlxDroidDev] is using a feature that allows the camera shutter to be activated via USB. CHDK can be run from the SD card, so no permanent modifications need to be made to the camera.

[AlxDroidDev’s] device runs off of an ATMega328p with Arduino. It operates from a 9V battery. The circuit contains an infrared receiver and also a Bluetooth module. This allows [AlxDroidDev] to control his camera using either method. The device interfaces to the camera using a standard USB connector and cable. It contains three LEDs, red, green, and blue. Each one indicates the status of a different function.

The Arduino uses Ken Shirrif’s IR Remote library to handle the infrared remote control functions. SoftwareSerial is used to connect to the Bluetooth module. The Arduino code has built-in functionality for both Canon and Nikon infrared remote controls. To control the camera via Bluetooth, [AlxDroidDev] built a custom Android application. The app can not only control the camera’s shutter, but it can also control the level of zoom.


Filed under: Arduino Hacks
Nov
13

High power of the UDOO “asks” for usage

arduino, camera, HDMI, LCD, soselectronic.com, UDOO, USB Commenti disabilitati su High power of the UDOO “asks” for usage 

obr1620_uvod

High power of the UDOO “asks” for usage. One of many occasions to make it is to use various available periphery thus gaining a truly universal platform.

Favorite powerful embedded SBC called UDOO (S975-G000-2100-C2) already found many fans. Maybe also because of its compatibility with the Arduino Due platform (hardware and software) and mainly, it´s possible to connect it with various accessories. Thanks to a wide range of interfaces (USB, Ethernet, bluetooth, WiFi, …) is a connection of periphery flawless, what´s also a case of the 5MPx camera (autofocus).

Despite miniature dimensions this camera provides very decent resolution and speed – for example VGA (640×480) @90fps or 1080p @30fps, or QSXGA (2592×1944) @15fps. Also beneficial is recording of a video in a full 70°field of view (FOV).For a practical usage and application development with UDOO also serves the „Starter kit EU” containing an adapter for the third USB, RTC battery holder, HDMI cable with the UDOO logo, USB/ Micro USB Type B cable, SATA power supply cable, power supply adapter and an 8 GB micro SD card.

Perhaps the biggest “attraction” is the spacious 7“ display KIT LCD 7”–Touch 800×480 px RGB with a capacitive touch panel. By connecting of this display with the UDOO microcomputer, we get a ready-made platform usable to control various processes, with a power, which easily suits to majority of applications. Detailed information about the UDOO can be found in our article: Do you want a microcomputer which will „handle everything“?.


High power of the UDOO “asks” for usage - [Link]

Nov
10

Introducing RFToy, an Arduino-compatible gadget for radio frequency modules

arduino, ATmega328, CH340G, OLED, RF, RFToy, USB Commenti disabilitati su Introducing RFToy, an Arduino-compatible gadget for radio frequency modules 

rftoy_annotated-1024x543

RaysHobby build a project called RFToy:

it’s an Arduino-compatible microcontroller board for interfacing with radio frequency (RF) modules, such as the popular 433/315MHz transmitter/receiver, and the nRF24L01 transceiver. The RFToy has a built-in ATmega328, USB-serial converter (CH340G), 128×64 OLED display, three buttons, and a coin battery holder. Programming is done in Arduino through the on-board mini-USB port. It has three sets of pin headers to directly fit RF modules, and an audio jack to output RF receiver signals to a computer’s sound card. Using RFToy you can build a variety of projects involving RF modules, such as remote control and wireless sensors.

[via]

Introducing RFToy, an Arduino-compatible gadget for radio frequency modules - [Link]

Ott
30

Banguino – 8-bit Processing Module

arduino, Banguino, microSD, uart, USB Commenti disabilitati su Banguino – 8-bit Processing Module 

dtx2-4008c_large_1

by dimitech.com:

Banguino brings the most popular hobby and DIY development platform in the world into a single chip DTX module and offers full backwards compatibility with the most used worldwide Arduino board – the model ‘Uno’.

Bonus features include an on-board power supply to generate +5V and +3.3V to the user’s external circuit, a microSD connector and additional 10 configurable digital I/O ports. There are also two software controllable LEDs on board as well as a USB-to-UART bridge. Banguino provides a highly integrated solution for building simple or complex circuits and benefiting from the large variety of already existing Arduino-compatible code.

Banguino – 8-bit Processing Module - [Link]

Ott
26

Walkman-esque Human Interface Device

arduino, arduino hacks, ATMEGA8, hid, human interface device, keyboard, multimedia, USB Commenti disabilitati su Walkman-esque Human Interface Device 

mc1_4

Cheap keyboards never come with extra buttons, and for [Pengu MC] this was simply unacceptable. Rather than go out and buy a nice keyboard, a microcontroller was found in the parts drawer and put to work building this USB multimedia button human interface device that has the added bonus of looking like an old-school Walkman.

The functions that [Pengu MC] wants don’t require their own drivers. All of the buttons on this device are part of the USB standard for keyboards: reverse, forward, play/pause, and volume. This simplifies the software side quite a bit, but [Pengu MC] still wrote his own HID descriptors, tied all of the buttons to the microcontroller, and put it in a custom-printed enclosure.

If you’re looking to build your own similar device, the Arduino Leonardo, Micro, or Due have this functionality built in, since the USB controller is integrated on the chip with everything else. Some of the older Arduinos can be programmed to do the same thing as well! And, with any of these projects, you can emulate any keypress that is available, not just the multimedia buttons.


Filed under: Arduino Hacks


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook