Wednesday, 17 August 2011

How To Detect External Voltage Signal from USB Port?

Did You Know That We Cannot Pass a Voltage signal Directly to a USB Port.
Now a thought will rise in your mind, Why we need to do that ?
This is because Now-a-days serial/parallel ports are absent from our PC/Laptop back, which served this purpose of converting a voltage signal to standard serial data. And that data will be detected by any application designed to read the serial-port pins.
(You can say that Adapters are available in market, I will answer this later).

I have done my Summer Internship in a Smart card manufacturing company.
There I was told to detect a discrete 5V signal from a USB port. And for that I have designed a device which I'll present here. There was a counting device in the production department of the company which sends a 5V signal each time a Smart card comes under it. They were using a RS232 serial port(DB-9) to send this signal to a computer that was running a counting application.

To meet the technological changes they want this to be done by USB port. Earlier the engineers there tried an RS232/USB adapter. But The Adapter DOESN'T WORKED!! (they haven't told me about this)

That's why they have given me this project.

After so much research I reach a solution to use FT232RL microchip. But I wasn't able to use that because of its size it was impossible to manually soldering its 28 pins. I have tried to make it through some professionals but they also failed to do that. The solution to that problem was Design a PCB(Printed Circuit Board) for that chip, but wasn't really simple.

So, I shifted to a safe side (in real the hard one) to play with USB/RS232 adapter. It seems simpler because as the standard design of this adapter contains a FT232RL chip in it. I was happy and asking me a question why I brought that chip earlier, if the adapter could serve the purpose?

This is the circuit I designed

The battery is DC power source. Remember that serial-port voltage limit is 3-12 V.

DB9 Serial Port Pins                          Pin No.

DCD                                                      1
RxD                                                        2
TxD                                                        3
DTR                                                       4
GND                                                      5
DSR                                                       6
RTS                                                       7
CTS                                                       8
RI                                                          9

But this circuit didn't serve the purpose. The application designed to read the status of pins wasn't showing any change in status when voltage is passed to RxD, DSR or CTS pin. These three are input pins and according to standard should go from Low->High when external voltage is passed to any if them.
But wasn't following the standard. WHY ?

This was Because a major class of these adapters have only RxD and TxD pins active. To serve only basic serial communication like printers etc. But That is not our case.

So, I have utilized these pins to work for me by adding this circuit :



No comments:

Post a Comment