Posts

Using HID device for RC control

[ EDIT ] Here is a link to The Tx Project source code [/EDIT]
This is another RC car related post. This time, Santiago Saldana has created a device that allows you to control any RC car,plane,helicopter, etc. using any HID joystick. The “Tx Project” makes use of an Arduino, an Assan Hack Module, a HD44780 LCD, and a USB Host Shield v1.0. The project also makes use of a Trimersion Headset for FPV control of the RC Car, a Microsoft Sidewinder Racing Wheel, and a 900 Mhz Video transmitter / receiver. Code is open source and will be made available after beta testing, or upon request if there is interest. The code makes us of my MAX3421E and USB Host libraries as well as borrowing HID parser code from the LUFA project.

First video is from an earlier version, but demonstrates the devices flexibility in USB device input. The second video is from a presentation Santiago made at Wake Forest University’s Computer Science department.

Arduino USB Host 2.0 library progress report


[EDIT] r2.0-compatible PTP code has been released, see here [/EDIT]
A significant progress has recently been made in Arduino USB Host 2.0 library development. The estimated release date is still several months away; however, I just can’t wait that long to share my excitement. A hub support is now fully incorporated into the library, as well as all necessary multi-device support – connect/disconnect, initialization and event handling. The very first device class implemented for the new library is ever-popular PTP digital camera control. A short Youtube video shows Arduino controlling two different camera systems simultaneously.

Some interesting numbers: a sketch used to drive cameras in the video takes 19K and contains one instance of USB, one instance of hub, one instance of EOS and one instance of Powershot class. The same sketch with only one camera instance takes 17K, which means one camera instance occupies roughly 2K. Since ~30K of program memory is available on Atmega328P-based Arduino board, it should be possible to drive seven cameras with a single Arduino! Also, I’m using development version of code with lots of debug strings and other less-than-necessary stuff – release version will definitely be smaller.

Watch the video, stay tuned to the code development and please let me know what you think about all that! Multi-camera control opens new exciting possibilities – anyone interested in (relatively) cheap 3D video rig?

Arduino USB Camera Controller – Status Report 1

Cam.controller rev0

Cam.controller rev0

This is first iteration of camera controller layout inspired by Fernando Radi’s project. I designed a PCB containing Arduino Pro Mini, USB Host Mini, as well as other small parts necessary to complete the circuit. The whole thing is about the size of 16×2 LCD display and 1 inch high.

Next picture shows the controller with LCD removed. LCD connector is at the top left. Two resistors below the connector set the screen contrast. Slide switch next to LCD connector turns backlight on/off while power switch sits at the top right. USB Host Mini and Arduino Pro Mini are mounted underneath the LCD; encoder and “Back” button are placed to the right of LCD.

Project files include Eagle schematic and board layout, as well as a pdf of bottom side of PCB ready to be used in toner transfer process. EOSCamController code can be run on this board with no modifications. Some encoders have their A,B outputs swapped so if you see screen navigation moving backwards, swap encoder outputs. If you want to build this controller, refer to Eagle board layout file for part and jumper placement.

Cam.controller with LCD off

Cam.controller with LCD off

In the next iteration of the layout, I’m planning to move power switch to the left closer to backlight switch and use right-angle encoder and “Back” button. I will also try to find space for a LiPo charger. Stay tuned and please leave a comment if you have better layout in mind!

Oleg.

Practical implementation of Arduino USB Camera Controller

Micro Camcontroller

Micro Camcontroller

Fernando Radi sent me pictures of the project he’s recently finished. It is Arduino Digital Camera Controller ( which has been posted back in January as a proof-of-concept circuit ) with some clever modifications – Fernando used Mini variant of the shield, Arduino Pro Mini and ultra-tiny LCD. As a result, the controller is very small. Make sure to read Fernando’s comment to the article linked above for construction details. Also, I suggest visiting Fernando’s blog – I don’t know Spanish well enough to read his posts but his photographs are very good!

..Electronics is not my field of expertise and I do not have any tool other than a Dremel, so the enclosure is not fancy but small enough and fit my needs. BTW, the one in the picture was the third attempt, dremel is very slippery 😉

This quote from Fernando’s e-mail triggered another idea that I want to share with my readers. I understand that many people who want to make a camera controller are not familiar with building electronic circuits from small parts. To help them, I’d like to put together a kit containing necessary parts (i.e., USB Host, Arduino, LCD, switches, buttons, etc.) plus PCB to solder parts to and a small enclosure. A PCB will be laid out using large traces so that builders who possess home made PCB fabrication skills can save some money. I’m thinking about using standard size LCD instead of super tiny one to keep the circuit simple. Estimated end-user price for this kit is going to be $75-80. Let me know what you think about the kit and especially price. I’m currently playing with overall layout and hoping to post something in about a week or two.

Thanks again, Fernando for sharing your project with us!

Camcontroller close-up

Camcontroller close-up

USB Host Mini Hardware Manual

Layout of USB Host Mini

Layout of USB Host Mini

Detailed description of USB Host Mini has been added to USB Host Shield Hardware Manual. New information covers interface and power pins, pads and jumpers, as well as usage hints and possible board modifications.

USB Host Mini is more difficult to use than its full size brother. I’m hoping that information posted will be useful for developers who incorporate my little board into their designs. If I missed something, please let me know.

Oleg.

Generic PTP control of digital cameras

Development of Arduino_Camera_Control library (which runs on top of USB_Host_Shield library written to support USB Host Shield ) continues at steady pace. Nikon point-and-shooters has been on a test bench for the last couple of weeks and they are already talking. Even more exiting is the fact that they are talking the language we already know – the plain old PIMA 15740-2000.

Arduino-controlled Nikon P100

Arduino-controlled Nikon P100

It also looks like that PTP protocol implementation in all Nikons is very close to the standard with very few vendor extensions and it will be possible to use the same code base for both point-and-shoot cameras and DSLRs. In this article, I’m showing a lightweight implementation of Capture command for Nikon cameras. Unlike its’ sister sketches, EOSCapture and PSCapture, this one can’t really be called NikonCapture – keep reading to find out why.

The InitiateCapture command, which is part of standard PTP command set can be seen in PTPDevInfo output of several Canon PowerShot and all Nikon cameras – see, for example, Canon A640 section, line 82 or Nikon Coolpix S4000, line 47. Regrettably, PowerShots seem to require setting D045 vendor-defined property before this command will be accepted by the camera; therefore, PowerShot-specific class would have to be instantiated, adding significantly to program size. On the other hand, Nikons are happily executing InitiateCapture as-is.

The following sketch does what other “…Capture” sketches do – it takes a shot once a second second in an endless loop. What makes it different is that it doesn’t use any vendor-specific code, compiles in ~9K and can be loaded into Atmega168-based boards leaving plenty of room for another functions.


Continue reading Generic PTP control of digital cameras

USB Host Shield Hardware Manual

USB Host Shield 2.0 pinout

USB Host Shield 2.0 pinout


Today, I posted a static page containing USB Host Shield hardware manual. On this page, I give introduction to the shield hardware, explain board layout, connectors and jumpers. Finally, I show some useful modifications that can be made to the board to expand its capabilities.

I decided to post it incomplete – at present, only 2.0 shields are covered. However, I’m not going to stop here – Mini will be described next followed by rev.1xx. Owners of rev.1xx may want to take a look at current page anyway since 2.0 and 1.xx are not that different.

While writing this manual I tried to cover every detail. If you think that I missed something, please let me know!

Enjoy,
Oleg.

USB Host Shield 2.0 released

USB Host 2.0 connected to Arduino Mega 2560

USB Host 2.0 connected to Arduino Mega 2560

A major revision of USB Host Shield for Arduino has been released and is available in the store. The board’s improved layout makes this shield compatible with more Arduinos, makes it easier to use and opens new possibilities. The main differences from rev.1xx are outlined below:

  1. The SPI interface has been moved to ICSP header making shield compatible out of the box with “big” Arduinos – Mega and 2560. Standard size boards, such as Duemilanove, UNO, as well as clones with classic connector layout, are also compatible with this revision of the shield. This compatibility is maintained on a software level as well – all necessary code changes are performed using conditional compilation preprocessor directives.
  2. USB connector has been moved to the opposite side of the board. All external connectors are now in the same place making enclosure layout easier.
  3. MAX3421E RESET line is no longer handled by dedicated Arduino pin. While MAX_RESET pin is still used in current version of USB Host library, it will be dropped from the next major revision of the code.
USB Host Shield 2.0 with AVR Dragon

USB Host Shield 2.0 with AVR Dragon

Besides “Mega-formfactor” compatibility, connecting to Arduino SPI signals on ICSP connector has several advantages. First of all, in this layout traces are much shorter and as a result, the shield works more reliably at higher SPI speeds and/or larger signal and power noise. Second, since the 2X3 connector, which comes bundled with the shield, is of ‘stackable’ variety, it is possible to connect AVR Dragon or other ICSP programmer to Arduino while USB Host Shield is mounted – picture on the left shows the arrangement. Finally, pins 11-13, occupied by SPI signals on “classic” Arduinos, are vacant on Megas and also uncommitted on the shield. Therefore, they can be used for other purposes without USB library code modifications.

The shield comes in 2 configurations. One, called “Standard” is compatible with official full-size Arduino boards (Duemilanove, UNO, Mega, Mega 2560, and possibly others), as well as clones which supply both 3.3V and 5V to the shield. One example of such clone is BlackWidow; if you are aware about other compatible clones, please let me know.

Another configuration, called “3.3V” is designed for battery-operated projects. It is compatible with Sparkfun’s Arduino Pro 3.3V board (I’m not aware of any other 3.3V-only full-size clones). It also supplies 3.3V to VBUS instead of spec’d 5V, therefore some bus-powered devices may function erratically (but not necessarily; I actually use bus-powered USB flash drive during final testing of production 3.3V shields). Self-powered devices, such as digital cameras, usually don’t care about VBUS voltage at all. Additionally, board layout makes it possible to mount external power supplies to generate 5V from 3.3V and vice versa, if necessary.

The shield is compatible with current version of USB library. It is also very similar to rev.1.xx shield and information from previously posted articles is mostly valid for 2.0 board. Schematic and Eagle CAD files are also available for download. I am currently working on detailed description of the shield and hoping to get it ready in a week or two.

Along with this shield I will continue producing rev.1.21 board – there are still “not-so-compatible” Arduino clones around. However, next major revision of USB library will not be compatible with rev.1xx shields; it will be possible to make it work after minor hardware/software modifications.

As always, your questions and comments about the product are welcome and appreciated.

Oleg.

RC car controlled by Wii Remote on Arduino

This is a quick post about another great project. Tomoyuki Tanaka AKA Tomo on this site, active in PS3 and Wiimote game controllers thread, AKA moyuchin on Youtube posted this little video of RC car controller made of Wiimote, Arduino Pro Mini and USB Host Shield Mini interfacing with Bluetooth dongle. Check out the video to see how speed, direction and steering controls have been implemented.

Tomoyuki also made the code available on github. The code is based on Richard Ibbotson’s popular Wiimote Bluetooth code, as well as my MAX3421E and USB Host libraries. The code is well organized and even has a brief documentation in README file. Further development is on the way – Tomo is planning to add ultrasonic sensor support, so keep an eye on this repo. Good job, Tomoyuki and thank you very much for sharing your outstanding work!

Oleg.

Controlling Canon Powershot cameras with Arduino

Canon A640 shooting Arduino board

Canon A640 shooting Arduino board

The Canon Powershot support for Arduino PTP Library has been released. The library code, as well as several examples, is posted to GitHub. The code allows remote controlling shooting parameters of certain Canon Powershot cameras ( see gphoto and Canon SDK pages for the list of cameras) via USB using Arduino board equipped with USB Host Shield.

Every function of the camera available via buttons/menus can be initiated through PTP. This includes shutter button, shooting mode (Av, Tv, etc.), aperture and shutter speed values, zoom, focus, white balance, just to name a few. Code examples demonstrate control technique. In addition to examples, I added a static page with detailed description of Powershot library.

Most PowerShot cameras have two modes of operation – ‘shooting’ and ‘PC connect’, selected by a switch on camera body. Typically, USB is deactivated in shooting mode and communication with camera is not possible; for remote shooting, camera has to be switched to PC connect mode. Newer PowerShots switch to PC connect mode automatically when USB connection is detected.

Continue reading Controlling Canon Powershot cameras with Arduino