Arduno RS485 4-20 mA module

Hi!
I've recently purchased this module, that uses RS485 to communicate. The module has a variable output of 4-20 mA.
Module PDF
To achieve this, I also purchased a couple of MAX485 IC's.
But I have run into some issues. I cannot figure out my mistake, that is causing the module to not properly set an output. The mini breadboard in this case is supposed to be the module.

This is how I've wired everything up. (The 555 Timer is the MAX485 chip).
The signal coming out seems fine on my osciliscope.


This is the code, sending a command to the module, for it to set the output at 12mA.


byte BUFER[12];
void setup() {
  Serial.begin(9600);
  // put your setup code here, to run once:

 BUFER[0] = 0x23; // "  #  "
BUFER[1] = 0x30; // 0 Address
BUFER[2] = 0x30; // 1  Address
BUFER[3] = 0x30; // 0 Command
BUFER[4] = 0x2B; // "  +  "
BUFER[5] = 0x31; // " 1 "
BUFER[6] = 0x32; // " 6 "
BUFER[7] = 0x2E; //  "  .  "
BUFER[8] = 0x30; // " 0 "
BUFER[9] = 0x30; // " 0 "
BUFER[10]= 0x30; // " 0 "
BUFER[11]= 0xD; // Termination character (cr)

}

void loop() {
Serial.write(BUFER,12);
delay(10);
}



  
  



I'm stuck on this for days ._., does anyone have any ideas?

Hi,
fritzing is not schematic.
It is difficult to help with this "drawing".
Draw a schematic, even if it's freehand.

1 Like

I apologise, image replaced.

RS485 usually has a 120 ohm resistor from A to B, not in series. Probably not your only problem, but certainly likely to cause issues.

2 Likes

As I understand it, the resistor is only needed for long range applications, but still it is a mistake. Ill change it, and change the schematic.

Thank you

1 Like

I see several problems. Start by downloading the MAX485 datasheet if you do not have it. When RE\ is low (that little circle indicates active low) you enable the receiver. RO is the receiver output. DI is the data input. As you have it drawn it will not send anything, it will receive what is on the bus and dump it into the bit bucket so you will never see what you got. When you get that then we can work on the code. Assuming you posted all of the code It is missing a lot. Are you planning on using software serial to receive data? If it is not a cash crunch switch to the Mega, it has 4 serial ports which can be used without blocking software.

To send with the MAX485 DI and !RE must be high. What is correct in the schematic. DI is the data in from the MAX485. What is correct on the schematic. From the datasheet.

R1 and R2 are wrong. Like camsysca say.

D1 is TX that is correct too.

The module don't send data.

@orlandoblyat if you haven't seen it, check out AN-1057 from TI.
AN-1057 Ten Ways to Bulletproof RS-485 Interfaces

1 Like

What format is the data in? I had assumed it was serial 8 bit ASCII or 8 bit Binary.

Hi!
RE/ and DE, is connected to 5V directly, thereby setting the IC to transmit data. I do plan to recieve data from the module, as it has other functions, but for now I just want to figure out why the module isn't outputing the desired current. I do not have a Mega on hand.
I assume the code is adequate, as I need to send just the one command.

I will check it out for future projects, but for now I need to get it working with the MAX 485.
Thank you though!

I don't know much to be honest, but I assume it's 8-bit ASCII, since sending hexadecimal bytes prints as their corresponding ASCII character on the serial monitor.

Hi everyone, thank you for all the help.
Someone once told me that often small mistakes have the biggest impact.
My issue was that I reversed the polarity of the RS485 connection. Connecting DATA+ to B and DATA- to A.
Here is the end schematic in case someone will need it in the future.

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