If you are looking for a precision peristaltic pump that can handle multiple channels simultaneously (up to 24), you might want to check out the Longer BT100-1L. This pump can deliver flow rates ranging from 2 µL/min to 366.7 mL/min depending on the number of rollers in the pump head. It is also a relatively cheap peristaltic pump that has a wide range of applications.
The BT100-1L can be controlled remotely from your computer which can give you more flexibility and convenience, especially if you want to run complex pumping programs with loops, pauses, and varying flow rates.
In this blog post, we will show you how to communicate with the BT100-1L using the LONGER RS485 protocol, which is a serial communication protocol that allows you to send commands and receive responses from the pump. We will also provide some examples and code snippets on how to use Matlab to write and send control command strings to the pump.
TABLE OF CONTENTS
What do you need to communicate with the BT100-1L ?
To communicate with the BT100-1L using the LONGER RS485 protocol, you will need the following:
- A BT100-1L pump with a pump head and a tubing of your choice
- A RS485 control module that plugs into the DB15 port on the rear of the pump
- A serial cable that connects the RS485 control module to your computer or device
- A programming platform (Matlab in the case herein)
- A basic understanding of the data format, command format, and pdu format of the LONGER RS485 protocol (explained below 👇)
How to Set Up the Communication Port ?
Before you can start sending and receiving data from the pump, you need to set up the communication port correctly. Here are the steps to follow:
- Connect the DB15 connector to the DB15 port on the rear of the pump
- Turn on the pump and press the adjusting knob on the pump front to enter the remote control setting interface and enable remote control mode 🕹️
- Make sure the communication parameters on your programming platform match the ones of the BT100-1L, which are:
- 1 start bit
- 8 data bits
- 1 even parity
- 1 stop bit
- a baud rate of 1200 bits/s
How to Write Control Command Strings to the BT100-1L ?
Once you have set up the communication port, you can start writing and sending control command strings to the pump. A control command string is a sequence of hexadecimal characters that follows a specific format, which consists of:
- a start flag (E9H)
- a pump address (1 to 30, or 31 for broadcast)
- a length of the pdu (protocol data unit)
- a pdu, which contains the command characters and the parameters for the desired application
- a frame check sequence (fcs), which is obtained by calculating the XOR of the pump address, the length of the pdu, and the pdu itself (compute your fcs using our online frame check sequence XOR calculator)
The pdu and its length depend on the application requested from the pump. Some of the common applications are:
- Set running parameter (rotation speed)
- Read running parameter (rotation speed)
- Set running parameter (flow rate) with pump head and tube
- Read running parameter (flow rate) with pump head and tube
- Flow calibration
For each application, there is a corresponding set of command characters and parameters that you need to include in the pdu. These parameters are detailed below.
Set running parameter (rotation speed)
This application consists of writing to the pump. The overall length of the pdu is 6 bytes where the control command string consists of (in the exact same order):
XL | Set Speed | State 1 | State 2 |
2 bytes | 2 bytes | 1 byte | 1 byte |
- XL, control command string of 2 bytes, 58 4C
- Set speed (2 bytes) with a speed unit of 0.1 rpm and a maximum speed of 100 rpm (03 E8)
- State 1 (1 byte):
- bit 0 – start/stop bit where 1 is to start the pump and 0 is to stop it
- bit 1 – prime bit where 1 is to prime the pump at the max speed of 100 rpm and 0 is to run the pump at a normal speed
- State 2 (1 byte):
- bit 0 – sets the rotation direction where 1 is for clockwise and 0 is for counter-clockwise
The pump will respond with XL and will display on its front screen the rotation speed and the direction of rotation after receiving the control command string.
Read running parameter (rotation speed)
This application consists of reading from the pump. The overall length of the pdu is 2 bytes where the control command string is DL.
The pump’s response consists of:
DL | Show Speed | State 1 | State 2 |
2 bytes | 2 bytes | 1 byte | 1 byte |
- DL, control command string of 2 bytes, 44 4C
Set running parameter (flow rate) with pump head and tube
This application consists of writing to the pump. The overall length of the pdu is 10 bytes where the control command string consists of:
WL | 2 bytes |
Set flow rate | 4 bytes |
State 1 | 1 byte |
State 2 | 1 byte |
Pump head number | 1 byte |
Tube number | 1 byte |
- WL, control command string of 2 bytes, 57 4C
- Set flow rate (4 bytes) with a nL/min flow rate unit
- State 1 (1 byte) and State 2 (1 byte) as already explained
- Pump head number (1 byte), as presented in the tables below:
Pump head | Characters |
---|---|
DG (6 rollers) | 01 |
DG (10 rollers) | 02 |
YZ1515/YZ2515 | 03 |
313D | 04 |
DG15 | 05 |
- Tube number (1 byte), as presented in the table below:
Tubing ID (mm) 01: DG (6 rollers) 02: DG (10 rollers) 05: DG15 | Tube number |
---|---|
0.13 | 01 |
0.19 | 02 |
0.25 | 03 |
0.38 | 04 |
0.44 | 05 |
0.51 | 06 |
0.57 | 07 |
0.64 | 08 |
0.76 | 09 |
0.89 | 10 |
0.95 | 11 |
1.02 | 12 |
1.09 | 13 |
1.14 | 14 |
1.22 | 15 |
1.30 | 16 |
1.42 | 17 |
1.54 | 18 |
1.65 | 19 |
1.75 | 20 |
1.85 | 21 |
2.06 | 22 |
2.29 | 23 |
2.54 | 24 |
2.79 | 25 |
3.17 | 26 |
Tubing ID (mm) 3: YZ1515/YZ2515 4: 313D | Characters |
---|---|
0.8 | 01 |
1.6 | 02 |
2.4 | 03 |
3.1 | 04 |
4.8 | 05 |
6.4 | 06 |
7.9 | 07 |
9.6 | 08 |
The pump will respond with WL Show flow rate (4 bytes) and will display on its front screen the flow rate, the corresponding rotation speed and the direction of rotation after receiving the control command string.
Read running parameter (flow rate) with pump head and tube
This application consists of reading from the pump. The overall length of the pdu is 2 bytes where the control command string is RL.
The pump’s response consists of:
RL | 2 bytes |
Show flow rate | 4 bytes |
State 1 | 1 byte |
State 2 | 1 byte |
Pump head number | 1 byte |
Tube number | 1 byte |
- RL, control command string of 2 bytes, 52 4C
Flow calibration
This application consists of writing to the pump. The overall length of the pdu is 6 bytes where the control command string consists of:
CL | Test flow rate |
2 bytes | 4 bytes |
- CL, control command string of 2 bytes, 43 4C
- Test flow rate (4 bytes) with a nL/min flow rate unit
Examples of control command strings
- Set the BT100-1L to run clockwise at a rotating speed of 20 rpm
Control command string: E9 01 06 58 4C 00 C8 01 01 DB
- E9 as the flag
- 01 as the address 1 of the pump
- 06 as the length of the pdu (58 4C 00 C8 01 01)
- 58 4C as command characters XL
- 00 C8 refers to the rotation speed, 00 C8(hex) = 200(dec); the speed unit being 0.1 rpm ⇒ the rotation speed = 20 rpm (check our online base conversion tool)
- 01 to start the pump at normal speed
- 01 to run the pump clockwise
- DB as the XOR result of 01 (pump address), 06 (pdu length) and 58 4C 00 C8 01 01 (pdu)
- Set the BT100-1L to run counter-clockwise at a flow rate of 3 mL/min with a pump head DG (10 rollers) and a tubing ID of 0.25 mm
Control command string: E9 01 0A 57 4C 00 2D C6 C0 01 00 02 03 3B
- E9 as the flag
- 01 as the address 1 of the pump
- 0A as the length of the pdu (57 4C 00 2D C6 C0 01 00 02 03)
- 57 4C as command characters WL
- 00 2D C6 C0 refers to the flow rate, 00 2D C6 C0(hex) = 3000000(dec); the flow rate unit being nL/min ⇒ the flow rate = 3000000 nL/min = 3 mL/min
- 01 to start the pump at normal speed
- 00 to run the pump counter-clockwise
- 02 for the DG (10 rollers) pump head
- 03 for the tubing ID of 0.25 mm
- 3B as the XOR result of 01 (pump address), 0A (pdu length) and 57 4C 00 2D C6 C0 01 00 02 03 (pdu)
🚨Do not hesitate to use our user-friendly online command string generator to effortlessly generate precise control command strings for your BT100-1L.
How to communicate with the BT100-1L using Matlab ?
Matlab code snippets showing how to open the serial port, write and send control command strings to the pump and write a simple pumping program are presented below.
From the first example just presented above, the following Matlab code snippet makes the BT100-1L run clockwise at a rotational speed of 20 rpm.
%%% RUN PUMP 1, CLOCKWISE, AT A ROTATING SPEED OF 20 RPM
% Open the serial port with the data format corresponding to the BT100-1L
s = serialport('COM6', 1200, 'Parity', 'Even', 'DataBits', 8, 'StopBits', 1);
% Write the corresponding control command string
Str = 'E9 01 06 58 4C 00 C8 01 01 DB';
% Read data from Str, convert it according to the format specified '%2x' (hexadecimal conversion), transpose and return the results in an array
Data = sscanf(Str, '%2x').';
% Write the Data to the pump in the form of an unsigned integer 8bits
write(s, Data, uint8);
- In a second code snippet, let’s make the pump run clockwise at a rotating speed of 10 rpm for 10s, then make it run counter-clockwise at a rotating speed of 5 rpm for 30s before stopping it.
%%% RUN PUMP 1 CLOCKWISE AT A ROTATING SPEED OF 10 RPM FOR 10s, THEN COUNTER−CLOCKWISE AT A ROTATING SPEED OF 5 RPM FOR 30s BEFORE STOPPING IT
% Open the serial port with the data format corresponding to the BT100-1L
s = serialport('COM6', 1200, 'Parity', 'Even', 'DataBits', 8, 'StopBits', 1);
% Run pump 1 clockwise at a rotating speed of 10 rpm for 10s
Str = 'E9 01 06 58 4C 00 64 01 01 77'; % corresponding control command string
Data = sscanf(Str, '%2x').';
write(s, Data, uint8); % write the Data to the pump
Pumping_time = 10;
while Pumping_time > 0
pause(1)
Pumping_time = Pumping_time − 1;
disp(['Remaining_time:' num2str(Pumping_time)])
end % 10s delay with a visible timer
% Run pump 1 counter-clockwise at a rotating speed of 5 rpm for 30s
Str = 'E9 01 06 58 4C 00 32 01 00 20'; % corresponding control command string
Data = sscanf(Str, '%2x').';
write(s, Data, uint8); % write the Data to the pump
Pumping_time = 30;
while Pumping_time > 0
pause(1)
Pumping_time = Pumping_time − 1;
disp(['Remaining_time:' num2str(Pumping_time)])
end % 30s delay with a visible timer
% Stop the pump
Str = 'E9 01 06 58 4C 00 32 00 00 21'; % corresponding control command string; we took the previous command string and changed the State 1 byte from 01 (start the pump) to 00 (stop the pump) and of course computed the new fcs
Data = sscanf(Str, '%2x').';
write(s, Data, uint8); % write the Data to the pump
Conclusion
We hope this blog post has helped you understand how to control the Longer BT100-1L multichannel peristaltic pump remotely via Matlab using the LONGER RS485 protocol. You can also use other programming platforms such as Python to write and send control command strings to the pump and read and interpret the responses from the pump. For more details about this topic, check our blog post “How to Control the Longer BT100-1L Pump via Python ?”.
If you have any questions or feedback, please feel free to contact us at contact@darwin-microfluidics.com.
How to Remotely Control your Longer Peristaltic Pumps ?
[…] How to Control the Longer BT100-1L Pump via Matlab ? […]
How to control the Longer BT100-1L pump via Python ? - Darwin Microfluidics
[…] We hope this blog post has helped you understand how to control the Longer BT100-1L multichannel peristaltic pump remotely via Python using the LONGER RS485 protocol. You can also use other programming platforms such as Matlab to write and send control command strings to the pump and read and interpret the responses from the pump. For more details about this topic, check our blog post “How to Control the Longer BT100-1L Pump via Matlab ?”. […]