Pages: [1]   Go Down
Author Topic: Reading data from a USB breakout  (Read 800 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I've disassembled an old printer I had and I took out this USB part out of it (images attached). How can I figure out which pin is GND, VC and data? Is there a standard that will apply to this board as well?

Thanks!



* photo 1.JPG (683.89 KB, 1632x1224 - viewed 25 times.)

* photo 2.JPG (625.1 KB, 1632x1224 - viewed 22 times.)
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 65
Posts: 2451
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It shows you here http://en.wikipedia.org/wiki/Universal_Serial_Bus
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

The Netherlands
Online Online
Edison Member
*
Karma: 44
Posts: 1509
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This "board" hardly deserves that name.
It is just a medium to put the one single USB connector on, and to connect it to the flatcable (which would indeed define a board).
There is nothing else on there.

Looking into the USB connector, you'll have pin 1 at the left, and pin 4 at the right.

pin 1 = 5 volts
pin 2 = - data
pin 3 = + data
pin 4 = 0 volts

Let me guess at what you have shown in the picture.
To be sure, you need a multimeter to beep the connections.

The first wire next to the USB connector is pin 1, then 2 and so on.
Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Offline Offline
Newbie
*
Karma: 1
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the info. Actually it was the other way around - The closest pin was the ground.
Now my problem is I always get 0's out of the (-) pin and 1's out of the (+) pin.
Should I read the data at any specific rate? Here's my code:

int data = 5;

void setup()
{               
  Serial.begin(9600);
  pinMode(data, INPUT);
}

void loop() {
  Serial.print(digitalRead(data));
  delay(1);
}
Logged

The Netherlands
Online Online
Edison Member
*
Karma: 44
Posts: 1509
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

USB means Universal Serial Bus.
But it has nothing to do with serial communications like you are attempting by Serial.begin and so on.

D+ and D- are differential datalines.
They will react in opposite directions in case of a 0 or a 1.
This will filter out interference, as there is no known differential interference (at least not by me smiley-wink ).

Sift through the link Riva posted to find out how USB works.
You'll find out you need to do something completely different to get your Arduino to work with USB and this connector.

Ofcourse you can use this connector for your own project in any fashion you like.
Just don't call it USB even if you are unsing that connector.
« Last Edit: January 26, 2013, 11:06:57 am by MAS3 » Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Norfolk UK
Offline Offline
Edison Member
*
Karma: 65
Posts: 2451
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Atmel have software USB drivers suitable for the ATmega chips called V-USB and someone has ported them over to work on the Arduino (see http://code.google.com/p/vusb-for-arduino/)
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

Offline Offline
Newbie
*
Karma: 1
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks MAS3 and Riva. You sent me in the right direction and hopefully I can take it from here  smiley-cool
Logged

Pages: [1]   Go Up
Jump to: