Labcard for pH dipstick

A pH dipstick is a small, disposable strip of paper or plastic that contains a pH indicator. The indicator is usually a chemical compound that changes color in response to the acidity or basicity of the solution being tested. The Labboy AI camera is an innovative device that uses colorimetry to measure pH levels. By digitizing the colors of pH test strips, the Labboy AI camera generates RGB values that can be used to train an AI algorithm to predict pH values. This technology has important applications in healthcare, environmental monitoring, and food safety, as it enables accurate and reliable pH measurement using a low-cost and portable device.

Labboy application note. Make pH dipstick reader using Labboy AI camera

Labboy AI camera scans the four sensing areas of the pH test paper and generates a set of RGB values for each color, resulting in a total of four sets of RGB values. Students will then need to record these RGB values in their lab book. After collecting the RGB data, students will need to prepare the data for the AI by performing tasks such as data validation, data splitting, and data visualization.


Session1. Make standard pH dipstick using pH-color chart

The first step is to prepare the dataset by using a pH-color chart. Students need to show the chart to the Labboy AI camera to train the relationship between pH and color. For dataset construction, we will use a commercial pH test paper.


Step1. Cut out pH-color chart

The construction of a pH standard strip is a relatively simple process. First, a cut-out of is obtained as shown above. It is important to ensure that it is properly positioned on a long and narrow backing sheet. This backing sheet provides the necessary support for the strip and ensures that it remains flat during use. In order to secure the cut-out to the backing sheet, a suitable adhesive may be used. This adhesive should be chosen carefully to ensure that it does not interfere with the desired pH readings. Once the cut-out has been properly secured to the backing sheet, it is ready for use.


Step2. Place pH standard on a labcard

The pH standard strip is inserted into a labcard, which is a credit card sized PVC sheet. The labcard holds the strip in position where the AI camera is in focus.


Step3. Insert the labcard into Labboy robot

The Labcard is inserted into the Labboy AI camera to digitize color


Step4. Open webpage of Labboy robot. Scan the pH standard. Record RGB values

Students use the Labboy AI camera to generate RGB values for 14 pH standard strips. When the card is inserted, the Labboy automatically scans the colors and displays the four sets of RGB values. Students record the values in their lab book and create a dataset using Excel software. This dataset will be used to train the AI.


Step5. Make dataset file (.csv format)

Excel sheet for dataset creation. Total 14 RGB values plus a pH value as a label are written.


Now, you are ready to train the AI camera of Labboy robot using Random Forest (RF) machine learning algorithm, which is known for its high accuracy, robustness, and ability to handle large datasets.


I am happy to have hands-on exprience of embedded AI from alpha to omega. Labboy with pH dipstick is a wonderful tool to teach how AI works in chemistry

High school teacher

Seoul, Korea

Project information

  • Category AI, Robot and Chemistry
  • Client SAGA Global Academy
  • Project date 01 May, 2023

Training of AI camera in Labboy robot

let’s train the AI using the Random Forest (RF) algorithm, which is known for its high accuracy, robustness, and ability to handle large datasets. Finally, the AI can be evaluated and optimized to ensure that it is accurate and effective at predicting pH values from RGB values.


Step1. Upload dataset.csv file

We provide a free web server for training of Labboy AI camera. By uploading the dataset.csv file, you can begin the training process.


Step2. Review dataset contents

The dataset file must be data, label format. The data is 12 RGB values and the label is pH 1 to 14. Check the dataset.csv file if it contains properly formatted.


Step3. Split the dataset to train and test

The dataset need to be splitted randomly to train and test. By clicking split menu,the server does this job automatically.


Step4. Check the quality of dataset

Good data has small variance and no outlier. The variance plot visualize the quality of data.


Step5. 3D plot shows how RGB data is scattered in 3D space

One way to visualize the R,G,B values is to display them in 3D space.


Step6. Train it using Random Forest Regressor

Check the mean absolute error of trained AI model.


Step7. Check prediction error for each pH test data

Over all pH range, prediction error is calculated and visually displayed as a prediction chart


Step8. Draw prediction error table

See the prediction error as a table


Step9. Optimize the machine learning model

Random forest regressor has many parameters such as number of trees. AI training server find optimal values automatically.


Step10. visualization of decision tree

Relatiopnship between pH and RGB value are complex because many pH indicator dyes are involoved in the colorimetric reaction. Machine learning algorithm find the relation while training process. Visualization of decisiontree shows this finding intuitively.


Step10. C code generator

Don't forget our goal. We are making AI pH dipstick reader. It has 32bit CPU. It need C-code firmware to translate RGB color to pH value. The code is generated by the AI training server automatically.


Though I am teaching machine learning in college, it is my first time to make embedded AI machine like AI pH reader device. Labboy has built-in AI camera that can be trained using AI training server. It was a good fun and very informative. Many thanks to Labboy team

College professor

Pohang, Korea

Project information

  • Category AI, Robot and Chemistry
  • Client SAGA Global Academy
  • Project date 01 May, 2023