Problem with Nano + MAX232

I want read RS232 from weighing indicator using Nano.
Connection of MAX232:
pin 8 to TX weighing indicator
pin 9 to RX Nano
pin 15 to GND Nano
pin 16 to +5V Nano
not use capacitors & with this circuit it work fine when connected with Uno.
But in Nano i cant get the data both using Serial.read and SoftwareSerial (use other Nano pin for RX & TX).
When i measure voltage between pin 15 & pin 16 MAX232 the voltage is less than 1V if use GND near D2 & 0 V if use GND near VIN.
I try use digital pin of Nano for outputing 5V with digitalWrite pin HIGH & used for MAX232 VCC, the data come but unreadable characters.
Sould i make jumper wire for connecting both GND? or sould i take VCC from USB port?

Do you wonder that there is still no answer? No wonder, I don't understand the description either.
A drawing of the wiring would be much more informative. And the sketch that doesn't work.

I agree with RudolfAtRTC, if you want help you need to convey to the people trying to help you what you are trying to do. Start with a schematic, not a frizzy thing showing all power, ground, and interconnections. Explain what it is should do and what it is not. Posting the code makes it possible along with the schematic and your explanation to understand what you are trying to do and what the potential problems may be.


It a simple, just conect R2in to TX weighing indicator, R2out to RX Nano, +5V (VCC) to 5V Nano and GND to GND Nano.
The sketch just basic sketch & basic SoftwareSerial example

Are you saying that you have a project using a Max232 which works with an Arduino Uno but does not work with an Arduino Nano? If so, is the Nano a clone with, say, a CH340 USB chip or what is it?
Are you attempting to use software serial to read the Nano RX pin ? This would be wrong. Post the code you have written.

6v6gt:
Are you saying that you have a project using a Max232 which works with an Arduino Uno but does not work with an Arduino Nano? If so, is the Nano a clone with, say, a CH340 USB chip or what is it?
Are you attempting to use software serial to read the Nano RX pin ? This would be wrong. Post the code you have written.

yes, the Nano is using CH340
and my MAX 232 circuit work with Uno


void setup() {
  // put your setup code here, to run once:
  pinMode(4,OUTPUT);
  digitalWrite(4, HIGH); // i use it for MAX232 VCC
}

void loop() {
  // put your main code here, to run repeatedly:

}
/*
  Software serial multple serial test

 Receives from the hardware serial, sends to software serial.
 Receives from software serial, sends to hardware serial.

 The circuit:
 * RX is digital pin 10 (connect to TX of other device)
 * TX is digital pin 11 (connect to RX of other device)

 Note:
 Not all pins on the Mega and Mega 2560 support change interrupts,
 so only the following can be used for RX:
 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

 Not all pins on the Leonardo and Micro support change interrupts,
 so only the following can be used for RX:
 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

 created back in the mists of time
 modified 25 May 2012
 by Tom Igoe
 based on Mikal Hart's example

 This example code is in the public domain.

 */
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX

void setup() {
  pinMode(4,OUTPUT);
  digitalWrite(4, HIGH); // i use it for MAX232 VCC
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  mySerial.println("Hello, world?");
}

void loop() { // run over and over
  if (mySerial.available()) {
    //Serial.write(mySerial.read());
    Serial.println(mySerial.read());
  }
  if (Serial.available()) {
    mySerial.write(Serial.read());
  }
}

Just basic sketch with extra pin 4 for 5V output, because 5V & GND of Nano voltage less than 1V.
I am powering Nano using USB

Ok. So you have connected the Max232 R2out pin to the Nano pin D2 ?

You say you are not using capacitors ???

The caps around the Max232 are essential for it to work - they are part of the circuitry to generate the higher Rs232 voltages needed .

hammy:
You say you are not using capacitors ???

The caps around the Max232 are essential for it to work - they are part of the circuitry to generate the higher Rs232 voltages needed .

Because without capacitors still work fine in low baudrate.
Solved & still not using capacitors.
Problem come from my bad soldering.
Thanks for all

hendrocah:
Because without capacitors still work fine in low baudrate.

The following cucuit (Fig-1) explains why the capacitors are needed for the max232 logic translators.

max232Circuit.png
Figure-1:

The max232 receives TTL logic (0 to 5V) and transforms it into +10V to -10V logic and vice versa. Inside max232, there is a 5V to +10/-10V converter which requires polar capacitors for voltage stabilization.

max232Circuit.png

@GolamMostafa no problem without capacitors bro. my project work fine.

But i have new problem when i connected SoftwareSerial pin to my PC, COM port of my PC can not be open (like busy).
When i measure voltage of SoftwareSerial pin, both RX & TX to GND have 4,7V


From weighing indicator to SoftwareSerial pin Uno via MAX232 in breadboard, TX pin Uno to SoftwareSerial pin Nano.
Uno not connected to PC.
Serial monitor of Nano work fine, when i swap the arduino also fine.
But i get problem if i connected TX pin of arduino to PC using USB to RS232 cable or connected to DB9 printer.
I have tried connected TX arduino to TX in MAX232 & TX out MAX232 to PC also not work.
Still using SoftwareSerial example sketch

Usually, you connect a Tx pin on one device to an Rx pin on the other device. Only in some special cases do you connect a pin labeled Tx to another labeled Tx.

You appear to be having problems with a PC connection but what is your final goal? Is the project intended to integrate a weighing machine, a PC, a Max232, multiple displays and an Arduino Nano? Usually, in Arduino projects, the role of the PC is limited to loading the sketch onto the Arduino.

Anyway, you must draw a diagram showing all the components you are connecting together, their interconnections with all pin numbers. Post a picture of this diagram. Make it clear which connection fails.

My project is cut direct print from weighing indicator to printer.
I want make data logger. When operator press the print button in weighing indicator, Arduino will send the data to to PC server via LAN & store it in database.
If response from server is OK then Arduino forward the data from weighing indicator to 2 printers in different location (around 10 m distance) at a same time.
I use 2 Arduino only for make sure that Arduino connected to weighing send the data to TX Arduino or not, because i can not check directly from TX to printer or PC hyperterminal

So, you have an existing system consisting of a Weighing Indicator connected directly to two printers (the picture seems to show displays not printers)
You want to break the direct connection between these devices and insert an Arduino in the connection path.

The idea is:

  1. The Arduino reads data from a weighing indicator
  2. The Arduino Transmits that data to a server via a LAN connection
  3. The Arduino Retrieves status information from the LAN about the validity of the transaction
  4. If the transaction is OK, the Arduino sends data to the two printers.

Is that all correct ?

You didn't mention the LAN connection before.

What part are you having difficulty with ?
Please also make a diagram of your proposed installation as already requested twice.

6v6gt:
So, you have an existing system consisting of a Weighing Indicator connected directly to two printers (the picture seems to show displays not printers)
You want to break the direct connection between these devices and insert an Arduino in the connection path.

The idea is:

  1. The Arduino reads data from a weighing indicator
  2. The Arduino Transmits that data to a server via a LAN connection
  3. The Arduino Retrieves status information from the LAN about the validity of the transaction
  4. If the transaction is OK, the Arduino sends data to the two printers.

Is that all correct ?

You didn't mention the LAN connection before.

What part are you having difficulty with ?
Please also make a diagram of your proposed installation as already requested twice.

Absolutly correct.
The display for make sure my MAX232 circuit work fine, and i don't have problem with the LAN parts.
The problem are printer can not receive data from Arduino & i can not check the Arduino Tx data from PC using USB to RS232 cable.
I will try to make complete MAX232 circuit with capacitors, may be without capacitor MAX232 usable only for Rx & can not use for Tx.

So it appears your problem is only one of integrating an Arduino with an existing printer ?
If it is an RS232 connection, there may be different voltage levels involved. This could be +/- 15 volts.

Yup, the connection is RS232 & my MAX232 Tx out without capacitors only 3V.
Next monday i will make complete MAX232 circuit using capacitors.

Solved.
MAX232 must use capacitor in use Tx.
Thank you all for advicing me.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.