Convert Tx voltage??

Hi everyone

I have posted some questions previously, and I am very appreciating the help.
I'm almost done with my problem. The last problem is as follows.

As previously explained, I need to replicate a serial data from a device using arduino mega's serial pins.

I got very close to replication, however the device's resting voltage is at 0v, while arduino''s Tx resting voltage is at 5v.
As shown below the results are similar to be compared.

It can't be simply 'flipped'.
How will I be able to make the Tx resting voltage be 0v whilst keeping the pattern same?

As previously explained, I need to replicate a serial data from a device using arduino mega's serial pins.

In this thread you didn't explain anything about that. Don't expect us to search for any thread you posted in.

I got very close to replication, however the device's resting voltage is at 0v, while arduino''s Tx resting voltage is at 5v.

The Arduino's signal is a correct UART signal. The idle state is HIGH, a short LOW is probably the start bit (hard to tell without any timing information). If you signal idles at 0 it's probably inverted but this also means that every HIGH bit is a 0 and every LOW bit is a 1.

The AVR hardware doesn't support inverting for it's UARTs so you might have to apply an external circuit (or try SoftwareSerial emulation if baudrates are very slow).

pylon:
In this thread you didn't explain anything about that. Don't expect us to search for any thread you posted in.

The Arduino's signal is a correct UART signal. The idle state is HIGH, a short LOW is probably the start bit (hard to tell without any timing information). If you signal idles at 0 it's probably inverted but this also means that every HIGH bit is a 0 and every LOW bit is a 1.

The AVR hardware doesn't support inverting for it's UARTs so you might have to apply an external circuit (or try SoftwareSerial emulation if baudrates are very slow).

Hi Pylon
Thank you so much for the reply. It is much appreciated.

I thought the previous thread was not a necessary information to this specific question. So I didn't describe it in detail.

I want to achieve signal from Tx to look like this: yellow line is the desired reading.


Baudrate is at 14000 so I'm not sure if it is slow enough to use the softwareSerial,
and if I have to apply an external circuit, could you please recommend me an existing board
or guide me on how about I would make one?

Thank you so much

pylon:
The idle state is HIGH, a short LOW is probably the start bit (hard to tell without any timing information).

This is timing of a TTL asynchronous frame which agrees with the above quote.
185-00.png

185-00.png

Baudrate is at 14000 so I'm not sure if it is slow enough to use the softwareSerial,

This is usually too fast for SoftwareSerial (I don't recommend it above 9600 baud) but you can try it, if the counterpart is not that picky about timing it might work.

if I have to apply an external circuit, could you please recommend me an existing board
or guide me on how about I would make one?

Simply add an inverter IC to either the input, the output or both (depending on the actual usage). If the Arduino generates the serial signal which then goes to another device (RX not used), just connect one inverter to the TX pin and use the output of the inverter. Example for such an IC is a 74V1T14 but there are dozens other type that would do the job too.

Hi Pylon

Thank you so much for the reply.
I have opened another thread with more details. Could you have a look at it too please?

With my arduino oscilloscope I found I that there are definitely some pattern.

"It can't be simply 'flipped'."

Back in the day of Radio Shack, you could make a simple signal inverter to go from rs232 to TTL just using a transistor and resistors like below.

ezservo.jpg

ezservo.jpg

How do you know that this is a UART signal? Isn't it possible that this is an I2C connection? Or something completely different? Do you have any documentation about the protocol used in this communication? Reverse-engineering a protocol from only the signal outline is a very hard task.

The pulse above is what I measured with my arduino oscilloscope.
Top, longer pulse is Tx from BackPCB, and short pulse is Tx from FrontPCB.
No conversion or 'flipping' was done. Also I don't know what protocol the PCBs are communicating with.

I used normal digital pin with idle voltage of 0v, then I could successfully bypass the signal from the coffee PCBs through arduino.
But if I use the serial pins, the signal is not passed through and displays 'comms error'.

I'm trying my best to get my coffee machine manufacturer to disclose datasheet or at least some information so that we can tackle this easier.

But in the post: Data transfer through ArduinoMega - Programming Questions - Arduino Forum
#14 reply, I described how I managed to have the coffee machine working whilst having the data go through the arduino.
It may not be the best method to use the digital pins but it could be a start to recording what the PCBs are sending?
Or do you suggest building a signal converter and use serial pins?

It may not be the best method to use the digital pins but it could be a start to recording what the PCBs are sending?
Or do you suggest building a signal converter and use serial pins?

No, because the signal doesn't look like a UART signal to me. Decoding (reverse-engineering) this signal will be tough without some hints from the manufacturer.