Posts | Comments

Planet Arduino

Archive for the ‘USB’ Category

OpenAlarm Node 1.5.0

Format de la carte

Comme je l'évoquais dans un article précédent, Seeedstudio qui produit les pcb, m'a demandé un surplus de 17$ à cause des demi-trous en bordure de la carte, vu le cout total de production des PCB (9$ pour 10), ça fait une belle surprise et de toute façon, je n'étais pas convaincu de l'utilité / praticité de ces demi-trous, j'ai donc résolu le problème en augmentant quelque peu la largeur de la carte qui passe de 16mm à 19mm, rien de bien méchant et surtout un gain appréciable en terme de place disponible sur le PCB.

Améliorations par rapport à la version 1.0.0 :

  • L'ouverture du port USB à été agrandie car ça coinçait un peu sur la première version.
  • Certains composants ont été déplacés pour faciliter le montage
  • Les broches de programmation ont été agrandis (voir plus bas)

Comparatif visuel et à l'échelle entre un Funky v3, un OpenAlarm Node 1.0.0 et un OpenAlarm Node 1.5.0 :
Comparatif Funky v3, OpenAlarm Node 1.0.0 et OpenAlarm Node 1.5.0

Comme vous le voyez, nous sommes un poil plus gros que la version 1.0.0 mais ça reste très petit comme le prouve cette photo :
Un OpenAlarm Node 1.5.0 dans la main

Vue de derrière :
Vue de derrière

Entrées / sorties

Avec la taille gagnée, j'en ai profité pour revoir le mappage des entrées / sorties, maintenant, elles sont placées dans l'ordre de chaque côté de la carte, toutes groupées par fonction.

On trouve dorénavant sur le côté gauche les 3 broches d'alimentations VIN (entrée de 3.3V à 7V), GND, VCC (entrée de 3V à 5V), 4 entrées / sorties génériques ayant chacune une interruption matérielle D0, D1, D2, D3.
Sur le côté droit, on trouve 2 entrées analogiques A0 et A1 et d'autres entrées / sorties génériques D6, D7, D8, D9 et D12 (D8 et D9 ayant également des interruptions matérielles).

Les entrées / sorties d'un OpenAlarm Node 1.5.0

Sur l'ancienne version des OpenAlarm Node et sur les Funky, il n'est pas possible d'utiliser le port physique I2C car la broche PD0 (SCL) est utilisé comme broche d'interruption pour dialoguer avec le module radio.
À cause d'un bug dans la librairie JeeNode de pilotage du module radio, il n'était pas possible d'utiliser une autre broche, le problème étant résolu, j'ai libéré PD0 afin de pouvoir utiliser le port I2C directement, et c'est PB7 (D11) qui est maintenant utilisé pour le dialogue avec le module radio.

Le PCB

Un des principes des OpenAlarm Node est de pouvoir utiliser des cartes filles que l'on vient superposer les unes sur les autres avec le même principe que les shields d'Arduino ou la spécification Hats pour les Raspberry.
Nous avons donc un PCB pour la carte mère et des PCB pour chaque carte fille mais comme évoqué précédemment, un critère important est le cout et faire fabriquer plusieurs PCB, c'est onéreux. La plus petite taille de PCB disponible chez Seeedstudio étant de 5cm x 5cm, il y a de la place perdue (le PCB de la carte mère fait 19mm x 21mm), j'ai donc ajouté 3 cartes filles directement sur le PCB original, il ne reste plus qu'à découper (un coup de cutter et on casse proprement l'époxy).

Pour le prix d'un PCB, on se retrouve avec 4 PCB dont 2 utilisables comme des platines d'essais et une autre intégrant un chargeur de batterie LiPo.
Le PCB de la version 1.5.0 d'OpenAlarm Node

Les cartes filles

Pour ce premier batch d'OpenAlarm Node 1.5.0, j'ai donc inclut directement 2 cartes filles d'essai et 1 autre carte fille d'essai avec un chargeur LiPo à base de Max1555 qui chargera automatiquement la batterie lorsque le Node sera branché sur USB, un voyant permettant de voir si la charge à bien lieu.

Un OpenAlarm Node avec une carte fille proto sur laquelle on aperçoit un capteur infrarouge :
Carte fille Lipo pour OpenAlarm Node

Un OpenAlarm Node avec une carte fille LiPo :
Carte fille proto pour OpenAlarm Node

Programmation

Programmation du bootloader

Comme évoqué plus haut, les contacts de programmation du bootloader étant un peu trop petit sur la première version, ils ont été agrandi afin d'en faciliter l'utilisation.

Pad de programmation d'un OpenAlarm Node 1.5.0

Sur la première version des OpenAlarm Node, je soudais directement des fils sur le port de programmation afin d'envoyer le bootloader, c'était long, source de problèmes mais surtout, franchement pas pratique, j'ai donc fabriqué un outils parfait pour cette tâche :

Que peut-on faire avec une pince à linge en Inox et des pogopins (des pointes de contacts) ?
pince-a-linge-inox.png pogopin.png

On fait une pince de programmation très pratique !
Pince de programmation DIY Pince de programmation DIY

Programmation par USB

Le bootloader n'a besoin d'être programmé qu'une seule fois, par la suite, le programme est chargé directement par USB, comme pour l'ancienne version du PCB, j'utilise un port USB un peu particulier puisque ce dernier est directement sur le PCB, je ne suis pas rentré en détail dessus dans mes derniers articles, voici quelques informations à ce sujet.

Pour commencer, pourquoi ne pas mettre un port physique microUSB ?

  • Ça prend de la place, c'est épais
  • Ce n'est pas forcément plus solide
  • C'est toujours ça de moins à souder
  • Ça coute moins cher
  • Parce qu'on peut le faire !

Pour cela, il faut que votre PCB fasse 0.8mm d'épaisseur au maximum, vous aurez également à limer chaque côté du bord d'insertion sinon, vous aurez de mauvaises surprises...
Limage du connecteur USB avant insertion OpenAlarm Node en cours de programmation usb_1.jpg

Je n'ai pas eu de souci avec ce genre de connecteur, sauf un limage un peu trop léger du PCB, qui, lors de l'insertion à plié les contacts internes du connecteurs de la prise USB et l'a donc rendu inutilisable mais le connecteur PCB n'a absolument rien eu : PCB=1 / USB=0 ;).
Je maltraite pas mal les connecteurs et aucun n'a rompu (alors que sur les Funky v3, j'ai un connecteur standard USB qui s'est arraché) et ne montre de signe de faiblesse donc je pense que c'est une solution parfaitement utilisable...

La suite

Au niveau logiciel, beaucoup énormément d'évolutions aussi bien au niveau code embarqué que Python qui seront l'occasion d'un prochain article qui devrait sortir très prochainement...

Si vous êtes intéressé par OpenAlarm, si vous avez des conseils, si vous voulez participer, venez en discuter sur IRC, canal #madeinfr sur irc.freenode.net, vous pouvez également suivre les évolutions sur Twitter @hugokernel, un forum OpenAlarm est également disponible chez Madeinfr et enfin, tout ceci est sur GitHub / hugokernel / OpenAlarm.

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]



  • 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