0

Biohacking: Build a Pocket Size Breath Tester

Adafruit’s SGP30 gas sensor is calibrated out of the box to measure a large range of volatile organic compounds (VOCs) and CO2. It can actually measures with 10x more precision than the previous generation of sensors. It peaks at 60,000 PPB for VOCs. The temperature and humidity are automatically compensated for. Probably the best part is that unlike other sensors which require a 24-48 “burn in” this one requires less than 20 seconds on startup to warm up and stabilize. Since VOCs include alcohol and acetone (a by-product of ketone production) this sensor is fun to use as a breath tester. This post will focus on how to connect, enclose and view the output of the breath tester. 

The I2C interface on the SGP30 makes for a super simple connection. We are using the Trinket M0 microcontroller running CircuitPython to read the output. A more detailed explanation of using the SGP30 is available in this tutorial. It is important to note that the latest versions of adafruit_sgp30 and adafruit_bus_device libraries can be obtained from the CircuitPython Bundle.

    $ unzip adafruit-circuitpython-bundle-2.2.1-mpy-20180204.zip

    $ cp adafruit_sgp30.mpy /Volumes/CIRCUITPY/lib

    $ cp -pr adafruit_bus_device /Volumes/CIRCUITPY/lib

The Trinket M0 has a REPL>>> console which we can use to press the enter key when ready to test and view the results. After 30 seconds of gathering breath samples the code will select the highest VOC reading detected and display it for us. If we were trying to find a correlation to blood ketones and breath acetone we could record this high VOC value to the results of a blood ketone meter like the Precision Xtra from Abbott. After collecting data lots of samples from both devices we could come up with a possible correlation from breath readings to blood ketones.

Adafruit sells small modular snap boxes. These are great for a breath tester as the lid pops open to let the humidity out. All that is needed to modify the case is a 3/32″ drill bit for the mounting bolts (M2 size x 10mm). The uni-bit on the left can be used to for drill out space for a USB plug and the 1/4″ hole required for the straw. The nice thing about using drinking straws is that they are an easy way for people to share the breath tester and not share germs.

 

Once the components are soldered and secure in the enclose we connect via the micro USB cable to upload the code and watch the console. Here is an example from a OS/X command line. I usually just search for /dev/*modem* to find the Trinket device.

$ cp code.txt /Volumes/CIRCUITPY

screen /dev/tty.usbmodem1421


Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, or even use Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for MakeCode, CircuitPython, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Join 8,500+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – Python on Microcontrollers is here!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/


Maker Business — Rethink Robotics closes shop. Long live collaborative robots #makerbusiness

Wearables — Cleaning is key

Electronics — Serial overkill

Biohacking — Biohacking Resources – Books, Talks and Podcasts

Python for Microcontrollers — CircuitPython @ Hackaday SuperCon #ICYMI @circuitpython @micropython @ThePSF #Python

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



No Comments

No comments yet.

Sorry, the comment form is closed at this time.