Description: To ensure that the USB and serial segments are electrically isolated, an optocoupler (U1) is employed. The LED section of U1 is directly driven by the Data Terminal Ready (DTR) signal, necessitating the selection of a highly sensitive optocoupler to prevent excessive current flow from DTR, which is typically limited to around 3 mA to avoid stressing the serial port. A diode (D1) is included to protect the LED when DTR is negative. The NPN transistor section of U1 controls a PNP transistor that operates an electromechanical relay. This relay features three contacts: two normally open and one normally closed. Due to the unconventional configuration of the relay, two relays operating in parallel are recommended. When the relay is inactive, USB-detect and USB-GND are disconnected, while Serial-detect and Serial-GND are connected to the ground of the computer's serial port, placing the dual cable in serial mode. When the relay is activated, USB-detect connects to +5V and USB-GND connects to the ground of the computer's USB port, switching the cable to USB mode.
This circuit operates similarly to the previous design but utilizes a different approach. The relay is powered by a PNP transistor (Q1, such as the BC556), which is activated when DTR is negative or not connected. Conversely, if DTR is positive or the USB plug is not connected (leading to a lack of +5V power), Q1 and the relay remain off. With resistor R1 set to 10K and R2 to 22K, the DTR current remains low. Diode D1 can be a 1N4148. Measurements taken with a multimeter revealed that the resistance between the USB and serial port grounds in the computer is extremely low (under 0.1 ohm), suggesting they are interconnected within the computer, likely sharing the same power supply. The resistance between USB-GND and Serial-GND on the camera is also minimal. Considering all these grounds as a single electrical node, as inferred from the tests, allows for the simplification of the relay-based circuit to the configuration illustrated in figure 3.
The schematic involves a careful arrangement of components to ensure proper functionality and isolation between the USB and serial interfaces. The optocoupler serves as a critical element, providing electrical isolation while allowing signal transfer. The choice of a sensitive optocoupler is paramount, as it ensures that the small DTR current is sufficient to activate the optocoupler without exceeding the current limits of the serial port. The inclusion of the protection diode (D1) is essential to safeguard the optocoupler's LED from reverse voltage that could occur when DTR is not active.
The relay configuration, while unconventional, allows for flexibility in switching between USB and serial modes. The use of two parallel relays compensates for the unusual contact arrangement of the primary relay, ensuring reliable operation. The activation of the relay through the PNP transistor (Q1) adds a layer of control, permitting the circuit to respond dynamically to the DTR signal and the presence of a USB connection.
Resistors R1 and R2 are chosen to limit the current through the DTR line, ensuring that the circuit operates within safe parameters. The low resistance measurement between USB-GND and Serial-GND indicates a robust grounding scheme within the system, which is crucial for minimizing noise and ensuring signal integrity. This design demonstrates a thoughtful approach to interfacing USB and serial communications, emphasizing electrical isolation, current management, and the importance of reliable connections within the circuit.To assure that USB and serial segments are electrically isolated, we used an optocoupler (U1). The LED section of U1 is driven directly by DTR, so we should select a very sensitive optocoupler to prevent too much current flow from DTR (which is usually very limited, implementation-dependent; around 3 mA max. if we don't want to push the serial port to its limits). D1 protects the LED when DTR is negative. The NPN transistor section of U1 drives a PNP transistor which in turn operates a electromechanical relay.
This relay has three associated contacts: two normally open and one normally closed. This is a weird configuration for a commercial relay, so you will have to use two relays working in parallel instead. When the relay is idle, USB-detect and USB-GND are disconnected, while Serial-detect and Serial-GND are connected to the computer serial port ground, so the dual cable is in serial mode.
When the relay is activated, USB-detect is connected to +5V and USB-GND is connected to the computer USB port ground, so the cable is in USB mode. This circuit behaves the same as the previous one, but it is completely different. Now the relay is powered by a PNP transistor (Q1, for example, a BC556) which is on when DTR is negative or not connected. If DTR is positive or the USB plug is not connected (and hence there is no +5V power in the circuit), Q1 and the relay are off.
With R1 set to 10K and R2 to 22K, DTR current is small. D1 can be a 1N4148. Using a multimeter, we measured the resistance between the USB and serial port grounds in my computer, and it turns out to be extremely low (under 0.1 ohm), so we assumed that they are connected together inside the computer, as one can expect because they are likely to share the computer power supply. The resistance between USB-GND and Serial-GND on the camera is also very low. If we consider all these grounds as the same electrical node (as it is deduced from these tests), the relay-based circuit can be simplified to the one depicted in figure 3.
This circuit switches a printer's USB connection between a PC and a laptop. The goal was to create a method for allowing the laptop to use the printer occasionally while maintaining the printer's connection to the PC at all other...
Lithium Polymer Batteries are a very common source of power today. Many electronics gadgets have one inside, and they have some reasonable features. I've bought great batteries, with different sizes and capacities for my electronics projects. So long I'm using...
This device allows two computers to share a single USB printer or other USB devices, such as an external flash drive, memory card reader, or scanner. A rotary switch is used to select the PC that will use the USB...
The device is capable of detecting input from a typewriter, enabling it to send and receive text to and from a computer via USB. It was specifically designed as a platform for playing interactive fiction games, particularly for custom software...
Life in the 21st century would be nearly unbearable without certain computer peripherals that PC users now consider essential. For instance, the USB-powered teacup warmer is an invaluable productivity tool for users, but it could potentially cause issues if the...
The UDA1343TT is a single-chip stereo analog-to-digital converter (ADC) and digital-to-analog converter (DAC) that features basic signal processing capabilities using bitstream conversion techniques. Its low power consumption, compact package size, and low voltage requirements make it highly suitable for low-voltage,...
It connects to the USB port and is ideal for checking motherboard switches and jumper settings. Many users may recall a commercial product from a few years ago, the "Itty Bitty Book Light," which was designed to clip onto a...
The simple relay adder was constructed using free NOS relays around 2005, with the intention of eventually creating a more complex version capable of running programs without occupying a large space like early computers. An impressive 415-relay computer was built...
After completing several V-USB tutorials, the next project undertaken was to create a compact USB HID keyboard device that types a password stored in EEPROM each time it is connected. The password can be regenerated by pressing the CAPS LOCK...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more