IOT Based Food and Medicine Quality Monitoring
A whopping number of perishables items both frozen food and medicines gets spoiled due to undetected temperature excursions caused by long electricity outages or refrigerator failures. The temperature and intensity of light in the storage area are considered as a primary parameter in food/medicine s
2025-06-28 16:33:26 - Adil Khan
IOT Based Food and Medicine Quality Monitoring
Project Area of Specialization Electrical/Electronic EngineeringProject SummaryA whopping number of perishables items both frozen food and medicines gets spoiled due to undetected temperature excursions caused by long electricity outages or refrigerator failures. The temperature and intensity of light in the storage area are considered as a primary parameter in food/medicine storage safety. The case becomes more complex when spoiled food freezes again. There exists no mechanism other than expensive chemical testing from labs to detect that either the food or medicine is good for use or not. This not only affects the health of the consumer but also causes monetary losses. To overcome this issue, continuous data monitoring is required for a better-quality monitoring of perishable items.
Here we proposed IoT(Internet of Things) enabled solution which provides a distinctive variety of sensors to monitor the fridge parameters (temperature, humidity, light, door open close, vibration sensor, and voltage sensor) with higher accuracy. The system also has an inbuilt vibration sensor for theft monitoring. The system has the ability to generate an alert in case of any movement. Communication between modules (node and gateway) is achieved by LoRa based communication protocol. In the realm of IoT, LoRa (Long Range) based communication brings revolution due to its low power consumption and long-range coverage. In Pakistan, loRa has not yet made a remarkable landmark in the field of health care which indicates the loophole created in this area. Therefore, our proposed solution uses this technology and finds its potential application in the food and pharmaceutical industry. The end-nodes are laid out in a large number to form LoRaWAN network, as a single gateway can communicate with all the nodes.
The proposed system has two modules, i.e., loRa node and the gateway. The sensors constantly read the information and send it to the gateway. The data is stored at the cloud and is accessible to the authoritative personnel through a web/mobile application. The local store manager and the authoritative personnel will be notified immediately if any of the parameters get out of the preset threshold limit.
Project ObjectivesAccording to the World Health Organization (WHO), with 600 million people around the globe, almost 1 in 10 people in the world fall ill after eating rotten food. Around 420,000 die every year, resulting in the loss of 33 million healthy life years. In Pakistan, cases of food poisoning have been commonly reported.
The main focus of this project is to construct an economically viable, compact and low-power monitoring system for refrigerators. This system uses loRa, which is a low power IoT (Internet of Things) technology. The system has numerous sensors integrated, which include, temperature, humidity, light, voltage and door open/close state. The system monitors real-time temperature and humidity.
This system finds its application in the medical and food industry.
For pharmaceutical companies, a medical refrigerator is an essential component. There the temperature-sensitive medicines such as vaccines and, insulin is kept. Some light-sensitive medicines are also available which are required to be kept under the light of certain specified wavelengths. Thus, a temperature and light intensive controlled environment is built with the help of this device, to keep these medicines intact.
In the food industry, there is a high risk of food spoilage, which results in the wastage of inventory. There are a number of the reason for food spoilage and the one possible reason is the irregular temperature change. The irregular change in the temperature causes the frozen food to rot. Our device continuously monitors the real-time temperature and humidity of the refrigerators.
To ensure the quality of food and medicines, Total Quality Management (TQM) personnel visits the pharmacies and restaurants regularly. In order to avoid the manual check-up and to automate the system, the data taken from sensors installed at refrigerators is saved at the cloud. This data is then analyzed. The regularity authorities have access to this data through the web application. The web application shows data history, logged data and graphs.
Pharmacies or superstores managers often turn off refrigerator power supply during the night time in order to minimize the electricity bill cost. However, this system keeps the continuous check on electricity supply by monitoring voltage levels. This way the risk of goods getting rotten is lessened.
The system also provides protection against the theft of refrigerators as it contains expensive medicines. A vibration sensor is installed in a system that is able to detect vibrations as a result of lifting and dragging the refrigerator.
Project Implementation MethodOur system has two important phases. First is the data monitoring, which is done through sensors. Second is the remote access to data. This is done through a wireless communication, loRa (Long Range) IoT protocol. LoRa is an open communication protocol. It can wirelessly communicate over a radius of up to 15 km with a line of sight and 2 to 3 km without a line of sight. LoRa is a low cost, long-range, low power, and low data rate solution for IoT applications. Here is the general overview of the system.(Fig. 1)

Node-End:
The board will be powered up from the AC supply. This AC will be stepped down and rectified from 220V to 6V DC and will be delivered to two areas of circuits. One would measure the real power of the appliance and others would provide Vcc to the whole circuit passing through the voltage regulator IC.
The sensors are embedded with the microcontroller. The sensors used for the device are temperature sensor, humidity sensor, door-opening sensor and light sensor, voltage sensor. However, the microcontroller will also be receiving the inputs from the keypad with the sole purpose of user interface with the device, If the user needs any data of the device. Moreover, an LCD display will also be displaying the data of the system. An antimicrobial (UV light) will also be installed inside the refrigerator in order to minimize the effect of bacteria. (Fig. 2)

For loRa communication, several approaches were tested before adopting the final approach.
Node-1 to Node-2:
This was the finalized configuration of the project. The two nodes were configured in duplex mode. Each node behaves as transmitter and receiver too. Node-1 first configured as a transmitter as it sends the data to Node-2 and changes its mode to receiver mode and waits for the acknowledgment message. On the other hand, Node-2 is programmed in receiving mode until it receives the message. As soon as the message is received, it changes its mode from receiving to transmitting and sends back an acknowledgment message.
This approach became successful and field-test was done in order to check the signal strength and range of the signal. The gateway was set up in the university in the open air to achieve a maximum line of sight. The node was moved all across the radius of the gateway.
Results:
- Successful delivery of packets from node to the gateway
The successful acknowledgment was achieved back at the node
Benefits of the ProjectTo ensure the compliance of standard, safety, and effectiveness of drugs and perishable items, it is important to monitor the conditions continuously.
- Real-time data is accessible at a webserver
- Data logging of periodic data is set up
- An active alarm system is established to send alerts to the store manager
- Data history is accessible by authoritative personnel
- Remote monitoring of data is available for back end managers
- Data security is maintained through hardcore encryption
- The redundant battery is provided to activate a device even when supply power is cut off
- Long battery life is achieved by using a high mAh battery
- In the boom of IoT, we have used loRa technology in the region to educate people as it is the foreseen future of IoT
Below shown is the working prototype of our system. The system has two modules. One is the end node on which sensors are embedded. Along with that, an RFM96w, a transceiver module, is also connected with the microcontroller. This whole assembly makes up the sending node. Another node on the receiver will be listening on the 433 MHZ, that is, the operating frequency and will be receiving the data of the sensors. This data is sent to the cloud and also displayed on the LCD.


The following are some major components of our system.
Sensors Specifications:
A.Temperature and Humidity Sensor:
This sensor measures the temperature and humidity and outputs a digital signal.
- Model: DHT22
- Data input:
- Temperature
- Humidity
- Data output: Digital voltage signal proportional to temperature.
- Power supply: 3.3V-6V
- Ranges:
- Temperature: -40 to 80°C, ±0.5°C accuracy
- Humidity: 0-100%, 2-5% accuracy
B. Light Sensor:
This sensor measures the light intensity and converts it into a proportional voltage signal. This voltage is converted into the lux using a formula:
Lux= analog Read () * 0.9765625
- Model: Temt6000
- Data input: Light intensity with wavelength ranges from 420–800 nm
- Data output: Analog voltage signal proportional to the light intensity
C. Door Open/Close Sensor:
SPST will be used to detect the current status of the door i.e. open/close.
Main Control Unit Specifications:
Sensors are interfaced with the microcontroller. The Microcontroller is than connected to Long Range (LoRa) Transceiver Module.
- Model: ATmega328p
- Operating Voltage: 1.8- 5 V
- I/O and packaging: 28 pins with 23 I/O lines
LoRa Node Specifications:
The LoRa transceiver node has sensors data at the input. It transmits the data over the LoRa towards the gateway.
- Model: RFM95w
- Operating frequency: 433 MHz
- fXOSC: 32 MHz
- Bandwidth (BW): 125 kHz
- Spreading Factor (SF): 12
- Error Correction Code (EC): 4/6.
- Packet Error Rate (PER): 1%
- High Sensitivity: down to -148 dBm
- Output power: 13 dBm in transmission
- Payload length: 64 bytes
| Item Name | Type | No. of Units | Per Unit Cost (in Rs) | Total (in Rs) |
|---|---|---|---|---|
| Total in (Rs) | 73240 | |||
| 3d Prinitng | Equipment | 4 | 1125 | 4500 |
| Display and LCD's | Equipment | 3 | 3454 | 10362 |
| LoRa Modules | Equipment | 10 | 1096 | 10960 |
| Anntenas and Accessories | Equipment | 5 | 1180 | 5900 |
| Sensors | Equipment | 6 | 1065 | 6390 |
| IC's and Microcontrollers | Equipment | 10 | 1068 | 10680 |
| Basic Electronics Compnonets | Equipment | 8 | 634 | 5072 |
| PCB Fabrication | Equipment | 8 | 577 | 4616 |
| Other Electronic Components | Equipment | 16 | 464 | 7424 |
| Batteries | Equipment | 2 | 1000 | 2000 |
| Shipment and other charges | Miscellaneous | 4 | 1334 | 5336 |