2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Is it connected exactly as in the datasheet? \$\endgroup\$ – Eugene Sh. Jul 15 '15 at 21:56
  • 1
    \$\begingroup\$ A common error is not noticing that the capacitor on Pin 6 should be "backwards" :) \$\endgroup\$ – bitsmack Jul 15 '15 at 23:24
  • \$\begingroup\$ I've already checked polarities for Pin 6 and I've checked numerous times making sure i'm following the data sheet. With the Ceramic Capacitors they don't have polarity. \$\endgroup\$ – ECEScout Jul 16 '15 at 16:47
  • \$\begingroup\$ Is that an LED installed between pin 15 and ground? \$\endgroup\$ – mjcopple Jul 16 '15 at 17:17
  • \$\begingroup\$ Yes I used it to test to make sure power is going to the chip \$\endgroup\$ – ECEScout Jul 16 '15 at 17:24
4
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ + Nothing else is connected to the V+ terminal except the .1uF capacitor. + I bought the Maxim chip from a local distributor. + I'm using a breadboard. + I had some 4.7uF tantalum capacitors lying around rated for 25V and they produce similar results to the 1uF electrolytic capacitors. Type of capacitor shouldn't make a difference \$\endgroup\$ – ECEScout Jul 16 '15 at 16:48
  • \$\begingroup\$ Unfortunately, I do not have an oscilloscope on hand unless the Fluke 789 Procesesmeter has one built in. That is what i'm using to measure DC/AC voltage and current. \$\endgroup\$ – ECEScout Jul 16 '15 at 17:00
  • \$\begingroup\$ Additionally, I checked most of my values while idle. However after adding the input and output serial that's when the weird voltage drop happened on pin 2. The baud rate used on both PLC and Arduino is 9600 \$\endgroup\$ – ECEScout Jul 16 '15 at 17:19
  • 1
    \$\begingroup\$ Now that I see the solderless breadboard photo, I'm confused -- is the MAX232 pin 15 ground return flowing through that red LED? Pin 15 needs to connect directly to ground return. \$\endgroup\$ – MarkU Jul 16 '15 at 17:58
  • \$\begingroup\$ I made a silly mistake you're correct. I swapped the LED for a wire directly to ground and now i'm getting a DC voltage on pin 2 around 9.2V \$\endgroup\$ – ECEScout Jul 16 '15 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.