Controlling RS485 Relays by Raspberry Pi

 

 

 

 

 

 

1 - "+"

6 - GND

8 - Tx

 

 

 

1. Open Raspberry Pi terminal.

 

 

2. To set baudrate to 9600b/s, type  stty -F /dev/ttyAMA0 9600 and press Enter:

 

 

3. For example,to switch ON first relay -   echo -e '\xff\x01\x01' > /dev/ttyAMA0  and press Enter:

 

 

4…and to switch OFF -    echo -e '\xff\x01\x00' > /dev/ttyAMA0 and press Enter:

 

 

 

 

 

 

 

 

Read 20494 times