We use cookies to ensure our website works properly and to personalise your experience. Cookies policy
Department of Pharmaceutical Chemistry, College of Pharmacy, Madras Medical College, Chennai 600003. Affiliated to The Tamil Nadu Dr.M.G.R Medical University, Chennai-32.
Counterfeit medicines are an important public health concern because they may contain incorrect amounts of active pharmaceutical ingredients, inappropriate substances, or may lack the intended therapeutic ingredient. Conventional analytical techniques such as chromatography, spectroscopy and mass spectrometry can provide reliable identification, but many of these methods require expensive instruments, trained personnel and laboratory facilities. The present project focuses on the development of a simple, portable and low-cost sensing device for preliminary detection of counterfeit medicines. The proposed system combines a paper-based sensing platform with color-based detection using a TCS34725 color sensor interfaced with an Arduino Nano. Controlled illumination using visible and ultraviolet light is incorporated to improve observation of color responses. The color response obtained from the test sample can be compared with that of an authentic reference sample. The system also incorporates optical character recognition (OCR) to extract printed pharmaceutical information from medicine packaging. The proposed prototype is intended as a preliminary screening tool that can provide a rapid indication of possible differences between genuine and suspected samples.
The definition of counterfeit drugs was established by the World Health Organization in 1992 as one that is deliberately and fraudulently mislabeled with respect to its identity and/or source. It can apply to both branded and generic products, may include products with the correct ingredients or with the wrong ingredients, without active ingredients, with insufficient active ingredients, or with fake packaging.
In 2011, the WHO proposed a new definition of substance, spurious, falsely labelled, falsified, and counterfeit” (SSFFC), considering public health impact. As per WHO 2019a, a counterfeit medicine is deliberately and fraudulently mislabeled concerning its identity, composition or source.
Counterfeit products as per WHO, 2019b
As per the USFDA, counterfeit medicines/falsified medicines are described as harmful to health because they are being passed off as authentic, may contain the wrong ingredients, contain too little or no active ingredient at all, or contain other harmful ingredients. As per CDSCO, Counterfeit drugs, which are categorized into three types under the Drug and Cosmetic Act, 1940.
Spurious and Adulterated drugs: Drug formulations that are designed to look like another drug, particularly a well-known brand, to deceive the consumer and capitalize on the success of the original product are known as “spurious” or “imitation” drug products. The product may or may not include active substances.
Adulterated medicines: These include an adulterant or substituted product or are tainted with impurities, making them harmful to health.
Grossly substandard drugs: drugs manufactured by authorized producers that have been shown to have significant defects that lower the medication's egregious carelessness or manufacturing non-compliance with GMPs. The defects may broadly be as under:
Executed in-process controls, or inappropriate storage or transportation circumstances for medicines. Examples of some such defects are as under:
Electronic Components
Sensing Materials
For colour reaction, Azithromycin and Calcium lactate were selected. For text detection, Calcium lactate, Paracetamol and Omeprazole were selected.
Software
Arduino Nano-Based Color Sensor and LED Setup
The Arduino Nano was placed on the breadboard and connected to a computer using a USB cable. The Arduino Nano was used to control the white LED and UV LED. The LEDs were programmed to operate alternately, with each LED switched on for 3 seconds followed by an off period. Controlled illumination was used to provide consistent lighting during the sensing experiment.
|
Component |
Connection |
|
White LED, short end (-) |
220 Ω → GND |
|
White LED, long end (+) |
220 Ω → D9 |
|
UV LED, short end (-) |
220 Ω → GND |
|
UV LED, long end (+) |
220 Ω → D8 |
Arduino Nano and LED setup.
Arduino code for UV and white Led control
// 1. UV LED ON - 3 seconds
digitalWrite(UV_LED, HIGH);
digitalWrite(WHITE_LED, LOW);
delay(3000);
// 2. UV LED OFF - 3 seconds
digitalWrite(UV_LED, LOW);
digitalWrite(WHITE_LED, LOW);
delay(3000);
// 3. WHITE LED ON - 3 seconds
digitalWrite(UV_LED, LOW);
digitalWrite(WHITE_LED, HIGH);
delay(3000);
// 4. WHITE LED OFF - 3 seconds
digitalWrite(UV_LED, LOW);
digitalWrite(WHITE_LED, LOW);
delay(3000);
Arduino Nano–Color Sensor Connections
The TCS34725 color sensor module was positioned near the paper-based sensing zone at a fixed distance and angle. The white LED provided consistent illumination for color measurement, while the UV LED was used when UV illumination was required. The Arduino Nano was programmed to obtain red (R), green (G), blue (B), and clear (C) values from the TCS34725 sensor. Sensor operation was checked using blank paper before applying the medicine sample. After color development, the paper sensor was placed under the TCS34725 sensor, and the RGB values were recorded
|
TCS34725 Pin |
Arduino Nano |
|
SDA |
A4 |
|
SCL |
A5 |
|
GND |
GND |
|
VIN |
5 V |
Arduino Nano–TCS34725 color sensor setup.
Arduino code for TCS34725 color sensor interfacing
#include <Wire.h>
#include "Adafruit_TCS34725.h"
Adafruit_TCS34725 tcs = Adafruit_TCS34725(
TCS34725_INTEGRATIONTIME_50MS,
TCS34725_GAIN_4X
);
void setup() {
Serial.begin(9600);
Wire.begin();
if (tcs.begin()) {
Serial.println("TCS34725 Colour Sensor Detected");
}
else {
Serial.println("Colour Sensor Not Detected");
while (1);
}
}
void loop() {
uint16_t r, g, b, c;
tcs.getRawData(&r, &g, &b, &c);
Serial.print("Red: ");
Serial.print(r);
Serial.print(" Green: ");
Serial.print(g);
Serial.print(" Blue: ");
Serial.print(b);
Serial.print(" Clear: ");
Serial.println(c);
delay(1000);
}
Arrangement of Components Inside the Black Cardboard Box
|
Component |
Position |
Purpose |
|
TCS34725 colour sensor |
Top/center, facing downward |
Detects RGB color |
|
Paper-based sensor |
Directly below TCS34725 |
Holds the color reaction |
|
White LED |
Beside the sensor, facing paper |
Provides controlled illumination |
|
UV LED |
Beside the sensor, facing paper |
Provides controlled illumination |
|
Arduino Nano |
Above the cardboard box |
Controls sensor and LEDs |
|
Breadboard |
Under Arduino Nano |
Holds circuit connections |
|
USB opening |
Side wall |
Connects Nano to laptop |
|
Black cardboard |
Surrounds sensing area |
Reduces interference from ambient light |
Arrangement of components inside the black cardboard box.
Preparation of Whatman Paper
Preparation and Application of Reagents
For Calcium lactate detection, sodium nitroprusside and sodium hydroxide (NaOH) were employed as the colour-producing reagents. For Azithromycin detection, bromocresol green was used as the colorimetric reagent. The reagents were applied to separate Whatman paper sensing zones and allowed to dry before application of the drug extract.
Application of Sample to Paper
Representative paper-based sensing sequence.
Colorimetric Detection of Azithromycin
After color development, the paper was placed inside the controlled illumination enclosure. The white LED was switched on to provide uniform visible illumination. The TCS34725 color sensor detected the developed color and recorded the red (R), green (G), blue (B), and clear (C) intensity values. The Arduino Nano received the sensor readings through I²C communication and displayed the values through the Serial Monitor. The obtained color values were compared with blank/standard samples to determine the color response.
|
Parameter |
Observed value |
|
Sensor status |
TCS34725 sensor found |
|
R |
102 |
|
G |
46 |
|
B |
38 |
|
C |
148 |
|
Detected colour |
Blue |
Representative color development for the paper-based sensing reaction.
Colorimetric Detection of Calcium Lactate
The Calcium lactate sample was subjected to the paper-based color reaction using sodium nitroprusside and sodium hydroxide. After color development, the sensing paper was measured using the TCS34725 sensor under controlled illumination.
|
Parameter |
Observed value |
|
Sensor status |
TCS34725 sensor found |
|
R |
25 |
|
G |
11 |
|
B |
9 |
|
C |
38 |
|
Detected color |
Red |
Text Detection and Identification Using OCR
A reference database was created using authenticated medicine samples. The database contained medicine identification details and package images. The reference information was organized for comparison with unknown samples. During analysis, text and color characteristics of the test sample were compared with corresponding reference data to support preliminary identification and screening of suspected counterfeit medicines.
|
I D |
Medicine |
Strength |
Manufacturer |
Dosage form |
Key OCR text |
MFG |
EXP |
Batch No. |
Color |
Status |
|
1 |
Paracetamol |
500 mg |
Eurekem Laboratories |
Tablet |
Paracetamol Tablets IP 500 mg |
FEB-26 |
JAN-28 |
PT4266079 |
White |
Genuine |
|
2 |
Calcium lactate |
300 mg |
Eurekem Laboratories |
Tablet |
Calcium Lactate Tablets IP 300 mg |
NOV-25 |
OCT-27 |
CL25160 |
White |
Genuine |
|
3 |
Omeprazole |
20 mg |
Boheringer Ingelheim |
Capsule |
Omeprazole Capsules |
MAR-26 |
JAN-28 |
B250144 |
Pink + White |
Genuine |
OCR Workflow
Optical Character Recognition (OCR) was incorporated into the prototype to assist in the identification of medicines from printed labels or packaging. Images of medicine packages were captured using a camera or smartphone under controlled lighting conditions. The images were resized, denoised, adjusted for brightness and contrast, converted to grayscale, thresholder, and cropped to the region containing text. The pre-processed image was then supplied to the OCR system, which converted the detected characters into machine-readable text. The extracted text was compared with the information stored in the reference database.
OCR-Based Authentication of Paracetamol
1. Image Acquisition
The images of tablets/medicine packages were captured using a camera or smartphone under controlled lighting conditions.
2. Image Pre-processing
The quality of the captured images are improved before OCR analysis by the following:
3. Text Detection Using OCR
The pre-processed image is given to the OCR (Optical Character Recognition) system. OCR detects the characters present on the tablet/package and converts the image-based text into machine-readable text.
4. Text Extraction
The detected text was extracted and compared with the text stored in the database.
OCR- based text detection and authentication of Paracetamol
Representative Paracetamol package used for OCR-based identification.
Python code for Paracetamol text recognition
import cv2
import pytesseract
# Tesseract OCR path
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
# Load paracetamol image
image = cv2.imread("paracetamol.jpg")
if image is None:
print("Error: Image not found.")
exit()
# Resize image
image = cv2.resize(image, None, fx=2, fy=2)
# Convert to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Remove noise
gray = cv2.GaussianBlur(gray, (3, 3), 0)
# Thresholding
_, thresh = cv2.threshold(
gray, 0, 255,
cv2.THRESH_BINARY + cv2.THRESH_OTSU
)
# OCR text extraction
text = pytesseract.image_to_string(thresh, config="--psm 6")
# Display detected text
print("Detected Text:")
print(text)
# Check for Paracetamol
if "paracetamol" in text.lower():
print("Result: PARACETAMOL DETECTED")
else:
print("Result: PARACETAMOL NOT DETECTED")
# Display processed image
cv2.imshow("Processed Image", thresh)
cv2.waitKey(0)
cv2.destroyAllWindows()
Result
OCR- based text detection and authentication of Paracetamol
OCR-Based Authentication of Calcium Lactate
The captured Calcium lactate package image was processed using the same OCR workflow. The extracted text was compared with the corresponding authenticated database entry to support preliminary identification.
Representative Calcium lactate package used for reference comparison.
Python code for Calcium lactate text recognition
import cv2
import pytesseract
# Set Tesseract OCR path
pytesseract.pytesseract.tesseract_cmd = (
r"C:\Program Files\Tesseract-OCR\tesseract.exe"
)
# Load calcium lactate image
image = cv2.imread("calcium_lactate.jpg")
if image is None:
print("Error: Image not found.")
exit()
# Resize image for better OCR accuracy
image = cv2.resize(image, None, fx=2, fy=2)
# Convert image to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Remove noise
gray = cv2.GaussianBlur(gray, (3, 3), 0)
# Apply thresholding
_, thresh = cv2.threshold(
gray, 0, 255,
cv2.THRESH_BINARY+cv2.THRESH_OTSU
)
# Perform OCR
text = pytesseract.image_to_string(
thresh,
config="--psm 6"
)
# Display detected text
print("\nDetected Text:")
print(text)
# Check for Calcium Lactate
if "calcium lactate" in text.lower():
print("Result: CALCIUM LACTATE DETECTED")
else:
print("Result: CALCIUM LACTATE NOT DETECTED")
# Display processed image
cv2.imshow("Processed Image", thresh)
cv2.waitKey(0)
cv2.destroyAllWindows()
Result
OCR- based text detection and authentication of Calcium Lactate
OCR-Based Authentication of Omeprazole
The captured Omeprazole package image was processed using OCR. The extracted medicine name and available package information were compared with the corresponding reference information in the database.
Representative Omeprazole package used for OCR-based identification.
Python code for Omeprazole text recognition
import cv2
import pytesseract
# Set Tesseract OCR path
pytesseract.pytesseract.tesseract_cmd = (
r"C:\Program Files\Tesseract-OCR\tesseract.exe"
)
# Load Omeprazole image
image = cv2.imread("omeprazole.jpg")
if image is None:
print("Error: Image not found.")
exit()
# Resize image
image = cv2.resize(image, None, fx=2, fy=2)
# Convert to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Remove noise
gray = cv2.GaussianBlur(gray, (3, 3), 0)
# Apply thresholding
_, thresh = cv2.threshold(
gray, 0, 255,
cv2.THRESH_BINARY + cv2.THRESH_OTSU
)
# Perform OCR
text = pytesseract.image_to_string(
thresh,
config="--psm 6"
)
# Display detected text
print("\nDetected Text:")
print(text)
# Check for Omeprazole
if "omeprazole" in text.lower():
print("Result: OMEPRAZOLE DETECTED")
else:
print("Result: OMEPRAZOLE NOT DETECTED")
# Display processed image
cv2.imshow("Processed Image", thresh)
cv2.waitKey(0)
Result
OCR- based text detection and authentication of Omeprazole
IV. RESULTS AND DISCUSSION
The availability of counterfeit medicines in the pharmaceutical market poses a significant threat to public health. Counterfeit products may have incorrect drug identity, inadequate active pharmaceutical ingredients, improper strength, or misleading packaging information. Conventional authentication techniques generally depend on sophisticated analytical instruments and laboratory-based procedures, which may be expensive, time-consuming, and unsuitable for rapid field-level screening.
The prototype developed in this project combines a paper-based chemical response with electronic colour measurement. For the tested color reactions, the TCS34725 sensor produced distinct RGB/C readings: the Azithromycin test produced R = 102, G = 46, B = 38 and C = 148, with the detected color recorded as blue, whereas the Calcium lactate test produced R = 25, G = 11, B = 9 and C = 38, with the detected color recorded as red. These observations demonstrate that the prototype can capture measurable color responses from the paper-based sensing zone.
The OCR component provided a second screening parameter by extracting printed pharmaceutical information and comparing it with a reference database. The combination of chemical color response and package-text information can therefore provide two independent parameters for preliminary screening. The present findings support the feasibility of the prototype as a rapid, low-cost preliminary screening system; however, the reported results are preliminary and should not be interpreted as definitive pharmaceutical authentication without confirmatory analytical testing.
V. CONCLUSION
This project presents the development of a portable, low-cost prototype smart sensing device for preliminary screening of suspected counterfeit medicines. The system combines paper-based colorimetric sensing, a TCS34725 RGB color sensor, controlled white/UV illumination, Arduino Nano interfacing, and OCR-based text recognition. The color response and extracted package information can be compared with authenticated reference data to generate a preliminary matched or suspected result. The prototype may reduce dependence on sophisticated laboratory instruments during initial screening and can be further developed into a smartphone-assisted medicine screening device.
VI. LIMITATIONS AND FUTURE SCOPE
The present work represents a preliminary prototype. The manuscript reports color-response observations for selected medicine/reagent combinations and OCR-based reference comparisons, but it does not provide a sufficiently large validation dataset, sensitivity/specificity analysis, inter-day reproducibility study, or comparison with a validated reference analytical method. These aspects should be addressed in future studies.
Future development may include testing a larger number of authentic and suspected samples, establishing quantitative color thresholds, evaluating repeatability under different lighting and environmental conditions, expanding the reference database, improving OCR robustness, and integrating the sensing unit with a smartphone-based interface.
VII. ACKNOWLEDGEMENTS
We express our sincere thanks to the Department of Pharmaceutical Chemistry, College of Pharmacy, Madras Medical College, Chennai-03 for supporting us in carrying out this work.
REFERENCES
Dr. P. G. Sunitha, Mohammad Zahid, Nasrin Banu K, Nivetha M, Pavithra N, Pandiyan G, Rakshana S, Development of a Prototype Smart Sensing Device for Detection of Counterfeit Medicines, Int. J. of Pharm. Sci., 2026, Vol 4, Issue 9, 1128-1143. https://doi.org/10.5281/zenodo.22702486
10.5281/zenodo.22702486