USB to RS232 usina a DB9 UC232R Ftdi converterg

Hello everybody,

I'm very new here and I am french (if some french guys want to avoid useless transation). I'm not very good at communication protocols and thats' why i would really need your help.

I've got electronic sensors plugged all together on a board. This board send me data of the sensors via an usb protocol. My wish is to send them by buetooth using an HC05 ir HC06 chip and an arduino.

My trouble is that, I wonder, i cannot directly read an USB in with my arduino.. I thought about translating USB in RS232, and then send it in buetooth. I've got on my desk some US232R based converter (https://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_US232R-10_R-100-500.pdf) with a DB9 plug.

Here is what I've done. I plugged my Usb sensors board on the US232R. I connect the DB9 pin to the arduino (pin 2 to Tx, pin 3 to Rx and Ground to Ground). Trouble : there is no power supply here for my sensors board (that where supplied by usb, before). So i used the 5v output of my arduino directly on 5v in of the sensor board (on the usb pug).

When i do that, my US232R flash blue, but doesn't hold the light. I've got no data output (checked with a protocol analyser)...

Do you have some ideas? I'm thinking to a reset fault... How could i fix that?

Hoping you will forgive my poor engish,
Thanks

USB is much more flexible than a simple serial connection. You cannot send the complete USB traffic through a bluetooth connection.

I suggest you start by explaining in more detail what you want to achieve (sending some data wirelessly to some unknown device) rather than how you want to do it (use an Arduino and bluetooth). If the sensors are really USB connected post links to each of them. Explain in detail what you want to do with the data on the target device.

Hi,
Thanks for your time.
My sensors are the folowing:

Kubler 05.2400.1121.1024 (https://nl.farnell.com/kuebler/05-2400-1122-1024/encoder-incremental-1024ppr-2400/dp/4729535)

Baumer GBA2H.212A105 (https://www.baumer.com/nl/en/product-overview/rotary-encoders-angle-sensors/industrial-encoders-absolute/58-mm-integrated/gba2h/p/medias/__secure__/Baumer_GBA2H_DS_EN.pdf?mediaPK=8801084702750)

Seika SB1M (RS484 output)

TWK-ELEKTRONIK magnetostrictive transducer.

They are all plugged on an electronic card designed just for us (by XP power) that we can plug directly on an usb PC. I don't have the datasheet, i'm actively trying to find them.

My purpose is to connect and read data from this cardboard with my arduino, instead of my PC...

I found the datasheet of the converter!

@OP

Hope that you will get all the required hardware information from the following diagram as to the operation of: USB_Sensor < ------> asynchronous RS232 <-----------> asynchronous TTL <----------> UNO Software UART Port <-------> Software UART Port based HC5 BT. If you need any clarification/interpretation/meaning of the diagram, do not hesitate to ask. (You need to fed 5V to the USB2RS232 converter cable for the internal chip to work.)

Hey,

Thank you so much for your diagram!! I wil try to gather everything in order to try. Litte question : why do we need TTL? Arduino uno entrance is not a RS232?

Do you have the source of this image? Is there any code associated? i guess we nee to open software communication ports on the arduino?

Can i use that instead of just the MAX232 with all capa?

@Isnal

It is assumed that the USB output of your sensor is of type 'asynchronous USB'. This is to say that the actual output of your sensor is UART signals which has been converted to async USB so that the sensor now can be engaged in a USB Port of the PC. You can check it by engaging your sensor with the PC; go to device manager, open Port and see that a COM Port (this is a virtual COM Port) has been assigned to your sensor module. If this is the case, then the scheme of my diagram, for sure, will work.

1. The signals at the pins of the DB9 connector side (of the USBRS232 Converter Cable) are asynchronous RS232 Levels. This means that : LL = 3.3V to +10V and LH = -3.3V to -10V. The hardware/software UART Ports of Arduino UNO are 5V (TTL ) tolerant. So, we need RS232-to-TTL conversion and it is done with the help of MAX232 chip and the associated capacitors (the polarity are very critical).

As to the use of the following gadget:

I believe that it is made to replace 'MAX232 + capas'. You engage the DB9-female side with the DB9-male side of the USB2RS232 Conversion Cable; connect Vcc and GND with 5V and GND of UNO. TXD pin with SRX-pin of UNO; RXD-pin with STX-pin of UNO.

2. I have prepared the diagram manually with the help of Visio-2007. If you need it, I can attach the *.vsd file with this post. Sorry, Arduino Forum does not support the attachment of *.vsd file.

3. Yes! You need to create/open the software UART Ports by including the following codes in your sketch.

#include<softwareSerial.h>
SoftwareSerial mySUART1(6, 7); //SRX, STX = 6, 7
mySUART1.begin(9600);

4. All avialable commands of hardware UART Port are applicable for the SUART Port except that the void serialEvent() procedure is reserved for hardware UART Port.

My purpose is to connect and read data from this cardboard with my arduino, instead of my PC...

What do you want to achieve? Why an Arduino? Would a Raspberry Pi be an option?

You complete system is designed to be connected to a PC by USB. A Raspberry PI is a PC (in this regard) in an embedded form factor so it would be a much better replacement (if there are no other reasons to choose an Arduino you didn't tell us yet).

Once again thank you som much for your detailed and clear answer. I 'm gonna purchase this gadget and test it. I worry about the fact that it might be more than a simple UART converted in USB. Indeed, we have 4 sensors on the same board. So some kind of concatenation is executed. Anyway, it doesn't appear as a COM on windows but as a "BEI USB Sensor Interface (VCP)"
I assume it is some kind of registered driver...

Why not a raspebery?? Err good question... Just because i never used one, and i don't have any... Maybe it coud be more adapted... Do you think i coud easily create a bluetooth tranmission with it? For praactica reasons, i would like to avoid WIFI...

Something else. Is it possible to directly convert USB to TTL, like those thnigs seems to do?

or

https://www.amazon.fr/gp/product/B07HSWFKJY/ref=oh_aui_detailpage_o06_s00?ie=UTF8&psc=1

Yes, it is possible. The 2nd one surely but the 1st one have probably chip sealed in connector.
I would prefer 2nd one. It has also DTR signal which is useful for Arduino.

What is the DTR signal? What is it use for? Do i need to pug it somewhere?

DTR signal for resetting the board, if you want to upload sketches via USB port. Reset signal puts the MCU into the bootloader and prepare it for sketch uploading. Boards like e.g. Arduino Mini have no USB/serial transceiver. If you want to program it via serial, the DTR is connected to RESET pin.

Something else. Is it possible to directly convert USB to TTL, like those thnigs seems to do?

No. The listed products make a serial TTL interface available on an USB equipped PC if it has the necessary drivers. There are many more profiles available on USB, a serial emulation is just one of them, HID for example is used to connect keyboards and mice.

Anyway, it doesn't appear as a COM on windows but as a "BEI USB Sensor Interface (VCP)"

This should let you assume the device is not using the serial emulation on USB.

And don't mix USB host and USB slave. A PC is a USB host (in the majority of cases) while a mouse, a keyboard or a printer is a slave device. An Arduino is an USB slave device. USB host shields exist but there you have the problem to get a driver if the connected slave device doesn't use one of the most common slave profiles.

Hello,

I received al the tools few days ago, and i did some test. Same troubles here. Both USB/RS and RS/TTL converter seems not to work :no led or anything.
Just the USB/TTL flashes once when plugged. I guess it is, indeed, a more complex signal.. I don't know what to do...

I wil try with raspberry 3, i hope it is not too compex to use. If you have some fresh idea meanwhile that I could test, pease share them ^^

Give a list of the items along with pictures (if possible) that you want to connect together. We will try to give you setup on the functional tests of these items. Once these items are found sound, you may go ahead with data exchange session among them.

In the picture that you have attached with your post are:
UNO
TTL <-----> RS232 Converter
What is this small board connected with TTI<-----> RS232 Converter?
What is this big Board to the left of the Breadboard?

The big board is the card where my encoders are plugged. I have many sensors (here i ony plugged a Kubler 05.2400.1121.1024 encoder) using many protocols; everything concatened in "USB" and sent at the output of the board. We plug this board on a PC, we can read on LabView all the sensors data (that individualy appear like a COM port).

This card (3 on schamtic) is designed on demand, based on that:

I try a schematic:
So far, 3 is plugged in a PC by an USB cable. My purpose is to send 3. output on bluetooth. For that I want to read 3 output on Arduino Uno (6). :

1)1 Sensor 1 (only one plugged one tests) : Kubler 05.2400.1121.1024 encoder. TTL output
1)2 Sensor 2 SEIKA inclinometer SB1M. RS485 ouput.
1)3 Sensor 3 TWK MPE linear sensor. SSI output.
1)4 Sensor 4 Baumer GBA2H012A105 absolute Codeur. SSI output

Each 1.i sensor is plugged on an 2.i converter:
2.1 digikey DTE2024S5V1
2.2 Digikey DTE2012S24
2.3 Digikey .....

3 Every 2 are pugged on the "big board 3. BEI sensor Encoder to USB converter four channels. EC-USB-SS-SS-SS-SS-S

4 : 3 is plugged on 4, FTDI USB to RS232 (Amazon.com) . USB male has been remplaced by an USB female (black tape on open wires) and DB9 opened to wire +5V.

5 : 4 is plugged on 5. RS232 to ttl (https://www.amazon.fr/gp/product/B00WBD5RCU/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1)

  1. Arduino Uno. Plugged to PC by USB

Excellent photograph! Thanks for it. You could place it online along with your post. The procedures are:
1. Attache the file.
2. Save your post.
3. Go to your post. Place the cursor on the save file. Click right button and 'copy link address.'
4. Open your post in the More-->Modify mode.
5. Place the cursor at a place (on your post) where you want to place your image.
6. Place the cursor on the 'Insert a link' icon of toolbar and left click. A small window will pop-up. Place the cursor in the inputbox. Press Cntrl-V and then click OK.

7. Save the post and observe that the image has appeared online along with your post.
//---------------------------------------------------------------------------------------------------------

Now, please provide the following information:

1. Are you taking 5V supply for item-5 from item-6 via breadboard?
2. Are you driving item-5 by item-6 using Software UART Port?
3. Is item-4 a RS232<--->USB Converter? To which device (PC or what?) the USB-side of item-4 is connected?

4. Are you taking 5V supply for your encoder from item-6 (UNO) via breadboard?
5. Your encoder signal is connected with item-3. Is it correct? You have said that you want to connect the output of item-3 with item-6 (UNO). Do you know the nature of output signal of item-3? Is it analog or UART ?

At the moment, I see that there is no signal that is arriving to item-6. Is it correct? You can carry out the following diagnostic checks:
1. Check that item-6, 5, 4 are working by making a loop-back connection at the USB-side of item-4.

Thank you so much for your patience and your detailed advise! it is really pleasant.

  1. Yes, i power breadboard and so 5 and 4 via my arduino. Do you think it can't bear so many intensity?

  2. I tried to configure a software port, indeed. But in fact, i'd rather like that item 5 drive item 6 ^^'. I woud like to read what are on my software port, to print them on my serial of my PC. I did that to avoid conflict on the hardware serial port, which is used by arduino/PC usb cable (if i'm right). If you have a good script to be sure trouble are not from there, it coud help ^^

3.It is (i sent you the link). My question is "is it bi-directionnal" or am i using it in the wrong direction?... It is connected directly on the big black board (you can see the cabel going from under the "3" orange number and coming up from the bottom on the picture)

  1. Encoder is stil supplyed by arduino... yes probably a wrong idea i now consider :confused:

  2. Encoder signal 2.1 is connected on 3 via converter 2.1 . Output signal from 3 is an "USB" type. I don't know many more that's the trouble... I just know that we use it by plugging it on an usb port of a computer, and it emuate a "COM" port... So i guess UART, somehow.

You are right, no signal on 6 and it seems, not even on 4 as it dosen't hold the blue light on...

I tried your debugging. It 4 hod blue light !! But no led on on item 5 and no communication ed on UNO. I'l try tomorrow with an external power supply.