Get USB data on it's way from PC to printer

Hello

Is it possible to get usb data on it’s way from a pc to a printer?
I need this to trigger a relay when the printer is told to print something

I wanna use an arduino uno

PS. This is my first post

IIRC USB operates at something like 400MHz. An Arduino Uno operates at 16MHz so the answer is NO. Even with a fast enough microprocessor I don't know if you can interfere with a USB signal without corrupting it.

Maybe there is some LED on the printer that lights up when data is sent to it? If so you should be able to get an Arduino to detect that with a photo diode or light dependent resistor.

Probably even simpler to get the program on the PC to make something happen before it sends data to the printer.

Many PC program allow you to write the print output to a file. That would allow you to use your own PC program to send the data from the file to the printer having signalled to the Arduino that it was about to do so.

If you describe what you are trying to achieve someone may have a better idea.

...R

Robin is correct, and that answer really depends on the printer you are using. My HP printer wakes up long before any print is started.

Another problem would be the computer might send megabytes of data to the printer before it is told to "PRINT".

What exactly are you trying to accomplish?

If you are a good Windows programmer, you can write code to intercept data messages between a program and the USB connected to the printer.

Paul

I dont wanna write a c# program for the computer it’s running at bwcouse there is a risk that I ruin an existing system.
The same goes with the printer, I dont wanna cut any wires to get a signal.

The case is, a company has a computer with a labelprinter. When customers walks in, they have to check in at the computer and get the label. However, the customers walk right around the computer and walks throught the next door.
What I need is to keep the door locked until the printer has printed the label.
The door uses PIR sensor

I have not made the program running at the computer and dont wanna make a program to install at the computer.

I think the best way to do it is with a photoresistor or something, as mentioned

sorry for poor english :stuck_out_tongue:

SkraptZz:
I dont wanna write a c# program for the computer it's running at bwcouse there is a risk that I ruin an existing system.
The same goes with the printer, I dont wanna cut any wires to get a signal.

The case is, a company has a computer with a labelprinter. When customers walks in, they have to check in at the computer and get the label. However, the customers walk right around the computer and walks throught the next door.
What I need is to keep the door locked until the printer has printed the label.
The door uses PIR sensor

I have not made the program running at the computer and dont wanna make a program to install at the computer.

I think the best way to do it is with a photoresistor or something, as mentioned

sorry for poor english :stuck_out_tongue:

Your English is just fine.

You just need to think more about the problem. You don't need to know when the printer is told to print. You need to know when the paper label is moved.

Think about that and look at the printer to see where you can determine that. On the paper roll or sheet feed, or on the outputting of the label. Maybe break a light beam?

Paul

SkraptZz:
The case is, a company has a computer with a labelprinter. When customers walks in, they have to check in at the computer and get the label. However, the customers walk right around the computer and walks throught the next door.
What I need is to keep the door locked until the printer has printed the label.

To my mind (but maybe I'm just old) that does not sound like a problem that should be solved with technology.

...R

Thanks for your help :slight_smile:

I will take a look at the printer and see what I can use :slight_smile: