Why don't you try it in practice and see for yourself?
Start with an analog comparator, say AP331 or LMV331 in SOT25/SOT23-5, with its VCC (pin 5) connected to USB +5V, GND (pin 2) to USB GND, output (pin 4) connected to a suitable current-limiting resistor and a LED cathode, the LED anode connected to USB +5V. For a typical red LED, 1kΩ should work well, limiting the current to about 3mA (which should still be quite visible) which both of these can sink on their output.
This configuration means that whenever the positive input (pin 1) has a lower potential than the negative input (pin 3), the LED will light up. The current drawn from the inputs is extremely low, under half a microamp (150nA typical), so it shouldn't affect the USB data lines.
So, you connect the negative input (pin 3) to one of the data lines, and the positive input to a voltage divider formed from two large-valued resistors.
That is R1 is connected between USB +5V and positive input (pin 1), and R2 connected between positive input (pin 1) and GND.
This means that whenever the data line (connected to negative input, pin 3) exceeds about 5V*R2/(R1+R2), the LED will light up.
For 0.9V, you'll want R1 to be 4 to 5 times R2, and the values high enough to not waste too much current; say R1+R2 between 50kΩ and 1MΩ.
For simplicity, I'd pick R2=100kΩ and R1=470kΩ, setting the threshold voltage to 0.79V – 0.96V, depending on the USB +5V voltage (which may vary between 4.5V and 5.5V).
In all, you'd need the comparator, three resistors (1kΩ, 100kΩ, 470kΩ), and an ordinary LED.
I do believe it would work
after a fashion, for low-speed and full-speed USB devices like mice and keyboards, but not for high-speed USB devices like memory sticks. The signaling level at high-speed is only 0.4V. You could compensate by changing R2=33kΩ, which would set the threshold to 0.29V – 0.36V depending on the USB +5V voltage.
Your insistence, however, tells my spidey-senses that this is an assignment you have: to find a way to use a simple transistor circuit to detect USB 1.1/2.0 data transfers. If so, the assignment is in error, because
it is the wrong way to do it. It is like using two nails connected to mains voltage to cook a sausage. It may technically work, but it isn't a sensible or safe way to cook a sausage at all. Yes, you can find devices online that do exactly this, but that is not a proof that it is sensible to do, at all. (If this is the case, whoever gave you the assignment has a specific circuit in mind, that they want you to discover. I have an inkling of what that circuit would be, but I am utterly disgusted at the idea.)
Now, let's consider the
proper solution.
Mine would be a Microchip USB2512B or USB2514B USB 2.0 hub chip, 24 MHz crystal, bunch of bypass capacitors, resistors (including strapping resistors making it bus-powered), only one downstream port, and the activity LED connected to SUSP_IND pin. You can find a full schematic of a four-port hub (without an activity LED, just a 100kΩ resistor R3 to ground) at
SparkFun's Github to use as a basis, but note that the 22Ω series resistors are not needed when using USB251x
B. You can easily design the board at EasyEDA, and have it manufactured and assembled at JLCPCB, for very little money. I know, because I am only a hobbyist, and yet this would easily be within even my skills. I know enough that the crystal PCB design would be the "tricky" part, but using the SparkFun KiCad files as a basis should make that easy and straightforward.
To save costs, I would leave out the connectors and the ESD protection, and instead use an USB A male - A female (USB 2.0 extension cable), cutting it in half, and solder the cables directly to the board. By my count, I'd need the USB251xB, a 24 MHz crystal and its two load capacitors, five 0.1µF = 100nF bypass capacitors, two 1µF bypass capacitors, a 3.3V regulator (500mA or more), six 100kΩ resistors, three 10kΩ resistors (for disabling the unused ports), a P-channel MOSFET for power control of the downstream USB 5V, and a red LED with a 1kΩ current-limiting resistor.
This is the closest equivalent of what USB devices have, when they have an activity indicator. Here, we use an USB hub with such an indicator; normally, the indicator LED output is provided by the USB interface chip on the device itself. On microcontrollers with native USB interfaces (including old AVRs like ATmega32u4 and 90USB1280, cheap WCH CH55xG E8051-based MCUs, ARM Cortex-M ones, and so on), there is an interrupt related to USB suspend, so one can use whatever GPIO pin for such an activity LED.
Why is the "transistor only" activity circuit wrong? Because the USB data pins' voltage levels do vary normally. Proper activity cannot be reliably detected in all situations from their instant voltage potentials only. Instead, the
state of the USB bus itself should be considered –– and that is exactly what the "suspend" state does: whenever there is no activity for 1 millisecond or longer, the bus is suspended. It does not affect the USB 5V supply, nor limit the current the device can draw from it, it is purely a logical state for the USB bus, with no active communications ongoing, and nothing to do with electrical power.
So, if you insist on exploring the "transistor only" route, do remember that doing that in a real life product would/should get you fired. (And if it is an exercise your professor gave you, they should be fired too.) It is the equivalent of cooking sausages with nails connected to mains, and selling the sausages for others to eat. Doing it properly, with an electric grill or stovetop and pan, takes a small investment up front, but leads to a better overall result for everyone (and more profit if you do it longer than a single day). Don't be the guy selling iffy sausages.