Connecting USB Hub to Arduino?

I need some help with connecting a USB Hub to an arduino. It is for an at home robotics project, and yes I am an Arduino noob at this point so don't give me to hard of a time. Any insight is greatly appreciated, but I mainly need to know which pins to plug the raw wires into. Also, can I power the USB hub through the Arduino with a 9v battery?

Here are pictures of what I am doing:

What are you trying to achieve?

You cannot communicate with USB devices from an Arduino without a USB host shield (or module).

Let me be the first, of many, many, to say a 9V brick is a rotten choice for power for anything beyond a bare arduino.

From your picture it looks like you are thinking of connecting the wires from the USB system directly to an Arduino.

That is completely impractical. USB operates at 400MHz or more and an Arduino only works at 16MHz.

While you can use a USB Host shield with an Arduino you will still be faced with the performance limitations of the Arduino and in any case there is only a limited range of USB devices that will work with the USB Hub.

Tell us what you want to achieve rather than how you think it might be done.

...R

From the pictures, it looks like you want to connect the upstream port of the USB hub (which would normally go to the computer) to the Arduino, so your sketch can talk to the devices connected to it. This is not possible without a host shield, and even with a host shield, you'll only be able to communicate with devices for which there are libraries/drivers available for use with it through a host shield (I think these are available only for common stuff like thumb drives and HID devices).

It looks like one of the things plugged in is a WiFi adapter - you can't talk to that with Arduino even with a host shield; you need to use a wifi adapter that works over serial (like the ESP8266) or SPI (like the ethernet shield).

Of course, we could all be misunderstanding you - if you're just planning to have the hub plugged into a computer, and the arduino connected to the hub, along with a few other devices, and the arduino would use the USB only to communicate with the connected computer, that's easy (electrically equivilent of just plugging it in - in which case, why not just plug it into the port?).

Robin2:
That is completely impractical. USB operates at 400MHz or more and an Arduino only works at 16MHz.

USB has fallback mode at 12mhz - you can clock an atmega chip at 12mhz, and then use vusb to fake USB. It's not compliant with the spec, and it takes a good deal of the processor's time, it's an advanced project, but it can be done, and it does work. Take a look at the USBAsp available online - The Atmega88 doesn't have USB support.

But I don't think vusb lets you act as a host, which it sounds like is what the OP wants to do...

DrAzzy:

That is completely impractical. USB operates at 400MHz or more and an Arduino only works at 16MHz.

It's not compliant with the spec, and it takes a good deal of the processor's time, it's an advanced project, but it can be done, and it does work.

I will happily hold my hands up and admit I was taking a shortcut. In this case I think it was a sensible shortcut.

...R