Arduino Forum

Using Arduino => General Electronics => Topic started by: i3dm on May 22, 2019, 08:43 pm

Title: Increasing arduino UART voltage level
Post by: i3dm on May 22, 2019, 08:43 pm
Hello guys,
i was wondering if there is a way to increase arduino UART level voltage from 5V to 10V for a deice (turbine ECU) that uses 10V UART logic.

i know i can use a level shifter but trying to avoid it if possible.
i thought about a pull up resistor on the TX line - is that possible or will that kill the UART channel?
any other options? once again hopefully without external hardware.
thanks.
Title: Re: Increasing arduino UART voltage level
Post by: WattsThat on May 22, 2019, 11:04 pm
No, this cannot and will not happen without more hardware. Even a pull-up resistor (which will not work) is an external device.

What is the required speed?
Title: Re: Increasing arduino UART voltage level
Post by: Paul__B on May 23, 2019, 12:41 am
once again hopefully without external hardware.
Really?

One or two transistors.
Title: Re: Increasing arduino UART voltage level
Post by: wvmarle on May 23, 2019, 05:58 am
Shifting down (10V TX to 5V RX) can be done with a voltage divider.
Shifting up (5V TX to 10V RX) can be done with a transistor - do make sure you're not inverting the signal. This page (https://iot-playground.com/blog/2-uncategorised/17-esp8266-wifi-module-and-5v-arduino-connection) tells you how it's done for 3.3V to 5V, same for 5V to 10V except that you have to change the resistor values of the divider to be equal.
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 23, 2019, 06:05 am
Really?

One or two transistors.
no extra room on my board :(

What is the required speed?
19200
Title: Re: Increasing arduino UART voltage level
Post by: wvmarle on May 23, 2019, 06:31 am
no extra room on my board :(
Not even for a transistor in SOT23 package and 3x 0604 resistors? That must be one super tight packed PCB. Maybe you should place them on the other side then, or is that packed as well?

If really no space, too bad. End of story. This is impossible without extra hardware.
Title: Re: Increasing arduino UART voltage level
Post by: Grumpy_Mike on May 23, 2019, 06:55 am
Quote
deice (turbine ECU) that uses 10V UART logic.
Are you sure that the signal is not a form of RS232 signal? And is a simple mark ( idle state of the line ) is high?

I too would say
Quote
This is impossible without extra hardware.
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 23, 2019, 07:10 am
Are you sure that the signal is not a form of RS232 signal? And is a simple mark ( idle state of the line ) is high?

I too would say
yes im sure.

OK guys. i thought its worty a try.
thank you.
Title: Re: Increasing arduino UART voltage level
Post by: MorganS on May 23, 2019, 04:07 pm
Can you post a link to a manual or datasheet for the ECU? 10V Serial is very unusual.

RS232 standard is as common as dirt and may read as 10V on a multimeter, depending on the data being sent.
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 23, 2019, 04:11 pm
theres no datasheet. its a reverse engineering project.
the ECU HW is based on LIN bus but with regular UART protocol.
logic 1 is pulled up to power supply which is 10V in my case.
Title: Re: Increasing arduino UART voltage level
Post by: MorganS on May 23, 2019, 04:16 pm
Then you need a LIN transceiver.

Are you expecting to transmit and receive or just one of those? (Which one?)
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 23, 2019, 04:32 pm
both.
ive already decoded the protocol using a voltage devider on the Rx line.
thinking about a level shifter on both Tx and Rx lines for next stage to be able to transmit too.
Title: Re: Increasing arduino UART voltage level
Post by: MorganS on May 23, 2019, 04:35 pm
A MAX232 makes a great level shifter for both TX and RX. You could hack it to 0-10V by omitting one capacitor from the recommended circuit and connect V- to ground. But be aware that it reverses the polarity too: a HIGH input gives a low-voltage output.
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 23, 2019, 04:38 pm
interesting idea as i actually have a MAX232 at hand. but i need non reversed UART. is it possible to logically invert the software serial UART from the ardu?
Title: Re: Increasing arduino UART voltage level
Post by: wvmarle on May 23, 2019, 05:20 pm
Place an inverter such as the 74HC04 in between. Much easier.
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 23, 2019, 05:30 pm
i didnt explain but my board id already made without room for more components. the max232 can easily be mounted on the uart cable though.

MorganS - can you describe the correct way to get the Max232 to output 0-12v (or so) uart? will it also be able to read the LIN bus and transmit TTL (inverted) uart to Ardu?

the max232 i have are the ones from ebay:
https://rover.ebay.com/rover/0/0/0?mpre=https%3A%2F%2Fwww.ebay.com%2Fulk%2Fitm%2F132475473691

theyre actually called MAX3232.
Title: Re: Increasing arduino UART voltage level
Post by: wvmarle on May 23, 2019, 05:39 pm
The MAX3232 is the 3.3V version. The MAX232 is the 5V version, and can handle overall higher voltages. Otherwise they're compatible.

The 3232 can handle 10V signals as well, according to the data sheet.
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 23, 2019, 05:57 pm
yes. i agree.

so how do i modify it to read / send UART (0 to +12v) instead of RS232 (-12v to +12v)?
simply jumper V- (pin 6) to GND?
which cap needs to be removed?
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 23, 2019, 06:16 pm
A MAX232 makes a great level shifter for both TX and RX. You could hack it to 0-10V by omitting one capacitor from the recommended circuit and connect V- to ground. But be aware that it reverses the polarity too: a HIGH input gives a low-voltage output.
I have found this scheme of max3232.
do yo umean removing C4 and connecting V- (pin 6 in max3232) to GND?
Title: Re: Increasing arduino UART voltage level
Post by: MorganS on May 24, 2019, 12:41 am
Looks like both C2 and C4 would be unnecessary if you did not need the voltage inverter function.

SoftwareSerial can invert the data. Some of the more advanced Arduinos like the Teensy can do it in hardware but SoftwareSerial will be easier.
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 24, 2019, 10:13 am
Looks like both C2 and C4 would be unnecessary if you did not need the voltage inverter function.

SoftwareSerial can invert the data. Some of the more advanced Arduinos like the Teensy can do it in hardware but SoftwareSerial will be easier.
have you tested the removal of C2 and C4? would love to hear your results.
you also mentioned connecting V- to GND, please elaborate about that.
my main interest is to have a voltage level of 0-12V instead of +-12V from the RS232 side. seems to me like if i remove C2 and C4 i would never get a voltage output at V- at all?
thanks.
Title: Re: Increasing arduino UART voltage level
Post by: i3dm on May 24, 2019, 10:42 am
I ran a quick test.
removed C2 and C4, V+ rail does show 2*VCC which is to be expected.
than tried inputting TTL and monitoring RS232 output:

"V-" rail not connected: TTL "0" or "1" both show RS232 output 1.3V.
"V-" rail connected to GND: TTL "0" or "1" both show RS232 output 0.5V.

So far the MAX3232 hack is not successful :(