I have a tricky one I was hoping for some pointers on..
I have a 0-30V DC signal which contains a bi-directional serial stream.
15V for '0' (no comms either direction)
Then for one direction, the voltage is pulled towards 0V to signify '1' and the other direction is pulled towards 30V to signify the '1'
I have an Op-amp circuit so I can analog read these voltages successfully and split the directional data stream
Ideally the next step is performing native serial available & read to get the data but as it has come from an analog input I can't set serial.begin against pin numbers because it isn't traditional Tx/Rx
Edit: at this stage the intention is to read the stream only, no need to write back
I also expect it to be a pretty low baud rate
What might turn out to be the easiest might be to drive two optocoupler inputs with your signal, arranged such that each produces an output only for one direction(extra circuitry likely required). That would separate your two data streams, and additionally allow you to drop the signal level to either 3.3 or 5V levels for the receiving device.
As for what receiving device, it depends. If the baud rate is 9600 or lower, you might be able to use Serial RX for one stream, and software serial for the second, but I've no SS experience, so others would need to advise.
If it was up to me, I'd use an ATMEGA328PB, or other device with two hardware serial ports, like a Mega2560 or Every. Removes a whole layer of uncertainty about software Serial implementation gotchas.
Use a LM393 comparator and set the threshold to 15V.
Pullup the output to 5V. You will get a digital signal that you can read as LOW/HIGH
That will give you the direction.
You another LM393 window comparator to detect if it is above say 28V or below 2V
Classic RS232 signals range from -15 to 15 V in the extreme cases, but it is no problem to convert that signal to 0-5V TTL serial. For example, using this module.
Maybe all you need is a capacitor to remove the DC offset in the signal. If you will take a moment to describe that signal more completely, people can help.
AC units - indoor to outdoor comms
I'm not sure how it's generated, it's a proprietary board and I'm purely wanting to decode the data between the units
Yeah I completely understand that, please refer back to the original post or first few answers on how signal transformation can take place into 0-3.3/5V UART