I've written some software to get an old device on the internet by emulating its keypad - and the software works well.
But I'm having some difficulty with getting the electronic interface right - and would appreciate any ideas.
The device is a shared bus 12v system - when a device is to talk it raises the TX line to 12V to transmit a Mark and floats to transmit a space or when not talking - there seems to be about 3KR and a small capacitance maybe 50nF on the line.
I want to connect the TX of the Arduino (running at really slow 1500 baud RS232)
So that
At normal rest sate of 5v - the output of the circuit is FLOATING
At MARK the Arduino TX Pin is 0V - the output of the circuit is 12V
I would like a low part count as Id like it easy for others to build - (one or two max transistors hopefully).
I cannot use two pins as I wont know when the Arduino has completed sending the data so I can disconnect from the bus.
Now What I have works - but I am not happy with the voltage level (due to the divider I have in there) or the
sharpness of the square wave probably the capacitance.
Can anyone suggest a better circuit? Keeping in mind that the signal needs to float not ground.
Here is what I have - it works - but the signal is not so good.
Basically what Id like a solid state version of:
This circuit attempt just about works -done using a single optocoupler.
This is what I would like - and below - what I'm getting:
CrossRoads:
Decrease the value of 2 resistors so you have more current flow to overcome the capacitance of the system.
Get rid of the opto and just drive the transistor directly. It's not doing anything for you with the common Gnd.
Thanks for that - I have just tried a high speed NPN - similiar results -.
I decreased the values to as small as I could but going smaller on the R1 (eg. 1K) makes it all run very hot - trying to keep under 20mA.
But my big problem I think is the Output is Grounding when device is supposed to be not transmitting - its not able to get to 12V and its also affecting other devices by not detaching properly.
The bridge formed by the line resistance and the R1 I think is what is limiting the voltage - I'd like a circuit I could omit R1 - maybe half a H bridge or something - but Im stuck trying to come up with a circuit that works off one pin.
I did add a 300R resistor on the output line (just where it says pOut) - and it helped a bit.
Thanks very much for that - its way simpler to what I came up with - but it appears to be the inverted logic of what I need - Is there a version that inverts still using only 2 transistors? I tried changing to the NPN to be in emitter follower but its not working out well with the PNP transistor for me.
Need:
At normal rest sate of 5v - the output of the circuit is FLOATING
At MARK the Arduino TX Pin is 0V - the output of the circuit is 12V
Here is what I came up with so far - but its way more components than I hoped -
It uses two transistors to disconnect from both the +ve and 0v at the same time. The output is really good in real life.
Would also prefer I didn't need R6 - a permanent extra loading resistor, though.
On the plus - I got to use LTSpice now which is neat - but LTSpice seems to be messing up on the transistor emulation - really obvious in the attached diagram that TX can never be 5v - it doesn't seem to like the way I did the Amplification from 5v to 12v.
In real life its similar shape wave but is correct 0. to 12volt.
Attaching the LTSpice also in case anyone interested (here: LTSpice Circuit - Pastebin.com) just need paste into a file called ArdTxPNPSoln.asc
Any ideas? On LTSpice? To make it simpler? To Make the PNP invert? Thanks all. Appreciate the replies.