Overview Controller uni-PRO LF (Luckfox)


This page describes where to find the connections of the uni-PRO LF (Luckfox) controller and how to connect the serial interface RS485 and the RS232. The display and the relays are operated by the function block uni-PRO LF (Luckfox).

Important: Work on mains voltage only by qualified personnel. Observe the safety instructions and the legal notices. The labels on the device and the data sheet of the delivered version take precedence over this description.

Table of contents


Where the connections are

On the side with the two network sockets and the USB-A socket, the green 11-pole screw terminal for serial communication and the CAN bus is located below them. The terminals are numbered 1 to 11, terminal 1 is on the left.

Network Network USB A 123 456 789 1011 RS232TX RS232RX SGND CANL CANH SGND RS422RB RS422RA RS422 TBRS485 B RS422 TARS485 A PE View of the side with the network sockets; the 11-pole terminal below Blue: RS232 · Gray-blue: CAN · Violet: RS422/RS485 · Black: signal ground · Brown: protective earth

Terminal for CAN, RS232 and RS485/RS422

1 – RS232 TX Transmit line of the RS232 (output of the controller).
2 – RS232 RX Receive line of the RS232 (input of the controller).
3 – SGND Signal ground (SGND), next to the RS232 terminals. Reference ground for RS232 and CAN.
4 – CAN L CAN bus, line Low.
5 – CAN H CAN bus, line High.
6 – SGND Signal ground (SGND), next to the RS485/RS422 terminals. Reference ground for RS485/RS422 and CAN.
7 – RS422 RB
8 – RS422 RA
Receive pair of the RS422 (four-wire operation). With RS485 in two-wire operation, connect to terminals 9 and 10: 7 to 9 and 8 to 10, see Connecting RS485.
9 – RS485 B (RS422 TB)
10 – RS485 A (RS422 TA)
Data pair of the RS485 in two-wire operation. With RS422 it is the transmit pair. RS485 and RS422 share these terminals, the function results from the wiring. For RS485 the receive pair (terminals 7 and 8) is bridged in addition.
11 – PE Protective earth or connection for the cable shield.

Connecting RS485

The RS485 works in two-wire operation: all participants are connected in parallel to the same line, only one transmits at a time. Example with a Modbus participant:

uni-PRO LF Participant Terminal 10 – A Terminal 9 – B Terminal 6 – SGND A (+) B (−) GND 120 Ω 120 Ω A B Ground (recommended) Bridges: 7 – 9 and 8 – 10 Termination resistor only at the two ends of the line
  1. Disconnect the controller from power.
  2. Connect line A of the bus to terminal 10 (RS485 A) and line B to terminal 9 (RS485 B). Use twisted, shielded cable.
  3. With two short wire bridges connect terminal 7 to terminal 9 and terminal 8 to terminal 10. The receiver of the controller is on terminals 7 and 8, the transmitter on 9 and 10. Without the bridges the controller transmits but hears nothing on the bus. With the bridges it also reads its own telegrams; the runtime discards them by itself.
  4. Connect the signal ground of the participant to terminal 6 (SGND). This is important for participants with a different ground potential.
  5. Connect the cable shield to terminal 11 (PE) at this end only, not at the other end.
  6. If the controller is at the start or at the end of the line, switch on the 120 Ω termination resistor. The device has switches for the respective interface; according to the manufacturer, the lever down switches the resistor on. If the controller is in the middle of the line, it stays off.
  7. In the program, select Onboard as connection for Modbus master or Modbus slave, see Assignment in the software.

Note: The designations A and B are not used consistently by the manufacturers. If no connection is established although baud rate, parity and address are correct, swap A and B.

RS422: For four-wire operation, terminals 9 and 10 are wired as transmit pair and terminals 7 and 8 as receive pair, without the bridges. The description on this page applies to RS485.


Connecting RS232

The RS232 is a point-to-point connection. The lines are crossed: the output of the controller goes to the input of the remote station and vice versa.

Terminal 1 (TX) to RX of the remote station
Terminal 2 (RX) to TX of the remote station
Terminal 3 (SGND) to GND of the remote station

The cable length is limited to a few meters. For an M-BUS, a level converter is required between the RS232 and the M-BUS line.


Assignment in the software

When the controller starts, the runtime sets up two accesses that the other controllers also have. Blocks with the selection Onboard therefore find the interface:

RS485 Modbus master and Modbus slave with connection Onboard. In the Lua script /dev/ttyONBOARD-485.
RS232 M-BUS with connection Onboard. In the Lua script /dev/ttyONBOARD-232, for example sys_comm_open("/dev/ttyONBOARD-232","115200","8","1","N").

Other connections

Relays and supply A second 11-pole terminal contains the two relays (one normally open and one normally closed contact each) and the voltage input 7 to 24 V DC. The assignment is printed on the device. The relays are switched by the function block uni-PRO LF (Luckfox). Switching capacity according to the manufacturer up to 10 A at 250 V AC or 30 V DC.
Network Two network sockets with 10/100 Mbit/s. The setting Network settings in the Studio applies to the LAN port, the second port stays on DHCP, see uni-PRO LF (Luckfox).
USB One USB-A socket for USB devices. A USB-C connection serves for the 5 V power supply and for installing the firmware.
USER and RESET The USER button starts the mode for installing new firmware when switched on. RESET restarts the device; it can only be reached with a thin tool.