I have a serial device which has two parts, an amplifier/"brain" and a keypad. The two pieces communicate with each other over serial (around 12V) via an RJ11 wire.
I'd like to create a circuit which will sit in between them, for the purpose of sending my own commands to the "brain" unit in addition to the keypad.
What I had in mind was a circuit board that has two RJ11 connectors. The brain plugs into one end, the keypad in the other end. Inside the circuit, the connections between the two devices will remain routed as if they were connected to each other - straight connectivity between all the wires inside the RJ11 wire.
To enable my Arduino chip to communicate with the brain, I was going to also route the wire going to the RX of the brain to the output of a MAX232 chip (input from the arduino, output to the brain RX line). So basically on one of the RJ11 connection points, there will be two paths.
My question is, do I need to put a diode or anything in between the MAX232 chip and the RX line of the brain? I'm basically looking to create a Y-splitter of a serial data line, and I'm just not sure if there's anything I need to add here.
Let me know if the concept makes sense, hope I've explained it efficiently.
It depends heavily on the real nature of the transmitters. If you are sure it's RS-232, you'll need at least diodes, and a pullup resistor to space (idle) level.
Or you cut the connection, and let the Arduino receive the keypad commands, and transmit both these commands and its own input. This will work with every kind of serial signal.
Amplifier/Brain with an RJ-11 wire (4-wire) running into an RJ-11 breakout board on a breadboard.
Keypad with an RJ-11 wire (4-wire) running into an RJ-11 breakout board on the same breadboard
4 wires connecting the same pins on each of the RJ-11 breakouts.
With this setup, the keypad is powered, and successfully transmits keypad commands to the amplifier, and the amplifier responds accordingly (all good there).
Here are my findings:
I've confirmed which wires are power and ground because when I remove either of them, the keypad goes dead.
This leaves the other two wires to be RX/TX
When I hook up an oscilloscope probe in parallel with the TX wire (this was confirmed via testing), when I push buttons on the keypad, I can see definitive square dips in voltage that last anywhere from 1ms - 2.5ms, a few short bursts. But I can't figure out the baud rate, I tried several, and I can't get the data decoded using the 'scope's serial decoder (Rigol DS1054z).
When I disconnect either the RX or TX wires, the keypad is still powered up, but ceases to function. Pushing buttons does not cause them to light up. My thinking is there must be some kind of feedback loop here, where pushing a button tells the amplifier, which then sends some kind of confirmation signal, that then tells the keypad to light up that button and make a beep tone.
When I disconnect the TX wire (coming from the keypad, transmitting to the amplifier), and I hook it up to the oscilloscope, it only measures 5V. When I hook it back up to the amplifier (and hook up the oscilloscope in parallel), it measures 12V.
So I'm thoroughly confused as to the communications protocol here and how to proceed with my original intention of learning the codes being sent, and replicating them myself on the same lines.
First of all we should find out whether it's a RS-232 connection. The 12V signal level fits into that picture, what's the opposite state voltage?
But RS-232 has a low (negative) voltage in idle state, not +5V nor +12V. This indicates a proprietary connection, not necessarily using the serial asynchronous standard format. Does your scope have an option to decode signals of reversed polarity?
If you can figure out the shortest pulse on the lines, this time would indicate the used baudrate. If it's 0.5ms, the baudrate were about 2kHz (2400 baud?). Can you post one or more captured transmissions? A complete transmission were nice, from which we could figure out both the bitrate and character frame.
Also check whether only one or both lines show pulses at the same time, during a transmission.
Crap, I believe the serial decoder on my Rigol only goes down to 2400
If I wanted to use the Arduino to try and decode the data:
a) do you still think it's RS232?
b) when I hooked up the TX line (in parallel with the amplifier) to the R1IN pin of a MAX232 breakout (from SparkFun), and the R1OUT line into the RX of a SoftwareSerial port on the Arduino, I got nothing. No data came through at all. Can I not have two things on the line at the same time? When I tried to have it by itself on the line (not hooked up to the amplifier, still no data, but the keypad also did nothing when I pressed the buttons, which makes me think they have some kind of sophisticated, proprietary feedback loop at play here...
I just looked at the schematics again, and here's what I found: the RJ-11 receive line goes into an optoisolator, and then straight into the R0 port on an IC (can't find information about it online; on the schematic it says 58705C8).
Could it be that these signals are TTL just at a higher voltage?
Is it possible that all I need to do is hook up an optoisolator and feed the output into my RX line of my Arduino???
osmosis311:
I just looked at the schematics again, and here's what I found: the RJ-11 receive line goes into an optoisolator, and then straight into the R0 port on an IC (can't find information about it online; on the schematic it says 58705C8).
Could it be that these signals are TTL just at a higher voltage?
Is it possible that all I need to do is hook up an optoisolator and feed the output into my RX line of my Arduino???
Let's go a little farther. What age is your device? 1970's, 1980', 1990's?
How many pins does the device receiving the signal have? And what pin does the signal go into?
Are there any other large ICs on the board? Their numbers?