Introduction
The repetitive nature of spider silk protein sequences increases host bacteria strain due to inclusion body formation, plasmid instability, and translational inefficiencies. To improve the early stage growth quality of the bacteria host, the collection of experimental data during culturing is crucial for identifying optimal parameters. Early-stage cell cultures often use shake flasks, but compared to larger bioreactors with advanced sensors, shake flasks require manual data collection, which is labor-intensive and prone to contamination. These challenges suggest the need for a sensor system designed specifically for early stage shake flask cell cultures. Such a system would assist operators by automating the collection of data and integrating it for analysis on a computer, enhancing both accuracy and efficiency while minimizing contamination risks.
We utilized the microcontroller development board APP-All MCU 2023 sponsored by MicroChip Technology Corp. to create a flexible and multi-functional development platform; this board was specifically designed for embedded applications, such as smart home systems, industrial automation, and other systems that require direct interaction with hardware. The core feature of this platform is its support for multiple types of microcontrollers (MCUs) and its rich shared peripherals, making it adaptable for various development needs.
Advantages over Arduino Uno
We chose APP-All MCU 2023 over Arduino Uno because precise control of environmental variables is crucial in microbial fermentation processes. APP-All MCU 2023 supports multiple microcontrollers (8-bit, 16-bit, and 32-bit), offering greater flexibility and processing power, which is essential for managing complex tasks like monitoring multiple sensors simultaneously. In contrast, the Arduino Uno uses an 8-bit AVR microcontroller, which is more limited in performance and may struggle with more demanding applications. Additionally, APP-All MCU 2023 comes with built-in sensors and peripherals, and it supports both mikroBUS and Arduino expansion interfaces, allowing easy integration of additional sensors without the pin conflicts often encountered with Arduino Shields. This makes APP-All MCU 2023 a better fit for projects that require scalability and advanced control.
Linking Microchip with Sensor: I2C
Inter-integrated circuit (I2C)
In the implementation of FLEXS on the microchip development board, we chose I2C due to its lightweight communication protocol, which is not only efficient but also supports multiple devices on the same bus with minimal wiring. This flexibility allows us to scale the sensor system without adding complexity, making it ideal for embedded applications. Moreover, its low power consumption and ability to handle moderate data rates ensure the system's energy efficiency, further enhancing the overall performance and reliability of our design.
Figure 1: Compare I2C and traditional communication protocols (in this case, UART)
I²C (Inter-Integrated Circuit) is a simple communication protocol used to connect multiple devices, like sensors or displays, to a microcontroller. It uses only two lines: SDA (Serial Data Line) for data transfer and SCL (Serial Clock Line) for synchronization. One device acts as the master, controlling communication, while the others are slaves that respond to the master’s commands.
Communication starts with a start condition from the master, followed by the slave address to select which device it wants to talk to. After that, the master sends a read/write bit, then either sends or receives data from the slave. The process ends with a stop condition.
Fig2: I2C communication format
1. Start Condition (START)
- Description: The master device initiates communication by sending a start condition. This is done by pulling the SDA (Serial Data Line) low while SCL (Serial Clock Line) is high.
- Purpose: It signals all connected devices that a communication session is beginning.
2. Slave Address
- Description: After the start condition, the master sends a 7-bit or 10-bit slave address (depending on the configuration) followed by a read/write bit.
- Purpose: This address identifies which slave device the master wants to communicate with. Each slave must have a unique address on the bus.
3. Read/Write Bit (r/w)
- Description: This is a single bit (0 or 1) that follows the slave address.
- 0: Indicates a write operation (data is sent from master to slave).
- 1: Indicates a read operation (data is received from slave to master).
- Purpose: It tells the selected slave whether the master intends to send data or request data.
4. Acknowledgment (ACK)
- Description: After the master sends the slave address and the read/write bit, the addressed slave responds with an acknowledgment bit (ACK).
- Purpose: This confirms to the master that the slave is ready to communicate.
5. Data (DATA)
- Description: After the ACK, the master sends or receives data bytes (8 bits).
- For a write operation, the master sends data to the slave.
- For a read operation, the slave sends data to the master.
- Process: After each byte is sent, the receiving device (master or slave) must acknowledge receipt of the byte by sending an ACK.
- Purpose: This is the actual data transfer phase where information is exchanged between the master and the slave.
6. Stop Condition (P)
- Description: The communication ends with a stop condition, which is created by pulling the SDA line high while SCL is high.
- Purpose: This signals all devices on the bus that the communication session has ended and allows them to prepare for future transmissions.
I²C is popular because it allows multiple devices to share the same two lines, making it efficient for simple connections in embedded systems. It's widely used in applications like controlling displays or reading sensor data.
Sensor Overview
BME280:
The BME280 sensor performs multiple functions, including temperature, humidity, and pressure measurement. All signals from the sensor are converted into digital signals through its built-in ADC. The raw data, along with internal calibration parameters, is sent to the MCU, where the necessary calculations are performed to provide accurate readings for each of these variables.- For temperature measurement, the registers in the BME280 store three calibration parameters related to the raw temperature data. These parameters, along with the raw data, are transmitted to the MCU, which performs the calculations to produce the final temperature reading.
- In pressure measurement, the BME280 first sends raw pressure data and calibration parameters to the MCU, which corrects the data based on temperature. Since temperature affects pressure readings, the MCU processes the temperature-corrected raw pressure data using the nine calibration parameters from the sensor to provide an accurate pressure reading. This ensures the pressure data remains accurate regardless of temperature fluctuations.
- For humidity measurement, the BME280 transmits raw humidity data and calibration parameters to the MCU. The MCU then adjusts the raw humidity data based on the temperature reading, using the six calibration parameters from the sensor. This correction is crucial because humidity readings are highly sensitive to temperature changes.
Figure 3: Internal Architecture of the BME280
Ph2 click
The pH 2 Click operates by measuring the hydrogen ion concentration in a solution using a pH electrode, which generates an electric potential proportional to the pH value. Since the signal from the pH electrode is weak and has high impedance, it first passes through the MCP607 operational amplifier. This amplifier is configured in unity gain mode to shift the voltage and buffer the signal without altering its amplitude, ensuring that the high-impedance signal from the electrode is properly stabilized.Figure 4: Sensor structure
Once the signal is buffered, it is passed to the MCP3221, a 12-bit Analog-to-Digital Converter (ADC), which converts the analog voltage into a digital value. The digital data is then transmitted to the microcontroller (MCU) via the I2C communication protocol, representing the measured voltage corresponding to the pH level.
In the provided code, the I2C communication is managed by functions : ph2_read_raw_adc(), which retrieves the raw digital value from the MCP3221. The raw ADC value is then converted into a voltage using the formula:
\[ \text{voltage} = \text{raw\_adc} \times \left( \frac{3.3}{\text{PH2\_ADC\_RESOLUTION}} \right) \]
This voltage is used to calculate the pH value through the following formula:
\[ \text{pH\_value} = 7.0 + \frac{\text{set\_vol} - \text{rx\_data}}{\text{PH2\_PH\_CALCULATION\_COEF}} \]
Here, 7.0 represents the baseline pH, set_vol is the calibration voltage, and rx_data is the current voltage reading. This calculation transforms the voltage difference into the corresponding pH value, providing a reliable pH measurement.
Light sensor(veml7700)
After the VEML7700 sensor receives a light signal, it first converts the light intensity into an electrical current through its built-in photodiode. This analog signal is then processed by the sensor's internal 16-bit Analog-to-Digital Converter (ADC), which transforms the current into a digital value representing the light intensity.
Before the sensor performs these measurements, the MCU configures parameters like ALS_GAIN (gain) and ALS_IT (integration time) through the I2C interface. The gain adjusts how much the light signal is amplified, which is crucial for ensuring accuracy in various lighting conditions—higher gain for low light and lower gain for bright environments. Integration time determines how long the sensor captures data, where longer times increase accuracy but slow down response.
Once the sensor completes the ADC process, it stores the 16-bit digital data in its registers. The MCU can then retrieve this data via I2C. Using the retrieved raw data, the MCU calculates the actual light intensity (in lux) by applying a formula that takes into account the gain and integration time settings:
\[ \text{Light intensity (lx)} = \frac{\text{ADC output}}{\text{Gain} \times \text{Responsivity}} \]Here, the ADC output is the raw data received from the sensor, and the gain and responsivity depend on the sensor's settings.
In summary, the VEML7700 sensor converts light into a digital signal using its internal ADC, and the MCU retrieves and processes this data based on the configured parameters, ensuring accurate measurement of ambient light.
Data Analysis
To make data analysis more convenient, after collecting it via sensors and development boards, the process can be streamlined by using UART (Universal Asynchronous Receiver-Transmitter) to establish a connection between the board and the computer. This allows for real-time data transmission, enabling users to visualize the data as diagrams and charts, making it easier to monitor experiment conditions as they unfold.
By combining real-time visualization with post-experiment data logging in CSV format, this approach provides both immediate insights during the experiment and flexibility for in-depth analysis afterward. This enhances the usability of the system for operators, while ensuring data integrity throughout the process.
What is UART
UART, or Universal Asynchronous Receiver-Transmitter, is a hardware communication protocol used to send data between two devices. It works by converting data between parallel and serial forms. In simpler terms, UART allows two devices to communicate with each other using only two wires: one for sending data (TX) and one for receiving data (RX).
Unlike other communication protocols, UART doesn't need a clock signal to keep the sender and receiver in sync. Instead, both devices agree on a data transmission speed (called the baud rate). This makes UART simple and efficient for basic communication tasks, often used in microcontrollers, sensors, and embedded systems. It’s a key technology for serial communication, commonly seen in things like connecting GPS modules, Arduino boards, or other devices to computers.
Figure 5: UART concept
Designing a Parts
During incubation, flasks are usually placed in an incubator. However, if we want to monitor conditions within the experiments, some sensors need to be placed inside the flask. As a result, we must ensure that the sensors are installed tightly to prevent them from loosening due to the shaker's movement.
In this case, because we need to measure the pH value in the medium, we had to design a cap to secure the pH probe and prevent it from colliding with the flask. Eventually, we collaborated with the National Taipei University of Technology and used a 3D printer to produce a custom cap for a 100 mL flask. This cap works effectively in the experiments, allowing us to collect data safely.
Conclusion
By combining the aforementioned technologies, FLEXS has become a user-friendly sensor system that assists researchers in collecting data that was previously unattainable. It also allows for functional expansion to meet different parameter collection needs. To validate the practicality of the device, we applied it to the initial stages of the fermentation process, with detailed content available in the measurements page. The results showed that it operated as expected, with safe and simple usage procedures. Overall, it is a comprehensive experimental tool.
Reference
-
- Microchip: https://www.microchip.com/
- BME280: https://www.mouser.com/datasheet/2/783/BST-BME280-DS002-1509607.pdf?srsltid=AfmBOoq_HElRsEPKWJNTFiuG-fVvhc-MYdqI_mM_8eHBAFuET8XbrAG6
- pH2 click: https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks/ph2
- veml7700: https://www.vishay.com/docs/84286/veml7700.pdf