item.STEAM DOCTOR - Mohyddin Tash

Hi, I'm Mo đź‘‹

I'm a Software Developer 💻 from Lebanon 🇱🇧

STEAM DOCTOR

Demo

Steam Doctor is a disinfection chamber designed to provide steam powered sterialization for people in public places. It also has audio/visual output features.

In this project I was responsible for design and development of the firmware that operates the system.

Requirements:

  The system is required to have the following properties:

Steam Doctor 3d Rendered Initial Design proposal

Steam Doctor 3d Rendered Initial Design proposal

Steam Doctor Front Portrait

Steam Doctor Front Portrait

Workflow:

The basic workflow of the machine is as follows:

This workflow is running infinitely, and during this flow the machine is always self monitoring to look for any issues and respond accordingly. For instance when water level inside the boiler drops below a certain threshold, the machine checks the water level inside the main solution container, and then check if it has enough solution to refill the boiler.

Closer View of Steam Doctor Front Panel

Closer View of Steam Doctor Front Panel

Challenges:

  When you think about the system requirements, it might sound easy to implement. I mean indeed, the system requirements could be simply described as collect a bunch of data from various sensors, send output to screens, play audio through speakers and open/close some valves. Pretty simple, what could go wrong? apparently, many things.. I wouldn’t consider myself to be an advanced embedded systems engineer, however, I always have managed to get around projects using my software skills, in addition to my partner’s electronics skills. However, this project, is much more complex and delicate than any other similar project I have worked with, for the very fact that it has some dangerous properties which could lead to serious damage if not controlled strictly. I could ramble and go into a lot of details just describing the challenges that I have faced while working on this project, but that would really make this post extremely long, so I will only about the one I found to be most challenging to me (feel free to reach out if you would like to have some discussion about it).

Steam Doctor Example of an LCD Garbage Output

Steam Doctor Example of an LCD Garbage Output

The single most challenging issue about this project I would say is Writing the whole system to run in non-blocking mode, i.e no delays are allowed (I did use some but maybe or two for very short duration), however, the machine is controlled using an ATMega256 micro-controller, meaning the whole system is to be run synchronously on a single thread. I would say this was the most critical challenge of the whole project and the reason for this is that there are two thermostats to be controlled while the system is running to make sure that boiler would never go above or below certain temperature and pressure thresholds, so imagine if the system in a state where the thermostats are ON and something block the execution thread. This could lead to really serious damages. There are safety valves installed on the boiler of course, but I have learned that I should take nothing for granted when working with hardware, because it can fail unexpectedly, one of the main reasons I dislike embedded systems projects.

Also at the time of building the project, there was an open issue with a core arduino library wire.h that had been open for more than 9 years! This library is used by the sensors which were communicating over i2c. The issue was that in case of a problem during transmission of the data, the system will block, not just the sensor that cause it, the whole arduino code will hang forever until manual reset. Thankfully, I found another library that implement a timeout behaviour to mitigate that, but this wasn’t ideal because any libraries that were relying on wire.h had to be changed into the new one, and every time there is an update for say the LCD library, it had to be modified manually. Luckily though just before handing over the project, the arduino wire.h library patched a fix, and we switched to that.

Techniques used to mitigate this challenge:

Things I would do differently

During the initial phase of system design, I realised that this system is a perfect candidate for a state machine design pattern. However, my C++ skills are a bit rusty and I was behind a very tight deadline for the MVP handover and I didn’t want to risk breaking the contract, so I wrote a simpler code. However, I’m totally certain that a state machine would have made things much much easier to maintain, debug and understand.

Results:

The MVP was delivered successfully and I learned a ton of things from it, however, there is a huge risk involved with such product (again I’m not a embedded systems expert nor I aspire to be one). Also, I believe that this project is definitely not a good fit for a freelance to take into production because many domains and stakeholders need to be involved (firmware engineers, electronics engineers, testing, product designer, legal, safety engineer, etc..), and the client had nothing close to that nor was showed a will to do so, so eventually after the handover of the prototype, I decided to not proceed any further with it.