# How to control a USB device with a microcontoller?

Thread Starter

#### pyroartist

Joined Oct 9, 2015
88
I need to control a ZWO ASI120 astronomy camera from something like an Arduino or Trinket micro board. The ZWO will not share the commands with me for some reason. There are at least 2 free Windows programs that can control this camera: FireCapture and SharpCap. I only need to perform a few commands such as: Change exposure time (in ms.) and capture a single image or frame (this is a video camera with rolling shutter). I have used a free program called Simple USB Logger from IncentivesPro.com to look at the USB data stream while the FireCapture program is running. Looking at the USB log of commands after a capture, it is not obvious what is going on at all. USB is apparently a very complicated system for having only 4 wires!
So, my questions are: 1. Has anyone else successfully analyzed a USB data stream and programmed a micro to duplicate what a Windows program is doing?
2. Is there a tiny PC available that I could run one of these Windows programs on from battery power in the field? My thoughts about using a Micro are entirely because a laptop is too large for the small space I have available in an aircraft cockpit.

#### Attachments

• 617.4 KB Views: 4

#### shteii01

Joined Feb 19, 2010
4,644
windows tablet with usb?
windows smart phone with usb?

Thread Starter

#### pyroartist

Joined Oct 9, 2015
88
Thanks for the inputs. A Windows tablet would have too large a screen. I know nothing about Win cell phones. Would they be able to run a Windows computer program? The Arduino links don't apply to my USB camera.
I did do a search on mini PCs and found there is now a large assortment of these for around $130. Most include 3 USB ports so that I could connect to my camera and a mouse and a small remote keyboard. This would work. However this angle brings up a new question. One of the nice things about the Arduino, etc. is that you can easily control real-world phyical devices, like stepper motors and/or servos. How would you control a servo, for example, with one of these micro PCs. I don't recall seeing any such hardware. #### shteii01 Joined Feb 19, 2010 4,644 Thanks for the inputs. A Windows tablet would have too large a screen. I know nothing about Win cell phones. Would they be able to run a Windows computer program? The Arduino links don't apply to my USB camera. I did do a search on mini PCs and found there is now a large assortment of these for around$130. Most include 3 USB ports so that I could connect to my camera and a mouse and a small remote keyboard. This would work. However this angle brings up a new question.
One of the nice things about the Arduino, etc. is that you can easily control real-world phyical devices, like stepper motors and/or servos.
How would you control a servo, for example, with one of these micro PCs. I don't recall seeing any such hardware.
The mini pc that I have seen were usually in 300 usd range.
I have seen pc sticks for 80-150 usd, but those plug into monitor. I am not sure they work when they are not plugged into monitor.

#### philba

Joined Aug 17, 2017
960
I think you are getting ahead of yourself. First, you need to reverse engineer the protocol. Once you understand it, that will guide you on the next step. There is no substitute for understanding how USB works, in this case anyway.

I would spend some time to understand how USB cameras work. It is a safe assumption that ZWO didn't invent some completely new protocol so you just have to figure out what they started from. I'm pretty sure the information is out there, you just have to find it.

Thread Starter

#### pyroartist

Joined Oct 9, 2015
88
I did more seaching and found a Sydney Cadot who tried to reverse engineer the USB communication for this camera back int 2015. He posted his results on Github: https://github.com/sidneycadot/ZWO-ASI-ReverseEngineering/
Looking at his work, which is still incomplete, makes me think it might be way easier to buy a microPC from Amazon. It will take a lot of time and trials to understand the USB language enough to make this work. I think ZWO did invent their own protocol but I am not 100% sure on that.
There is some indication that the camera might use something called a INDI protocol. I will have to look further into that.
http://bbs.astronomy-imaging-camera.com/viewtopic.php?t=400&p=2211

Cheap mini-PC example:
https://www.amazon.com/gp/product/B06XKB9DXB/

Thread Starter

#### pyroartist

Joined Oct 9, 2015
88
I did more searching. Just in case anyone in the near future finds this thread: I have found what I was ultimately looking for. A small, battery operated computer with small display that is built to control the ZWO ASI120 camera in the field. Images are stored on a thumb drive. The computer is a Rasberry Pi (inside the box) so it seems you could get it to rotate a simple filter wheel using an RC servo or stepper motor with a small code mod. It is capable of controlling the ZWO filter wheel but that accesory costs more than the camera! The price of this box is \$149 which is reasonable considering all the work it would take to understand the details of the project. Here is the link:
http://www.sciencecenter.net/hutech/products/ss-one/1.htm as of this Febuary 2018 date. Thanks to shteii01 and philba for their help. The users guide is attached.

#### Attachments

• 5.7 MB Views: 2

#### nigelwright7557

Joined May 10, 2008
532