Growing up, I've always heard of accidents happening due to undetected gas leakage. These accidents would result in fires, property destruction and sometimes death. After getting married, I found it challenging to deal with the Buta gas vessel with confidence as I was always worried it might be leaking. That's when I thought of creating a portable compact gas detector that would alert the people in a household or the driver in a car in case there is a leakage.
First, I had a look at different gas sensors online to get an idea on how they usually look like. The different enclosure designs were very interesting but due to the limitations of the project and after multiple trials to find a balance between being feasible to produce and ergonomic to use, I decided to make it as small as possible. After creating the circuit with all its components, I started carefully placing it in smaller boxes until I got an idea of the measurements I needed for the enclosure. I went for a cuboid design using loft tool on Fusion 360
Then, I started searching for and downloading stl or step files of circuit's components to add them in my file. This step would guide me further in the process when adjusting the design and adding different connections like brackets, tabs and slots. I adjusted the placement of the components in the enclosure's interior to replicate what the project's circuit would look like.
Next, I started creating new file components out of each 6 sides of the enclosure by extruding each face 3mm (acrylic sheet thickness) into bodies of seperate componenets.
After that, I started creating sketches on each face of the enclosure that would indicate the placement of screws and nuts to hold components like the LCD screen, the LED bulb, and the MQ-6 sensor in place. I had to use a digital calliper to take measurements of different openings. Getting the measurements for the LDC and MQ-6 frames was very interesting. By taking the maximum and minimum distance between adjacent holes and dividing their sum by 2, the centre of their diameter can be determined. It was important to have all of the dimensions defined. I also shifted around the components with the new sketches to ensure accuracy.
Moreover, it was time to add the connective brackets to hold the enclosure's sides to each other. Using midplanes constructed between the sides of the enclosure, I was able to hold the sides to the base with 5 right angle nuts. The top part required some extra work as I had to measure the angles between the top surface and the front and back sides. Based on these angles, I made copies of the original right angle bracket files and adjusted their angles. After carefully revising the geometry and the placement of each component, it was time to extrude cut all the holes and openings required to fix the openings and components in place.
Lastly, it was time to add the finger joints at the edges of each surface, I drew a rough sketch of how I imagine the sides would connect to each other and started applying the tabs by sketching on each surface and extrude-join.
To prepare the file for fabrication, I saved each surface's sketch as DXF to compile on LaserWork to laser cut on the acrylic sheet. I also compiled all the 9 brackets in one file with minimal spacing and exported as STL files to slice on Cura
After exporting the stl file and slicing it on Cura, the technician helped me edit some parameters like the machine type and cooling percentage. I unloaded the old filament and loaded a new one to the machine. Thankfully, the brackets were within the gram quota and did not require supports or adhesion to the machine's bed. The printing time was not too long and would allow me to prepare my enclosure's file for laser cutting.
I opened the 6 DXF files on Laserwork to nest them close to each other. Since I specifically waned to use opaque/coloured acrylic, I only found two thin black plates, so I had to divide my enclosure sides on two files and luckily, they fitted. The technician also instructed me to change the speed and power parameters that I had and follow the ones dedicated to cutting 3mm acrylic. After the plates were cut, I was eager to try and join them together and was happy that they fitted perfectly.
My electronic circuit constituted of the following components:
Mini bread board to hold the wires in place
Arduino Nano to operate the system
Power Supply (chargeable batteries with input/output adapters) of output 7.4 -9 volts
LM317 Regulator to convert 9v to 5v
MQ6 Gas Sensor (Input) to detect and measure the gas level in the surrounding environment
LCD screen (16*2) (Output) to preview messages indicating gas levels
Piezo buzzer (Output) to act as an auditory alarm/siren when gas is detected
LED light (Output) to act as a visual alarm/siren when gas is detected
On/off switch to operate the system
Jumper wires for connections
The software used were
Tinker CAD for creating the circuit diagram
Arduino IDE for building the code
Fusion 360 for creating the enclosure & connections
Cura for slicing and preparing file before 3D printing
Laser Work for laser cutting the enclosure
Since the product is meant to be portable, it relies on rechargeable batteries. I was provided with 2 lithium-ion rechargeable batteries that were rather bulky. Nevertheless, I had to adapt in terms of its size and power usage. I considered using power banks, but I learnt that they will not provide enough power and that some of them may overheat which might affect or even damage the other components. I was also provided with a rather bulky dc step down converter which I decided to replace with the LM317 regulator that I've used before to convert 9v to 5v in a previous project.
For the gas sensor, I found this reference for LPG gas sensor interface with Arduino (MQ6) | LPG gas sensor interface. It had the code as well as the wiring diagram. As for the LCD screen, I followed one of the prerecorded diploma tutorials explaining in detail how to make it work. The tutorial also had a link explaining In-Depth: Interfacing an I2C LCD with Arduino. I decided to challenge myself by making the sensor detect different levels instead of just detecting if there's a leakage. This was achieved by using the Arduino's analog pin.
I sought help from DeepSeek as the other sources were too complicated for me to understand. I followed the code while changing the threshold based on the calibration I made (using a lighter). I also adjusted the 3 different outputs. The first level would indicate clean air with just a message on the screen, the second would alert to ventilate with a beeping buzzer and the LED going on & off. Lastly, if the threshold reaches a certain high level, the screen would alert with 'Gas Detected' with the buzzer and led continue to work uninterrupted until the gas level fall below the threshold again or when the power goes out.
After making sure that the circuit design was correct, it was time get rid of as many jumper wires as possible and replace them with wires that are flat on the bread board to make the circuit more compact. After fabricating, I started the assembly process by joining the connecting brackets to the base followed by the right side and the back side. The MQ-6 sensor was easily fixed in place with the screws and did not require nuts to keep them in place. Next, I joined the LED bezel and LCD screen to the top plate of the enclosure. As I was about to join the front and left side, I had some second thoughts and decided that I wanted them to be transparent rather than black to showcase the circuit while it was working. So I laser cut those two sides again using 3mm transparent acrylic and fitted them. Before securing the left side screw, I tested the project one last time to make sure it was working well. Finally, I took some fancy pictures of my project.
Photo of final project after assembly
Demo of final project in action
My colleague and friend, Mohamed ElSayed suggested that I connect the MQ-6 sensor to the analog pin instead of the digital pin originally suggested in the online reference. This would help in getting a range of gas levels and therefore allow functions/responses in the code and project. He also helped me laser cut the transparent sides again to showcase my project's circuit. My colleague and friend, Mohamed ElAraby also 3D scanned the lithium-ion batteries as I had wanted to add them in my design file. My husband, Ahmed Roshdy always supported me by simplifying things when coding was too complicated. Last but certainly not least, my dad guided me on how to rearrange and optimise my circuit design by eliminating unnecessary jumper wires to make the circuit more compact and the wires more fixed in place.
I accidently switched up SDA & SCL wiring to A4 and A5 so the serial monitor gave a message of "No I2C devices found". I knew the LCD was working because the screen was lit and there couldn't be an error with a ready code on the software. So, I checked the wiring and fixed the issue.
Accidently tried to upload the 'Hello World file'. So next time, I have to be careful not to have multiple Arduino sketches open to avoid confusion.
Tried to have a 3D scan of the lithium ion batteries due to their irregular shape and to try to fit them into the enclosure but for some reason the file did not work. I wasn't too worried as it was not crucial to have an accurate representation of it but rather a resemblance in geometry and size.
Reconsider the power source and invest in one that is more compact
Add a Bluetooth module that would help me to wirelessly monitor the gas levels
Have the messages written in arabic on the LCD screen