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 datasheet link: http://datasheets.maximintegrated.com/en/ds/MAX220-MAX249.pdf
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 below
The Red wire is a 5V source produced by the Arduino Uno. - on the board is my common ground.
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.