Electronic – arduino – Max232 giving incorrect values at pins

arduinomax232plcrs232ttl

Background:

I'm trying to connect a Compact Logix PLC -> MAX232CPE Maxium chip -> arduino.
Currently my PLC does communicate modbus RS232 with a request for data from the arduino. I can see this by tapping into the serial connection and reading the output from a custom C program. The arduino has a RS232 library that should handle the request and send the reply back to the PLC. The MAX232CPE chip is intended to turn the RS232 signal from the compact logix to that in the format of TTL serial signal for the arduino by changing the voltages. The MAX232 chip is given a 5V source from the Arduino Uno with 1uF aluminum Electrolytic capacitors (i've made sure the polarity is correct). Additionally I have another MAX232 chip set up with .1uF ceramic capacitors. Both capacitors are rated for 50V. My setup follows the picture below:

MAX232 pinout and diagram

Max232 datasheet link: http://datasheets.maximintegrated.com/en/ds/MAX220-MAX249.pdf

Problem:

The voltage levels for the 1uF capacitor set up goes as follows

 1uF capacitor voltages                       .1uF capacitor voltages
 Pin 1: 5.56V             Pin 16: 5.00V       Pin 1: 6.48V             Pin 16: 5.00V
 Pin 2: 6.16V             Pin 15: 0.00V       Pin 2: 7.67V             Pin 15: 0.00V
 Pin 3: 4.36V                                 Pin 3: 3.72V 
 Pin 4: 4.78V                                 Pin 4: 4.43V            
 Pin 5: 2.42V                                 Pin 5: -1.12V
 Pin 6: .937V                                 Pin 6: -3.65V            

 Expected Values for pins 2 and pins 6
 pin 2: 10.00V
 pin 6: -10.00V

While the PLC sends out RS232 modbus the signal seems to get lost in the MAX232 chip. I've tried going directly to the Arduino but once it heads through the Rx Terminal on the Arduino, the values coming in completely change. I've changed out all my capacitors, flipped polarities, and tried changing out the MAX232 chip with the other 2 I have so this is not an issue of a bad part. Also when I connect the PLC and Arduino to the .1uF set up Pin 2 sometimes changes to 4.06V and Pin 6 changes to 3.64V. This happens when sending and receiving data. The set up for the .1uF is shown belowenter image description here

The Red wire is a 5V source produced by the Arduino Uno. – on the board is my common ground.

Questions:

How do I go about getting the pins 2 and 6 close to correct voltage levels?

Is there an easier way than using the MAX232 chip that is cheap and effective for this project?

Even with the .1uF set up being the closest Signal is completely dropped at the MAX232 chip

EDIT/SOLUTION:
Instead of using an LED I connected pin 15 directly to ground but this created another problem of the chip overheating. This overheating causes pin 2 to decrease while pin 6 becomes positive in voltage. To alleviate this problem I added a 200k Resistor to pins 10 and 8 as pull down resistors. This caused the voltage on pin 2 and 6 to be the expected value and prevent the chip from frying.

Best Answer

The main problem is the V+ voltage doubler seems like it's not working efficiently on your setup. I've used MAX232 for many years (in fact I work at Maxim) and you should definitely see about 9.5V at V+ under idle, no-load conditions. The V- voltage inverter is powered from the V+ voltage doubler, so get V+ working first.

  • Is there anything else connected to V+ besides the capacitor? I'm looking at page 4 "Output Voltage vs Load Current". A load of around 25mA would be needed to pull the V+ down to 6 volts.

  • Did you make these measurements while data is being transmitted, or when idle?

  • Where did you buy your MAX232CPE+? From Maxim, or a second-source like TI, from a distributor, or from ebay/baidu?

  • You mentioned you swapped out the chip and the caps, is this circuit built on a printed-circuit board assembly or a solderless breadboard prototype? Can you provide photos?

  • Can you try using larger ceramic capacitor values? 4.7uF ceramic would be ideal, 1uF ceramic would be worth trying.

The flying cap pins (C1+, C1-, C2+, C2-) are switching nodes, so a DVM won't be able to show you what's really happening there. An oscilloscope would be more helpful to see the switching waveform at those points. But the DVM reading on V+ shows that the voltage doubler isn't working efficiently on both your setups.

You mention under some conditions you measured V+ = 4.06V and V- = -3.46V; I'd be concerned about that. I think that's out of spec operation, there may not be enough noise margin for reliable communication under those conditions.

Charge pumps tend to have relatively high source impedance, so it's hard for them to provide a lot of output current. Running at high data rates (high baud rates) requires switching the output more frequently, and that causes load current demand spikes. And running a long cable, there is parasitic capacitance distributed along the length between the wires; more load capacitance requires more current to charge it. So the V+ will be at its best when there is nothing connected to the transmit output, and no data being sent. I realize that's unrealistic for normal operation, but suggest it as a diagnostic. If you measure V+ up to around 9V with no cable connection and transmitters idle, then there may be a problem with the operating conditions. But if V+ never gets that high even idle/no load, then there is definitely a problem with the voltage doubler circuit.

By the way, if I were prototyping this, I'd definitely use ceramic capacitors -- MAX232 was first released way back when 1uF ceramic capacitors were rare and expensive, so the original data sheet assumed 4.7uF aluminum electrolytics.

Just looked up the old data sheet from 1989 (back when data books were printed on paper, heh) and the recommended capacitors for MAX232 were 4.7uF, but they note that reducing C1 and C2 to 1uF "will slightly increase the impedance of the charge pump", and decreasing C3 and C4 increases the ripple on V+ and V-. Hard to say from just a DVM measurement whether there's significant ripple or not. Again, an oscilloscope would be more useful.

Your data suggests the ceramic works better, even for the lower nominal capacitance value. And it also will work best if you use X7R or X5R type of ceramic capacitors. If all you can get is something looser like Y5U, that can still work if you go to a higher nominal value like 1uF or 10uF ceramic.

Actually on second thought, I'd just use the MAX233 (internal capacitor version) instead of the MAX232. But you may have your reasons, like wanting second-source parts availability.