Introduction
The need for an onion storage unit arises because onions are highly sensitive to environmental conditions like temperature, humidity, and air circulation. After harvesting, onions continue to respire and release moisture, which can lead to sprouting, rotting, fungal growth, and weight loss if not stored properly. Traditional storage methods often fail to maintain the right conditions, resulting in significant post-harvest losses and reduced market value for farmers. A well-designed onion storage unit helps in maintaining a controlled environment with proper ventilation, allowing excess moisture and heat to escape while keeping the onions dry and cool. This extends the shelf life of onions, reduces spoilage, and allows farmers to store produce for longer periods and sell when market prices are favorable.
Approach
To tackle the problem of onion storage losses, the approach begins with a detailed study of onion behavior after harvesting. Onions are living biological materials, so they continue respiration, release moisture, and are highly affected by temperature and humidity. Understanding factors like optimum storage temperature, safe humidity range (generally around 65–75%), airflow requirements, and causes of spoilage such as microbial growth and sprouting is the first step. This study also includes observing how onions behave in local conditions (like Maharashtra climate), seasonal variations, and how long they can be safely stored under different environments.
Most conventional onion storage structures rely only on natural ventilation, which is not always sufficient. They often lack proper airflow distribution, leading to uneven conditions inside the storage unit. There is no real-time monitoring, so farmers cannot detect when humidity rises or temperature increases, which eventually causes rotting. Also, there is no early warning system for spoilage, meaning losses are noticed only after damage has already occurred. Structural issues like improper stacking, poor design of vents, and exposure to external weather conditions further reduce efficiency.

Prototype
To overcome the problems in traditional onion storage systems, we developed a prototype that focuses on improving ventilation and extending the shelf life of onions. The design consists of a cylindrical structure made using wire mesh, placed on an elevated platform to allow proper airflow from all sides. At the center of the structure, an air duct is installed and connected to a blower. This blower pushes air from inside the storage unit to the outside, ensuring continuous and uniform ventilation throughout the structure. This arrangement helps maintain suitable storage conditions and reduces the chances of spoilage.

Initially in this prototype we only measure temperature and humidity data , But after some discussion and literature study we decided to measure other parameters like CO2 gas, H2S gas , and O2 gas accumulation in certain regions.
Use of Sensors
Sensor integration plays a very important role in making the storage unit smart and efficient. By using sensors like temperature, humidity, and gas sensors, the internal conditions of the storage unit can be continuously monitored in real time. For example, humidity sensors help ensure that moisture levels do not rise above safe limits, while temperature sensors help prevent overheating. Gas sensors can detect early signs of onion spoilage by identifying gases released during rotting. These sensors can be connected to a controller (like ESP32), which can automatically adjust fan speed or ventilation systems to maintain optimal conditions. Additionally, data from sensors can be sent to the cloud for remote monitoring and analysis, helping in early detection of problems and better decision-making. Overall, sensor integration improves storage efficiency, reduces losses, and supports modern, data-driven agriculture.
Why Monitoring These Parameters is Important in Onion Storage
- Temperature Monitoring
- High temperature increases the respiration rate of onions.
- Leads to faster moisture loss, sprouting, and spoilage.
- Maintaining optimal temperature helps extend shelf life.
- Humidity Monitoring
- High humidity promotes fungal and microbial growth.
- Excess moisture leads to rotting and quality degradation.
- Controlled humidity keeps onions dry and safe for longer storage.
- CO₂ (Carbon Dioxide) Monitoring
- CO₂ is released during onion respiration.
- Increase in CO₂ indicates higher biological or microbial activity.
- Acts as an early warning sign of spoilage or poor ventilation.
- O₂ (Oxygen) Monitoring
- O₂ is consumed during respiration.
- Decrease in O₂ level indicates increased respiration or microbial growth.
- When O₂ drops and CO₂ rises together, it signals developing spoilage conditions.
- H₂S (Hydrogen Sulfide) Monitoring
- Released when onions start decomposing.
- Indicates breakdown of sulfur compounds due to microbial action.
- Acts as a late-stage indicator — shows that spoilage has already started.
Sensors Used
For this system i used followig sensors-
- Temperature / Humidity – AHT2415C
- CO2 – MHZ19B
- H2S – MQ136
- O2 – AO-03
Using this i developed one circuit board along with the firebase console to monitor and log data with help of Siddhart.
The circuit board consists of 3 Tem/Humi sensors, 3 O2 sensor, 3 H2s sensors and 3 CO2 sensors all this was connected to ESP32 Dev board and since including all these sensors was not possible for single ESP one I/O expander was used. All this was hand soldered on a Zero PCB to make a circuit board.

To house all those sensors and Controller board a custom 3D printed housing was designed and developed. The sensors housing consists of holes for all 4 sensors and harness . Where as the housing for controller consists of mounting hole for controller , harness input holes and power jack mounting.

Issues Faced
With this prototype i faced several issues –
1. First issue was related to use of sensors with testing I realized that O2 sensor is not necessary if I’m using CO2 sensor. So for my next prototype i removed O2 sensor.
2. Second issue was related to wire harness length, since the sensors were places at different location in storage unit the harness length was getting over a meter long and that create interference between the line and controller leading to signal loss and data losses. To rectify this issue i reduce number of sensors to be used per unit and kept it to only one so that accurate data can be measured.
3. Third issue was related to Software where in my firebase console i was getting inconsistent data because of factor like power cut and unreliable network connection so to tackle this issue i put up a WIFI router separate for my unit and connect my system to reliable power source with backup available.
System Upgrade: Electronics and Design Improvements
After initial testing and observations, major improvements were made in both the electronics architecture and the CAD design of the system to enhance reliability, scalability, and data accuracy.
Updated Electronics Architecture The earlier design used multiple sensors connected to a single controller, which caused issues like signal loss, wiring complexity, and unreliable data. To overcome this, the system was redesigned using a distributed architecture.
Now, only three essential sensors are used per unit:
MHZ19B for CO₂ monitoring
MQ136 for H₂S detection
AHT2415C for temperature and humidity
These sensors were grouped into independent modules (sensor sets), where:
Each set contains all three sensors
Each set is connected to its own microcontroller
A total of 6 such sensor sets were developed and placed at different locations inside the onion storage unit. This approach provides:
Better spatial monitoring across the storage
Reduced wiring complexity
Improved signal stability and accuracy
Easier scalability for larger storage systems

Custom PCB Design and Assembly
While building the system, I realized that wiring everything loosely would make it messy and difficult to maintain in the long run. So instead of keeping it as a temporary setup, I decided to design a proper circuit and assemble it on a Zero PCB.
This PCB holds the microcontroller along with all the sensor connections in a compact and organized way. One important thing I focused on was making the system easy to repair, because in real conditions, sensors can fail or need replacement.
To solve this, I used Relimate connectors instead of directly soldering sensors to the board. This made a big difference — if any sensor stops working, I can simply unplug it and replace it without disturbing the entire system.
It also helped in:
keeping the wiring clean
reducing troubleshooting time
making the setup more reliable overall
The entire board was hand-soldered, which gave me flexibility to modify the design as needed during testing. Even though it’s a simple approach, it worked really well for prototyping and field use.
In the end, this small design decision made the system much more practical and easier to handle, especially for long-term deployment in an actual storage setup.

Improved CAD Design and Housing
While working on the system, I also realized that the earlier housing design wasn’t very practical for real use. So with guidance from Dr. Yashwant, he redesigned the entire enclosure to better fit the updated electronics.
The new housing was designed to neatly fit all three sensors along with the microcontroller in a single compact unit. At the same time, had to make sure the sensors were actually exposed to the surrounding air — otherwise, the readings wouldn’t be accurate.
Another thing focused on was durability. Since this system is meant to be used inside an onion storage structure, the housing needed to protect the components from dust, rough handling, and general wear and tear.
Also made sure that installing the unit inside the storage setup would be simple, without needing too much adjustment or complex mounting.
Overall, this updated design made the system feel much more complete — not just something that works on a table, but something that can actually be deployed in real conditions without much hassle.

Deployment
After completing the design and testing, the next step was to actually deploy the system in real conditions. We installed the sensor units in two onion storage structures, each with a capacity of around one ton.
Both storage units were specially designed for this project. They have a cylindrical shape and are made using metal mesh, which allows natural ventilation from all sides. This helps in maintaining airflow and prevents heat and moisture from getting trapped inside.
One of the units was further enhanced with a central air duct system for forced ventilation. This duct runs from top to bottom and has holes throughout its length, so that air can be pushed evenly from inside the storage to the outside.
The duct is connected to a blower, which is controlled using a digital timer. Instead of running continuously, the blower operates at 18 different intervals over a 24-hour period. It is turned off for about 3 minutes every hour. This was intentionally done because too much airflow can dry out the onions, which is also not desirable. So this balance helps in maintaining proper storage conditions without causing moisture loss.
For monitoring, the sensor sets were distributed across both storage units. Each unit contains three sensor modules, placed at different heights — top, middle, and bottom. This arrangement helps in understanding how environmental conditions vary within the storage, rather than relying on a single-point measurement.
Overall, this deployment gave a much clearer picture of how the system performs in real-life conditions and helped validate both the design and monitoring approach.

Issue During Deployment (and an Unexpected Discovery)
After deploying the system inside the storage units, we ran into a major issue. The controllers placed inside the onion stacks were not able to log data to Firebase.
At first, we thought it was a simple hardware issue — maybe a loose power connection or wiring fault. But even after checking all connections, the problem still remained. So we started digging deeper.
After some testing and diagnostics, we discovered something unexpected: when the sensor units were completely surrounded by onions, the Wi-Fi signal was getting blocked.
Even a relatively thin layer of onions around the device was enough to weaken or completely cut off the signal. Because of this, the ESP32 inside the storage was unable to maintain a stable connection and failed to send data to Firebase.
This was something we hadn’t considered during the design phase, but it turned out to be a critical real-world factor.
Solution and Design Modification
To solve this issue, we made an important design change.
Instead of keeping the microcontroller inside the sensor housing, we separated the system into two parts:
Sensors placed inside the onion storage
Controller placed outside the storage unit
A separate enclosure was designed for the controller and mounted outside both storage units, where Wi-Fi connectivity was stable.
To make this possible, the sensor cables were extended to about 0.5 meters, allowing the sensors to remain embedded inside the onion stacks while keeping the controller safely outside.
This small change made a huge difference:
Stable Wi-Fi connectivity
Reliable data logging to Firebase
Easier access to the controller for maintenance

Monitoring Dashboard
To make the system more useful in real-life conditions, I also improved the Firebase monitoring setup so that the data is easier to understand and analyze. Instead of just showing raw values, the updated console now lets me view data from each sensor set individually, along with its past records. I can also see the data in both table and graph formats, which makes it much easier to spot patterns and changes over time. Because of this, it becomes simpler to identify if a particular area inside the storage is having issues, track how conditions are changing throughout the day, and take better decisions regarding ventilation and overall storage management. Link Of Dashboard – https://onionstorageva.netlify.app/

Data collection and monitoring
The monitoring phase has now started from 10th April, and the system is actively collecting data from the storage units. With three sensor modules installed in each unit, the idea is to observe how conditions change over time at different levels inside the storage. Going forward, this data will be analyzed and compared against various factors to better understand patterns, optimize storage conditions, and improve overall performance of the system.
