Stepping serial up to 9v.

Hi guys, wasn't entirely certain the most appropriate place for this so I'll leave it here.

A serial device I wish to talk to appears from measurement with an oscilloscope (and by looking at the schematics for it), to transmit serial data with a swing of 0-9v. Is it possible to use a transistor to step up the serial transmission from an arduino to do this? And how would I build the circuit?

Unfortunately, however, my boss says I'm unable to share the schematics of the device I'm attempting to communicate with.

Use something like a MAX232 - it's what they're designed for.

Allow me to explain further;

I'm attempting to replicate some hardware that was originally designed in '92, which communicates with a PC via RS232. Sort of.

The data coming from the PC is true RS232; and I'm able to communicate correctly with the computer when using a MAX3232 for two way communication with the arduino. However, several of these devices I'm attempting to replicate are run down the same network, with the PC polling each one for data. However, it appears that communication back from the devices is not true rs232. It idles at 0v, and swings up to 9v. (For now, I will assume that 9v represents logic 1, but I'm not yet certain).

Due to the difference in idling voltage levels, attempting to interface my replicated device (which idles at negative voltages), interferes with the other devices and prevents them communicating with the PC, hence I need my device to act similarly to that which I'm attempting to replicate.

RS232 signals are supposed to be +/- 12 V, but in reality lower voltages are usually tolerated. However, this Pololu interface will give you the full required swing Pololu 23201a Serial Adapter Partial Kit (or use the fully assembled version).

Cosford:
A serial device I wish to talk to appears from measurement with an oscilloscope (and by looking at the schematics for it), to transmit serial data with a swing of 0-9v. Is it possible to use a transistor to step up the serial transmission from an arduino to do this? And how would I build the circuit?

Have you tried it at 5V? It will probably work.

If it doesn't...it gets complicated.

I'd believe that 9V is a logical 0.
This match that the line 'rests' at a logical 1, which should be negative, but in your case: 0V

a 4049 (cmos inverter) fed 9v can do for two-way comm. Your receiving end adds to resistors to feed 1/2 the voltage to arduino receive-line

Chips like MAX232 and MAX3232 use capacitors to make charge pumps to take Vcc = 5v to make 0-5V input into +/- 10V output signal.
Perhaps you could use one and leave off the caps for the negative charge pump - or run the output thru a shotkky diode so only the positive output made it thru.

Cosford:
I'm attempting to replicate some hardware that was originally designed in '92, which communicates with a PC via RS232. Sort of.

Hang on!

Does it or does it not communicate with a PC via RS-232?

If it does, then you simply want to generate RS-232, which the MAX232 will do. Doesn't matter about voltage levels and whether it runs negative; if it communicates with a real RS-232 port on a computer, then you use an RS-232 circuit.

fungus:
Have you tried it at 5V? It will probably work.
If it doesn't...it gets complicated.

What is complicated about a simple transistor with a collector resistor up to 9V.

It's probably something like a max232 with "diode or-ing"; that's sort of the usual cheater's solution for "multidrop rs232"
If you have the schematics, YOU should be able to duplicate the circuit...

Grumpy_Mike:

fungus:
Have you tried it at 5V? It will probably work.
If it doesn't...it gets complicated.

What is complicated about a simple transistor with a collector resistor up to 9V.

"Complicated" is relative...

a) You need 9V from somewhere (where?)
b) A transistor inverts the signal, you need two of them plus a few resistors

Compared to just connecting the wire to see if it works? That's complicated.

Grumpy_Mike:
What is complicated about a simple transistor with a collector resistor up to 9V.

Getting 9V?

Perhaps, perhaps not. But if you already have 5V, then one of those $2 TTL to RS-232 boards, ready-made with the connector could be simpler in practice.

Paul__B:
if you already have 5V, then one of those $2 TTL to RS-232 boards, ready-made with the connector could be simpler in practice.

It might be...but he said his interface is 0-9V.

If that's true then applying +12V/-12V could kill it.

fungus:
A transistor inverts the signal, you need two of them plus a few resistors

No. We have already established that the signal is upside down. Read the posts he says the signal idles at zero volts so a single transistor is exactly what you need.

You need 9V from somewhere (where?)

And you say it could be 5V or it could be Vin on the Arduino, or it could be from the module itself.

Compared to just connecting the wire to see if it works?

Yes but because the signal is inverted it will not work.

Grumpy_Mike:

fungus:
A transistor inverts the signal, you need two of them plus a few resistors

No. We have already established that the signal is upside down. Read the posts he says the signal idles at zero volts so a single transistor is exactly what you need.

Ok, ya got me. I missed that.

That's a pretty weird serial interface. It's almost as if they don't want people using it without the official (ie. expensive) cable. I wonder if it has any other tricks up its sleeve...

Apologies, I meant that I assume 0v was logic 1, inverted as per rs232 standard.

To alleviate any outstanding confusion, the transmit line from the pc to device is standard rs232. My replicated devices can talk to the PC via a max 3232. On the other hand, I noted that when plugging even a single one of my devices into the network with the existing devices, the pc could no longer communicate with any of the devices.

Upon investigation, I found that the pc receive line would idle at 0v as opposed to the negative standard for rs 232. (Can't recall it right now).
Thus, I believe the network failing with my device plugged in with the original devices is due to my devices being true rs 232 (via the max3232), pulling the voltage from the other devices down and preventing any devices communicating on the network correctly.

The network side of the devices I'm emulating is dealt with via a pair of optocouplers. I can't recall the exact layout off the top of my head, but i will draw up a sketch of that aspect of the schematic tomorrow and post it here. I've attempted to replicate myself, but without success. I don't really understand electronically how it's supposed to work either.

For reference, there is no special cable. We simply use cat5, minus 4 of the wires. (So, only wires are Tx, COM, Rx and CTS).
Thanks for your replies thus far.

Regards

I think that you really need to explain clearly exactly what sort of "network" this is, what is connected to what, how it is connected and by what sort of device. A well-annotated diagram would be very useful.

As best as it can be understood at this point, there is some complication with a "wired or" arrangement, but we really need to know how this is wired to figure out the problem.

fungus:
It might be...but he said his interface is 0-9V.

If that's true then applying +12V/-12V could kill it.

He did say it was connected to a PC RS-232 port. This is an absolute guarantee that it must be +12V/-12V tolerant.

I've attached below a drawing of what I've been attempting to describe.
Apologies in advance, my drawing skills aren't fantastic.

I should also add to the below, that the notations of 'to microcontroller' are through a small amount of external circuitry. The collector of the upper 4N35 actually passes to the input of a Non-inverting buffer (HCF4050B), with the output of that buffer being passed to the microcontroller.
The Cathode of the lower 4N35 is connected to an output of the same non-inverting buffer, in series with a 10k resistor, where the input is connected to the microcontroller.

The transmit line (Tx) from the PC, idles at ~ -9.5v, jumping to +9.5v. On the other hand, the Rx line idles at 0v, jumping to 9v. The CTS line swings between 11 and 9V.

Regards

20140702_104826[1].jpg

Update: I've managed to get this working by using the transmit part of the circuit from the schematic. All appears to work, and is compatible with the existing equipment. Thanks for all your responses regarding this.

I have one last question though, where does the 9v swing come from? Would this be the voltage level of the CTS line minus the drop across the diode?

Regards

The way u split the datacable is not correct, unless 'devices' have tri-state outputs and can be selected one at a time.