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


Adafruit publishes a wide range of writing and video content, including interviews and reporting on the maker market and the wider technology world. Our standards page is intended as a guide to best practices that Adafruit uses, as well as an outline of the ethical standards Adafruit aspires to. While Adafruit is not an independent journalistic institution, Adafruit strives to be a fair, informative, and positive voice within the community – check it out here: adafruit.com/editorialstandards

Join Adafruit on Mastodon

Adafruit is on Mastodon, join in! adafruit.com/mastodon

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, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, 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.

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

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

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

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


Maker Business — “Packaging” chips in the US

Wearables — Enclosures help fight body humidity in costumes

Electronics — Transformers: More than meets the eye!

Python for Microcontrollers — Python on Microcontrollers Newsletter: Silicon Labs introduces CircuitPython support, and more! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

Adafruit IoT Monthly — Guardian Robot, Weather-wise Umbrella Stand, and more!

Microsoft MakeCode — MakeCode Thank You!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — #NewProds 7/19/23 Feat. Adafruit Matrix Portal S3 CircuitPython Powered Internet Display!

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.