Posts

Driving the Cheeky Mail Notifier from Arduino


Arduino developer known as Krulkip sent me this little article along with Arduino sketch and video clip. To fit it into the blog I had to do some reformatting; what follows is Krulkip’s article – enjoy!

The webmail-notifier from Dreamcheeky is advertised as follows:

The WebMail Notifier has pretty light and optional sound alert software to tell you when you have email on one or all of your accounts, including Facebook. Dream Cheeky did what we do best with this product… helping you be more unproductive at the office. Now when you sneak off to the bathroom to check personal emails on your Blackberry, your trip will definitely not be wasted.
WebMail Notifier supports: Gmail, Yahoo, Outlook Express, POP3, Weibo, Facebook, Twitter, etc.

I wanted to control the Webmail Notifier from an arduino. As this is a USB device i needed to use the usb-host-shield manufactured by circuitsahome. With a little help from Oleg from circuitsathome and with the windows program from Frederic Delhoume i finally managed to get it working. What was needed was to send the unit two initialization sequences:

init1[7] = { 0x1F, 0×01, 0×25, 0×00, 0xC4, 0×00, 0×25, 0×03 };
init2[7] = { 0×00, 0×01, 0×25, 0×00, 0xC4, 0×00, 0×25, 0×04 };

Then you send the colour code eg:

msg3[7] = { 0xFF, 0xFF, 0×00, 0×00, 0×00, 0×00, 0×25, 0×05 };

As Oleg explains “To write to HID device you either need an OUT endpoint or write to control endpoint.” In the end i used the Usb.setReport command similar to that used in the keyboard example where the keyboard LEDs are turned on/off.

Continue reading Driving the Cheeky Mail Notifier from Arduino

Building Google ADK hardware from standard components


Soon after Google ADK announcement it was discovered that $300 Arduino-based ADK hardware kit (out of stock at the time of this writing) is not really necessary; the same functionality can be achieved with standard Arduino board and USB Host Shield. Today, one of the developers sent me a link to GoogleADK – site, which explains how to build Google ADK hardware from standard components and use it.

The site shows how USB Host Shield looks like when all headers are soldered in place. It also has Get Started page which gives step-by-step instructions on installing necessary software components on Linux box. Word of caution – the link on this page points to the product page of old rev.1.xx shield, even though all pictures show the current rev.2.0 one.

At present, the site is pretty lean but it is a good start nevertheless. I will be monitoring it to see if any new content would come up. Arduino-Android tandem offers very interesting capabilities and I’m hoping to see many cool Android-based projects soon.

Andriod ADK-compatible USB Host Library release.

UHS Charging Android

UHS Charging Android


Android Open Accessory Development Kit, announced on Google IO the other day is a hot topic. Android Open Accessory support, introduced in Android 3.1 (tablet OS) and backported to 2.3.4 (phone OS), allows external USB devices to interact with Android phone/tablet switched to so-called “accessory” mode. Because phones are USB functions (AKA devices) this accessory device must act as USB host. Arduino USB Host Shield has been around for couple of years providing USB Host functionality for standard and Mega form factor official Arduinos, as well as several clones. Luckily for all Arduino enthusiasts out there, Google decided to adopt this very architecture for hardware component of ADK. As a result, said enthusiasts now have well defined and documented code layer to interact with Android devices, ready to run on Arduino board of their choice. Well, almost.

The ADK code is targeted for ADK hardware component, which is just Arduino Mega 2560 and USB Host Shield combined on a single PCB. However, they decided to move some pins around; as a result in order to use the code with standard “Arduino plus Shield” setup certain code modifications are necessary. One such modification has been posted on Romfont. I tried it and the code works well, however, this approach has issues. First, it creates yet another distro. Second, the code modification exercise would have to be repeated each time Google releases new version of ADK. Finally, it’s difficult to have both standard and Google USB librares installed in Arduino IDE at the same time. Given all that, I decided to take different approach.

Google’s variant of USB Host Shield library differs very little from official library. The only significant difference is newInTransfer() member function of USB class, which returns real length of received packet. In order to support AndroidAccessory component in official library, I simply added this function to the library code and made a new release – it is now available on gitHub. I placed it into “dev” branch for now – it will be moved to “master” after a period of testing.


Continue reading Andriod ADK-compatible USB Host Library release.

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?

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

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