2023-01-29 Simplifying Data Transfer With The Labii Serial Port Widget
2023-01-29
Last updated
2023-01-29
Last updated
A serial port is a type of interface that allows communication between a computer and an external device. It transfers data one bit at a time over a single communication line (serial line) and is commonly used to connect a wide range of peripheral devices such as printers, scanners, and other industrial or scientific instruments. Serial ports use either the RS-232 or the RS-485 standard for communication, and are typically accessed through a DB-9 or DB-25 connector on the computer.
There are a variety of research equipment that use serial ports to transfer data. Some examples include:
Spectrometers: Used in chemical and physical research to measure the intensity of light across a range of wavelengths.
Data Loggers: Used in environmental and geological research to record data such as temperature, humidity, and pressure.
Microscopes: Used in biological and medical research to magnify and observe specimens.
Electroencephalography (EEG) Devices: Used in neuroscience research to measure electrical activity in the brain.
Chromatographs: Used in analytical chemistry to separate and analyze compounds in a mixture.
Mass Spectrometers: Used in molecular biology and biochemistry to identify and quantify the components of a sample.
X-ray Diffractometers: Used in materials science research to determine the crystal structure of a sample.
These devices typically use serial ports to transfer data from the equipment to a computer for analysis and storage. The serial port provides a reliable and low-cost means of data transfer that is well suited for many research applications.
To help researchers to easily communicate with their equipment and retrieve the data needed for their research, Labii provides a serial port widget for supporting data communication with research equipment. It provides a convenient and efficient means of data transfer that helps researchers focus on their work rather than worrying about the underlying technical details of data transfer.
In this article, I will utilize the BBC micro bit to evaluate the capabilities of reading and writing through the serial port.
The BBC micro bit is a pocket-sized, programmable computer that was developed by the BBC for use in computer education. It has an ARM Cortex-M0 processor, accelerometer, compass, Bluetooth, and several programmable I/O pins. It can be used to create simple interactive projects, from games and music to art and robotics.
1. Open https://makecode.microbit.org/#editor
2. Begin by displaying the heart icon, accompanied by the power up start melody, then proceed to configure the serial port. Within the serial port configuration, route all data to the USB and set the baud rate to 9600.
3. For button A being pressed, add a high pitch tone, serial write the temperature number, and then display the temperature number.
4. For button B being pressed, serial write string “LABII”, and then start melody “ba ding”.
5. For serial on data received “new line()”, show string for serial read until “new line()”, and then start melody “ba ding”.
6. Leave it empty for forever.
7. Paired to your micro bit and click Download to program it.
See all source code at https://github.com/Labii/labii-serialport
Connect your micro bit to your computer
Login to Labii at https://www.labii.app , add a new column with widget “Serial Port”.
baudRate: A positive, non-zero value indicating the baud rate at which serial communication should be established. Default to 9600.
dataBits: The number of data bits per frame.
stopBits: The number of stop bits at the end of a frame.
parity: The parity mode.
bufferSize: A positive, non-zero value indicating the size of the read and write buffers that should be created. flowControl: The flow control mode.
Open add record form
Click Connect button, in the pomp out, select BBC micro:bit and click Connect
Press button A in the micro bit
You shall hear tone High B and a temperature number displayed in your micro bit. At the same time, your serial port in Labii will display the temperature.
Click Disconnect button to close the connection.
Open a record contains the serial port column,
Click Edit to provide a value “LABII”, click Submit.
Once submitted, the Write button will show up.
Click Write button, in the pomp out, select BBC micro:bit and click Connect
Your micro bit should display “LABII” and play melody “ba ding”
Click Disconnect to close the connection.
To support the research community and simplify data transfer, Labii is dedicated to developing more serial port-related widgets that facilitate communication between Labii and research equipment. By providing a wide range of software solutions for different equipment types, Labii aims to make data transfer more efficient, reliable, and accessible for researchers. This will allow researchers to focus on their work and minimize the time spent on technical details. With a commitment to innovation and an understanding of the research community's needs, Labii is poised to play a vital role in advancing research through improved data communication.
The Labii Serial Port Widget is a software solution for supporting data communication between a computer and research equipment via the serial port. With its intuitive interface and customizable options, the Labii Serial Port Widget streamlines data communication in research and helps researchers focus on their work. To learn more, schedule a meeting with Labii representatives (https://call.skd.labii.com) or create an account (https://www.labii.com/signup/) to try it out yourself.
Click Edit button under Configuration to update the configuration of the serial port. You can update the following parameters:
Read data from micro bit via serial port
Write data to micro bit via serial port