LED Breath Stats Mask

Similar documents
Adafruit LED Sequins. Created by Becky Stern. Last updated on :02:00 AM UTC

Adafruit CCS811 Air Quality Sensor

Adafruit SGP30 TVOC/eCO2 Gas Sensor

Clockwork Goggles. Created by John Park. Last updated on :03:10 PM UTC

NeoPixel Ring Bangle Bracelet

Mystical LED Halloween Hood

Interior Purse Light. Created by Becky Stern. Last updated on :41:08 PM UTC

Adafruit AMG8833 8x8 Thermal Camera Sensor

Audio Prank Gift Box. Created by Becky Stern. Last updated on :46:15 PM UTC

Jewel Hair Stick. Created by Leslie Birch. Last updated on :47:17 PM UTC

Adafruit Color Sensors

Adabot Operation Game

Light-Up Angler Fish Embroidery

Adafruit LED Sequins. Created by Becky Stern. Last updated on :00:06 PM EST

Naughty or Nice Machine

Neon LED Signs. Created by John Park. Last updated on :11:09 PM UTC

Bunny Ears with MakeCode

Easy Sparkle Pocket T-Shirt

Trinket-Powered Conference Room Occupancy Display

Adafruit Capacitive Touch Sensor Breakouts

3D Printed Camera LED Ring

Adafruit APDS9960 breakout

Feather Weather Lamp. Created by Ruiz Brothers. Last updated on :54:26 PM UTC

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

Adafruit DRV2605 Haptic Controller Breakout

Celebration Spectacles

Adafruit AS channel Visible Light Sensor

'Sup Brows. Created by Kate Hartman. Last updated on :52:04 PM UTC

NeoPixel Basketball Hoop

FLORA TV-B-Gone. Created by Becky Stern. Last updated on :32:57 PM UTC

Solar Boost Bag. Created by Becky Stern. Last updated on :44:55 PM UTC

Circuit Playground Express Head-Tilt Ears

LED Eyes. Created by Ruiz Brothers. Last updated on :50:55 AM UTC

TSL2561 Luminosity Sensor

NeoPixel Manicure. Created by Sophy Wong. Last updated on :50:38 PM UTC

Data Logging with Feather and CircuitPython

Infinity Mirror Valentine's Candy Box

MCP Bit DAC Tutorial

MLX90393 Wide-Range 3-Axis Magnetometer

Joy Featherwing. Created by Dean Miller. Last updated on :03:07 PM UTC

ISS Pin. Created by Leslie Birch. Last updated on :27:30 PM UTC

Crawling Baby Sea Turtle Robot

Toy Car Speed Timer. Created by Kirby Griese. Last updated on :13:49 PM UTC

Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout

i2c/spi LCD Backpack Created by lady ada Last updated on :11:04 PM UTC

Getting Started with FLORA

Crawling Animatronic Hand

Crickit Dancing Marionette Kit Created by Dano Wall. Last updated on :03:11 PM UTC

FLORA and GEMMA ICSP. Created by Becky Stern. Last updated on :42:16 PM UTC

DIY Circuit Playground Shields

MCP Bit DAC Tutorial

Con Badge with Circuit Playground Express

Stumble-Bot. Created by Dano Wall. Last updated on :04:06 AM UTC

Mad Science Test Tube Rack

Magical Mistletoe. Created by Leslie Birch. Last updated on :45:29 PM UTC

Android GBoard Morse Code Control with Circuit Playground Express

Trash Panda. Created by Dano Wall. Last updated on :30:46 AM UTC

Adafruit Mini TFT " 160x80

Pushrod Garage. Created by John Park. Last updated on :07:30 PM UTC

Coffee Detonator: The TNT Plunger Grinder

Flora Wearable GPS. Created by Becky Stern. Last updated on :32:36 PM UTC

Chirping Plush Owl Toy

Trinket NeoPixel LED Longboard

Adafruit PowerBoost 500 Shield

Getting Started with FLORA

Guardian Shield+ Zelda Breath of the Wild

NeoPixie Dust Bag with Circuit Playground Express

Adafruit TPL5110 Power Timer Breakout

NeoPixel Bike Light. Created by Ruiz Brothers. Last updated on :43:46 PM UTC

Trellis 3D Printed Enclosure

Slider Crank Mechanism -- from Cardboard and Craft Sticks

Circuit Playground Yoyo

NeoMatrix 8x8 Word Clock

Bandolier of Light. Created by Becky Stern. Last updated on :16:17 PM EST

Adafruit 8x16 LED Matrix FeatherWing

UFO Flying Saucer with Circuit Playground Express

1.8" TFT Display Breakout and Shield

7" Portable HDMI Monitor

Portable Apple Watch Charger

FLORA Pixel Brooch. Created by Becky Stern. Last updated on :19:07 PM EST

LED Stego Flex Spike Hoodie

The Scream: Interactive Screaming Painting

Adafruit Si7021 Temperature + Humidity Sensor

Adafruit GPIO Expander Bonnet for Raspberry Pi Created by Kattni Rembor. Last updated on :12:47 PM UTC

CircuitPython Snow Globe

Adafruit PCF8523 Real Time Clock

PyPortal NeoPixel Color Picker Created by Kattni Rembor. Last updated on :42:41 PM UTC

Milk Jug Glow Skull. Created by John Park. Last updated on :28:36 PM UTC

Monochrome OLED Breakouts

PyPortal View Master Created by Ruiz Brothers. Last updated on :51:28 AM UTC

14-Segment Alpha-numeric LED FeatherWing

Adafruit 1.27" and 1.5" Color OLED Breakout Board

Reindeer Mask with Animated Eyes

Camera LED Ring Light

FLORA and GEMMA ICSP. Created by Becky Stern. Last updated on :30:55 PM EST

Getting Started with FLORA

Luminous LED Flowers. Created by Becky Stern. Last updated on :47:44 PM UTC

Adafruit 7-Segment LED FeatherWings

Adafruit Pi Cobbler Kit

NeoPixel Punk Collar. Created by Becky Stern. Last updated on :41:18 PM UTC

Transcription:

LED Breath Stats Mask Created by Michael Sklar Last updated on 2018-01-11 11:09:33 PM UTC

Guide Contents Guide Contents Overview Materials Asssembly CircuitPython Code Wear It 2 3 4 6 10 13 Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 2 of 14

Overview Combining Adafruit s CCS811 gas sensor with a Circuit Playground Express and two NeoPixel Sticks we can quickly put together a mask that displays our breath attributes. This setup will monitor temperature, carbon dioxide and total volatile organic compounds. The sensor is easy to work with using it s I2C interface and pre-calibrated ranges. A mask is an ideal wearable as it provides a place to house the electronics as well as an option for continuous monitoring as it is a hands free device that could be adapted for exercise or sleep. The gas sensors TVOC monitoring can be used as an indicator of ketosis as it will detect acetone levels on the breath which is a by-product of producing ketones. CO2 levels can also be a helpful indicator of how much glucose is being burned versus fats. Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 3 of 14

Materials We will be soldering the CCS811 gas sensor and NeoPixel RGBW Sticks to a quarter sized perma protoboard and the Circuit Playground Express. The mask will need to have several small holes cut into it so we can run the wires for the Circuit Playground Express Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 4 of 14

and NeoPixel Sticks. We will use ordinary nylon sewing string to adhere the components to the mask. I've placed the Circuit Playground Express on the blank side of the mask. The other side has a small plastic air filter so we will place a single NeoPixel Stick on that side. Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 5 of 14

Asssembly This nickel plated nibbling tool has been a staple in my lab for the last fifteen years. It makes easy work of trimming down PCBs and knocking off sharp corners. This quarter sized perma-proto board can fit into the mask as is, but I split it in half to save space. Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 6 of 14

Nibble, nibble, nibble. Solder 2" leads to each of the NeoPixel sticks. We only need to use the DIN, 5V and GND. Once the electronics are attached to the outside of the mask via sewing through the mount holes and unused pins we can start soldering wires to the perma-proto board. Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 7 of 14

This above wiring diagram shows which connections we need to put in place. Try and use 2" leads between components so it is to access the proto-board with a soldering iron. Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 8 of 14

Final hookup with all the components connected. Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 9 of 14

CircuitPython Code The Circuit Playground Express boards can run CircuitPython a different approach to programming compared to Arduino sketches. In fact, CircuitPython comes factory pre-loaded on the Circuit Playground Express. If you ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the Adafruit Circuit Playground Express Guide. To use the code below, plug the Circuit Playground Express into USB it should show up on your computer as a small flash drive then edit the file main.py with your text editor of choice. Select and copy the code below and paste it into that file, entirely replacing its contents (don t mix it in with lingering bits of old code). When you save the file, the code should start running almost immediately. import time import board import busio import adafruit_ccs811 import neopixel # i2c interface for the gas sensor i2c_bus = busio.i2c(board.scl, board.sda) ccs = adafruit_ccs811.ccs811(i2c_bus) # Three Different NeoPixel 8 LED Lengths for Output: # 1 - Temperature - Circuit Playground Built-In LEDs # 2 - Total Volatile Organic Compounds [strip] # 3 - Co2 Output - NeoPixel [strip] num_leds = 8 temperature_pix = neopixel.neopixel(board.neopixel, num_leds, brightness=.1) tvoc_pix = neopixel.neopixel(board.a1, num_leds, bpp=4, brightness=.1) co2_pix = neopixel.neopixel(board.a2, num_leds, bpp=4, brightness=.1) led_draw =.05 # delay for LED pixel turn on/off # wait for the sensor to be ready and calibrate the thermistor while not ccs.data_ready: Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 10 of 14

pass temp = ccs.temperature ccs.temp_offset = temp - 25.0 # clear all LEDs for breathing effect def clear_pix(delay): for i in range(0, num_leds): temperature_pix[i] = (0,0,0) co2_pix[i] = (0,0,0,0) tvoc_pix[i] = (0,0,0,0) time.sleep(delay) # Show Carbon Dioxide on a NeoPixel Strip def co2_led_meter(): co2_floor = 400 co2_ceiling = 8192 # Map CO2 range to 8 LED NeoPixel Stick co2_range = co2_ceiling - co2_floor co2_led_steps = co2_range / num_leds co2_leds = int( (ccs.eco2 - co2_floor ) / co2_led_steps) # Insert Colors for i in range(0, (co2_leds - 1) ): co2_pix[i] = (255,0,255,0) time.sleep(led_draw) # Show Total Volatile Organic Compounds on a NeoPixel Strip def tvoc_led_meter(): tvoc_floor = 0 tvoc_ceiling = 1187 # Map CO2 range to 8 LED NeoPixel Stick tvoc_range = tvoc_ceiling - tvoc_floor tvoc_led_steps = tvoc_range / num_leds tvoc_leds = int(ccs.tvoc / tvoc_led_steps) # Insert Colors for i in range(0, (tvoc_leds - 1) ): tvoc_pix[i] = (0,0,255,0) time.sleep(led_draw) # Show Temperature on Circuit Playground built-in NeoPixels def temp_led_meter(): temp_floor = 23 temp_ceiling = 36 # Map temperature range to 8 LEDs on Circuit Playground temp_range = temp_ceiling - temp_floor temp_led_steps = temp_range / num_leds temp_leds = int( (ccs.temperature - temp_floor ) / temp_led_steps) # Insert Colors for i in range(0, (temp_leds - 1) ): temperature_pix[i] = (255,255,0) time.sleep(led_draw) while True: # print to console # - co2 Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 11 of 14

# - co2 # - total voltatile organic compounds # - temperature in celsius print("co2: ", ccs.eco2, " TVOC:", ccs.tvoc, " temp:", ccs.temperature) co2_led_meter() tvoc_led_meter() temp_led_meter() time.sleep(.5) clear_pix(led_draw) Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 12 of 14

Wear It The Circuit Playground Express will need to initially plugged in for 48 hours so that the CCS811 sensor can burn in. The spec sheet suggests an additional 20 minute warmup before each use. Adafruit Industries https://learn.adafruit.com/led-breath-stats-mask Page 13 of 14

If you wish to see the raw data you can connect to the Circuit Playground Express micro USB connector to a computer and watch the console output. On Linux or OS/X the screen command the /dev/*modem* device is the easiest way. $ ls /dev/tty.usbmodem* /dev/tty.usbmodem1421 $ screen /dev/tty.usbmodem1421 115200 The above command will show the name of your Circuit Playground Express and connect you to the console on OS/X. You will probably need to adjust the usbmodem#### numbers to match your exist device. Adafruit Industries Last Updated: 2018-01-11 11:09:32 PM UTC Page 14 of 14