The Monoxide Project

Ezra Lazuardy
7 min readApr 10, 2022

A story behind the Monoxide development process.

Several days before I wrote this post, I’ve been busy developing a device, architecture, and an integrated system for the Internet for Things. And why do I bother to make those? it begins when I and my team decided to join an IoT competition.

Technocorner by UGM

https://www.technocorner.id

The Technocorner Competition is held by one of the University in Indonesia, Universitas Gadjah Mada (UGM). And honestly, I don’t know about this competition until one of my friends told me about it and asked me to build the team.

At first, I want to reject it, but considering that I had never made a proper IoT project before, I consider to join the competition. Why not? for me, winning or losing is not the main thing to work on. I’m enjoying and appreciating my time in the learning, development, and social process of this project.

This competition had some categories to be chosen by participants.

After discussing it a bit, we decided to pick the IoT competition. Why? because I’m only doing what I can do best, I don't do what I’m not good at. Simple.

Brainstorming

So we start figuring out some ideas to propose for the competition. We only discuss the STEM solution inside the given problem scopes such as smart home, home industry, medical, education, transportation, agriculture, environment, public facilities, renewable energy, and disaster mitigation.

Many ideas come out. Some are futuristic, some are realistic. For as long as I remembered, here’s the list of the ideas that come to our heads:

  • Medical alerting system for people with Vertigo symptoms and other medical conditions (with risk of falling on surfaces). It’s just utilizing a heartbeat sensor and gyroscopes sensor that is bundled in the watch-like device. We cancel it because of our budget limitation.
  • Earthquake & Tsunami early warning system. We cancel it because the Indonesian Meteorology Climatology and Geophysics Council already had it. Reference: https://inatews.bmkg.go.id.
  • Water flow meter with the integrated renewable energy system. We cancel it because of our budget limitation, and it is kinda too simple to implement.
  • Water quality monitoring system for fish cultivation. This is the second-best idea that we got. But considering there already is an Indonesian startup that focused on fish agriculture (eFishery), we cancel this idea. We are just too afraid to realize that this idea maybe will not succeed shortly. Reference: https://thefishsite.com/articles/indonesian-aquaculture-startup-breaks-records-with-90-million-raise.
  • And some others. I’m bad at remembering something.

Finally, an idea was born

At the end of the day, we were stuck with the ideas that need to be proposed. Luckily, a week before we brainstormed, I watched a documentary video by USCSB about the dangerous H2S gas.

By the way, it wasn’t intentional, I was bored and I was just browsing some random stuff around youtube and came across this video.

A documentary video by USCSB

In a nutshell, the video above explained the danger of H2S gas (Hydrogen Sulfide) that leaked out of the oil and gas facilities. In a large amount, hydrogen sulfide gas is colorless, odorless, but very deadly if inhaled by humans or animals. The video tells that 2 victims died because of unconsciously inhaling this gas.

And then I think, I can use this problem for a disaster mitigation category with the STEM solution such as an alerting system for lethal gas prevention. I’ve browsed around the Internet about the gas sensor for Arduino and then found this sensor datasheet: https://www.pololu.com/file/0J309/MQ2.pdf.

MQ-2 Gas Sensor Configuration

Perfect. That’s what I’m looking for. MQ-2 gas sensor has a high sensitivity to LPG, Propane, and Hydrogen, also could be used for Methane and other combustible steam, it is low cost and suitable for different applications.

Picked from one of the lethal gas names, Carbon Monoxide, we decided to propose a Monoxide Project for lethal gas substance prevention. We also decide to implement a cloud-based technology in this project. Why? why not?

Budgeting

Because some of us are still undergraduate students with no income at all and this project is not invested or supported by anyone, considering our limited budget, we need to pick the best and cheap device component of our project.

At first, we want to use Arduino as our mainboard for the IoT project. But considering the need for efficiency in transferring data and communication systems, we decided to use Esspressif 32 SoC, with built-in wireless and Bluetooth capabilities.

https://www.espressif.com/en/products/socs/esp32

This SoC is also pretty cheap for us. We bought this SoC for only Rp. 80.000,- ($6). The total price including the MQ-2 sensor and the 3D printed device case is around Rp. 250.000,- ($18). Luckily I still had some cables and electrical components from my previous IoT project, and we can reuse them for this project. To minimize costs, we plan to publish the cloud-based platform in my personal domain at ezralazuardy.com.

Maybe you want to ask, how about the tools and cloud-server pricing that you need in order to develop and deploy the cloud-based platform?

Read our explanation below. Spoiler alert, it’s all free. Thanks to open-source.

The Monoxide Architecture

With 3 people on the team, including me, we separate the project into 3 subprojects.

Monoxide Device

https://github.com/BMO-technocorner/monoxide-device

This is the most important subproject. We need to develop an IoT runtime for ESP32 SoC with the capabilities to capture sensor data, provide a robust alert system, and communicate and transfer data through HTTPS service via RESTful API that was developed separately. This device uses local wireless fidelity (WiFi) as its main internet network.

We always implement something with a security-first approach. Applying HTTP(Secure) service instead of HTTP service is considered important for us for the sake of data security. We bundle the CA Certificate and a Unique ID (UID) into our device runtime so that the cloud-based REST API server can authorize and authenticate the request from the device.

We wrote this device runtime in C++ and Python using PlatformIO.

Reference: https://www.cloudflare.com/learning/ssl/why-is-http-not-secure

Monoxide API

https://github.com/BMO-technocorner/monoxide-api

This project is developed as the back-end of the Monoxide Ecosystem. Monoxide API has the job to save the data, and also manage it with the RESTful API approach.

We develop this API so that the other subproject can use this API as a Single Source of Truth. It’s centralized. For the sake of API documentation, we use Insomnia by Kong.

We wrote this back-end in TypeScript using Nuxt, Vue, integrated with Prisma ORM and PlanetScale serverless database platform. Monoxide API was deployed on the cloud-based edge platform at Netlify.

Monoxide Dashboard

https://github.com/BMO-technocorner/monoxide-dashboard

This subproject is developed for the front-end of our system. Monoxide Dashboard has a role to manage the data through Monoxide API and provides a handy interface so that users can manage their data easily.

Based on their roles, we separate the user into 2 categories.

Client User
This user is considered a Monoxide Device owner. He can add their device via Unique ID (UID) that is embedded in each device into this dashboard so that he can see their device status and the report data if there is lethal gas detected by the device. Client users may have many Monoxide Devices.

Users can accept a report sent by Monoxide Device if convinced there is a gas leakage in their place. This report will be sent to the Guard User for further processing.

Guard User
This user is considered an authority to deal with gas leakage problems. They can be police, firefighter, or other authority as long as they can help if there is a gas leak problem reported by a user.

Both Client and Guard users can sign in to the Monoxide Dashboard with separate features.

We wrote this front-end in TypeScript using Next, React, and deployed it on the cloud-based edge platform at Netlify.

Our commitment to Open Source

We develop, deploy, and publish this project using modern open source technologies and it’s totally free of charge (except for the device components that we bought). As a form of our gratitude to the open-source community, we decide to publish all of our Monoxide Subprojects as open-source under MIT License.

Check out our GitHub organization page for further detail.

https://github.com/BMO-technocorner

Monoxide Demo

A device has been developed, a platform has been published, and a deed has been done. Now we just have to make a good video about the Monoxide Platform demonstration.

Sincerely,
Made with ❤️ by the BMO team.

--

--

Ezra Lazuardy

“An idiot admires complexity. A genius admires simplicity.” — Terry A Davis