8 channel relay board using rs-485 proto

Hello all !

I'm trying to interface with a 8 channel relay board using a SN75176BP with rs-485 protocol bought there : http://www.sigma-shop.com/product/47/rs485-8-channel-relay-controller-12vdc-rs485-bus-id-01-relays-1-8.html

8 data, no parity, 1 stop bit

The command to send to the controller board seems simple :

Relay 1 commands: OFF command : FF 01 00 (HEX) or 255 1 0 (DEC) ON command : FF 01 01 (HEX) or 255 1 1 (DEC)

But nothing works...Any helps would be appreciate (sample code + schema). I have an Arduino Mega.


Original topic there : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272038904

How did you hook it up ?

Arduino does not natively speak RS485 !!

scheme there : http://guilde.cwahi.net/

Are you sure that Arduino doesnot have rs-485 support ??? Modbus is Rs-485 ???

Are you sure that Arduino doesnot have rs-485 support ??? Modbus is Rs-485 ???

Rs-485 is a serial interface standard and as such an Arduino would have no problem with software (with the right library), however, electrically the Arduino uses TTL level serial which is different then the RS-485 5v differintial voltage. There are simple RS-485 driver&reciever convertor chips that can handle that, but a direct wiring of the Arduino serial pins to a RS-485 link is not likely to work.


Does anyone KNOW whether the relevant parts of the RS-232 and RS-485 standards overlap sufficiently that a TTL/RS-232 interface would be sufficient? There's a good one of those at Wulfden, thought the people there won't thank me if they get a flood of "can I use your device for..." enquiries. Why should they stick their necks out over you doing something "odd" that might fry either your RS-485 device or Arduino??

(See P4/P4B on.. http://www.wulfden.org/TheShoppe/pa/index.shtml ..if interested in the RS232/TTL device.)

The SN75176 will allow you to communicate with that board but there is zero information on what protocol they are using.

If that website could make their product more obscure I can't see how.

Do they even have a fking datasheet? I can't make any sense of the information they provide.

Doesn’r RS-485 use both positive and negative voltages for the data signals. Negative being “mark” or 1 and positive being “space” or 0. see wikipedia for details

As such then I doubt the Arduino provides a suitable direct output.

I’ve had similar interface problems with USB RS-232 plug-in adapters for my PC. Generally these work at the PC 5volt logic level but most of the industrial systems require a 12 volt RS-232 logic level. I eventually managed to find one which gave sufficient voltage levels to activate external systems (it obviously has a signal level converter built in).


I'm 100% agree with Mrmeval, i think i could communicate with SN75176. Soon, and i don't know how and why, while i was trying to switch relay n°9 (second board), the relay 6 was on...at this try, i was playing with cable on A and B...

I will contact Kmtronic.

Thanks all for your help.

Here is everthing you need to know about 485, 2 parts hardware def and protocol.

I suggest get a serial to 485 convertor, get it working with a PC 1st, then the Arduino should be straigthforward.

Right now everything seems to be an unknown. :wink:

Thanks all ;)

From now, i understand a little better what is rs485. But i have no issue with my board !!!

I have this configuration :

ARDUINO|SN75176|OUTPUT CONTROLER(with SN75176) Tx-------->Di----A------>A Rx-------->Ro-----B------>B Int-------->Re/De

The Arduino transmit data via an SN75176 to the onboard one wich is in receipt mode...The two SN75176 are in 'mirror' topology (A to A, and B to B). I couldn't find such topology on web !!!

First, I send a 0 bit to Re/De to set direction (Tx), and data after.

Could someone write me a simple and detailed code to help me validate my scheme ???


It works !!!

Thanks to all.


Schema : http://guilde.cwahi.net/

piece of code :

digitalWrite(any_dpin, HIGH);
Serial3.print("\xFF\x01\x01"); # Swith on relais 1
digitalWrite(any_dpin, LOW);

The SN75176 needs to be released a while after tx, the fix was to swith off Re/ & De after each command.