Loading...
Pages: [1]   Go Down
Author Topic: Reading data from a USB breakout  (Read 473 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!

Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 25
Posts: 1426
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

The Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 383
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

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
Offline Offline
Sr. Member
****
Karma: 10
Posts: 383
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

Norfolk UK
Offline Offline
Edison Member
*
Karma: 25
Posts: 1426
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

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
Print
 
Jump to: