# A Prototype of a Portable Gas Analyzer for Exhaled Acetone Detection
## 2 Development of the Portable Gas Analyzer
### Hardware Design  
The designed device provides three main functionalities: signals measurement; data analysis; and communication and interaction with the user and data presentation. Control electronics were designed accordingly to provide appropriate hardware resources. As discussed earlier, the device's housing needed to be divided into two compartments: one is the gas chamber and the other accommodates the control electronics. Therefore, two separate PCBs were designed, the layout of both are shown in Figure 3. The sensor array PCB located in the gas chamber hosts all the sensors for which heater supply, circuit supply, and signal outputs are routed via a pin header connector to the motherboard PCB located in the second compartment, which contains the control electronics of the analyzer. The header pinout is described in Table 1.  
Figure 3: The layout of the motherboard and daughterboard PCBs. Dimensions in mm. Sensing array’s layout visibility is limited due to the patent pending. Figure 2: 3D view and projections of the developed housing for the portable gas analyzer designed using CAD software. The housing is comprised of two parts: a front piece with user interface elements (**a**), mouthpice port (**b**), USB port and \(\upmu\)SD card slots and back panels (**c**,**d**) allowing easy assembly (clips and slots) and access inside the device (**e**,**f**). Total dimensions are 95.2 mm \(\times\) 23.7 mm \(\times\) 51.6 mm. The main module on the motherboard PCB is the Adafruit Feather M0 Bluefruit LE development board as it is an excellent compromise between computing power, number, type of peripherals, size, and price. The board is powerful enough to handle the stand-alone operation of the analyzer, including the future implementation of a neural network (raw measurement, pre-processing, feature extraction, pattern recognition, classification, and decision making). Importantly, due to compatibility with Arduino Zero, the firmware can be written in C++ using the Arduino Development Environment which includes a wide range of libraries. The heart of the Feather M0 board is a 32-bit ATSAMD21G18 microcontroller with an ARM Cortex M0 core, clocked at 48 MHz, supporting logic in the 3.3 V standard. The chip has 256K FLASH memory and 32K RAM. It is equipped with built-in USB support giving it the ability to program and debug USB-to-serial without the need for an additional chip. The board is equipped with a dedicated connector for 3.7 V lithium-polymer batteries and a built-in battery charging system via a micro USB connector and available battery voltage monitoring functionality. In addition, it is possible to power it directly through the micro USB connector. The board has an automatic selector of the power source depending on whether it is powered by a battery or via the USB connector. In addition, the board is equipped with a Bluetooth Low Energy communication module. The user interface hardware is comprised of a 1.5' monochrome OLED display (SSD1305 driver) with a resolution of \(128\times 64\) pixels, a buzzer, and three tack-switches: up, OK, and down. Alternatively, a command-line interface is available. Analog signals from the sensor array are measured as a voltage drop across a 0.1% tolerant load resistor \(R_{Lx}\) located on the motherboard using a 12-bit microcontroller built-in ADC (\(V_{CC}=V_{ADCref}=+3.3\) V\({}_{DC}\)). To ensure a stable heater supply \(V_{H}\) to sensors, a high-efficiency step-up DC-DC converter was used providing +5 V\({}_{DC}\) and up to 250 mA\({}_{DC}\) from either the Li-Po battery or the USB line. It is also possible to disable the converter and thus implement the sleep mode. In addition, there is a \(\upmu\)SD card slot on the board that allows local acquisition of measurement data, a USB interface for data acquisition from the PC level, and a BLE (Bluetooth Low Energy) modem for wireless acquisition. Each of the components was chosen to take into account its power consumption as the analyzer is to be battery powered.