I have built a circuit containing a 2N3904 NPN transistor. I am using this to amplify a signal to send it longer distances and then drop it back down to 5V.
simulate this circuit – Schematic created using CircuitLab
While debugging the circuit, I noticed the resulting square wave has a longer fall time than expected. Below are screenshots of the resulting waveform: red is the original and blue is the result (measured at TX_DATA_5V_AMP).
Resulting waveforms
My questions are:
- Why is the fall time so much longer than the rise time on this waveform?
- How can I shorten the fall time on this circuit? Can I shorten it by changing the resistor values or the transistor?
Best Answer
It looks like whatever's providing TX_DATA_5V is an open-drain/open-collector output. You'll want to add a pullup resistor, like so:
simulate this circuit – Schematic created using CircuitLab
This resistor will pull the line high when the signal is high, and is necessary because open-drain/open-collector outputs can only drive the signal low. If you want a faster fall time, you can reduce the value of R4. Be careful you don't end up sinking too much current into your microcontroller's output though.