Breathalyzer Medallion

by No George in Circuits > Arduino

917 Views, 4 Favorites, 0 Comments

Breathalyzer Medallion

IMG_20180727_155511.jpg
eink.PNG
esp32.PNG
MQ4.jpg
switch.PNG

We all have a special friend who needs supervision on a night out. Mine is called Geoffrey, and on his stag weekend it seemed prudent to have an outward display of how much of a liability he was likely to be.

This instructable outlines the construction of a medallion which contains a breathalyzer with a progress bar around the edge and an e-ink display in the middle. It is based on arduino code and uses an ESP32 board which is compatible with the arduino IDE.

Supplies

You will need

  1. Access to a 3D printer
  2. Access to a laser cutter
  3. Metalized laser cut material
  4. Small lipo battery
  5. Alcohol sensor - MQ3 or MQ4 breakout board [About £1 on eBay]
  6. E-ink display [waveshare 2.13" SPI module ~ £15 from banggood]
  7. ESP32 dev board with lipo charger [I used a lolin32 but adafruit now make the huzzah range which is very nice]
  8. Neopixel compatible ring [32 pixels is the right size if you want to use the attached CAD]
  9. Slide power switch [I used RS 829-0611]
  10. Decorations

Print These Parts

IMG_20180216_160827.jpg
IMG_20180727_090759_1.jpg

Print and cut out these parts. It is important to use a metallized material for the face plate as it will be used as a capacitive button.

Assemble and Wire Together

IMG_20180216_163534.jpg
IMG_20180216_164820.jpg
IMG_20180419_061258.jpg
IMG_20180802_220054.jpg
IMG_20180802_210638.jpg

Wiring:

Cut the battery wire and connect the switch inline. Connect the output from this to a piece of veroboard for distribution. Follow the schematic for the display and ring lines. I found the MQ45 sensor works more repeatably than the MQ3. They both use a reasonable current so are connected directly to the veroboad instead of through the esp32. The button wire is just a flying lead which uses the cap-touch capabilities of the chip. This pokes through a hole and must be scratched into the surface of the metallized faceplate. I added a garland to complete this medallion but any necklace substitute will do.

Upload the Code

It is likely that you will need to tune the thresholds for both the touchsense button and the alcohol sensor. Bear in mind that these sensors need bedding in for many hours so it is worth leaving it charging overnight before spending time on this.

You will need the following code and libraries

You will also need to install the esp32 board definitions into the arduino IDE

You're Done

badge.jpg

When you turn it on you will onscreen instructions. The alcohol sensor takes a while to stabalize so it will spend some time letting this warm up.

Afterwards there will be a heartbeat from the lights. Press the button and breath gently on the sensor for several seconds. After this it will give you a reading and offer to save it. The saved value will turn into the heartbeat. This device is not accurate or consistent but provides some decent entertainment. Enjoy The attached images show 1.6 Geoffreys. This is too many. Shortly after this the screen broke. Potential improvements Use a better sensor: Adafruit now offer an I2C sensor on a breakout board which looks promising Use an oled: The eink display allows saving of power and retains the last reading even after the battery dies. It is hopelessly dim in the dark though so the instructions are tough to follow. Make it small Turn it into a PCB