TTL TO RS485 CONVERTER COM-TTL-RS485 1. GENERAL INFORMATION Dear customer, Thank you for purchasing our product. In the following, we will show you which things should be noted during the use. Should you encounter any unexpected problems, do not hesitate to contact us.
. USEAGE WITH ARDUINO 1. Connection Arduino Converter 5V VCC Pin 1 TXD Pin 0 RXD GND GND 2. Code example In the following, you will find a code example with which you can test your device. However, for this, you will need an end device for the RS485 connection to enable communication. In this example, we have used the USB-RS485 adapter (SBC-TTL-RS485) from Joy-it. Note that A+ is connected to A and B- is connected to B. Use the Arduino IDE for the code example.
. USAGE WITH RASPBERRY PI 1. Connection 2. Code example Raspberry Pi Converter 3V VCC GPIO 14 TXD GPIO 15 RXD GND GND To use the following code example, you need to enable the serial communication of the Raspberry Pi. To do this, run the following command to open the configuration. sudo raspi-config Select there under 3 Interface Options → P6 Serial Port.
Negate the question Would you like a login shell to be accessible via serial? . Agree with the following question. You have now successfully enabled the serial communication. Now restart your device once to apply the changes. Make sure that the serial library is installed on your Raspberry Pi. To do this, run the following command in your console. sudo apt-get install python-serial For the code example, however, you need an end device for the RS485 connection to enable a communication.
import serial import time # Opening the serial port port = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=3.0) print ("Starting test...") port.write(bytes("Please enter Test-String: \n",'ascii')) # Message is being sent while True: testString = port.readline() # Something is read testString = testString.decode('utf-8') # Convert to String if testString != "": print("The Test-String received is: " ,testString) # Output to console print("----------------------------------------------") time.sleep(2) port.
4. OTHER INFORMATION PR Our Information and Take-back Obligations according to the Electrical and Electronic Equipment Act (ElektroG) Symbol on Electrial and Electronic Products: This crossed-out bin means that electrical and electronic products do not belong into the household waste. You must hand over your old appliance to a registration place. Before you can hand over the old appliance, you must remove used batteries and replacement batteries which are not enclosed by the device.