Project designed and written in Rust in conjunction with the E7020E Embedded System Design course at Luleå University of Technology.
The purpose of this project is to create a breathalyzer to estimate the blood alchohol content (BAC) in a person's breath. To do this a prototype PCB will be designed connected to an alchohol sensor, a button to start the breathalyzer and a small display to show the alchohol permille detected. Over LoRa this device will also alert a ThinkBoard server that this user's breath contains too much alchohol, i.e. they are about to pass out.
The goal is to package this is in a simple and safe to use way for users to interact with. The data that is sent to the ThinkBoard server could be seen as sensitive data and would be ideal to encrypt it before transmitting it.
There is no sure way to calibrate this device as the project team does not have access to a real industry-grade breathalyzer. Thus this device can only very roughly estimate the BAC of a person's breath and SHOULD NOT be trusted in any serious situation where it is critical to know the real BAC.
- Murata CMWX1ZZABZ-078
- Grove - Alchohol sensor
- 4-pin connector to sensor
- SSD1306 based display
- 65100516121 USB mini-B
- Pin headers
- LM1117IMP-ADJ voltage regulator
- 2x Electrolytic capacitors 10uF
- 2x Buttons
- 1x Piezo buzzer
- 1x Antenna
- Rustup 1.14.0+
- rustc 1.31.0+ (stable)
- GNU ARM embedded toolchain (check your package manager or manually install it)
- OpenOCD
- Nucleo dev board (in programming mode)
- Breathalyzer PCB
Install rustup by following the instructions at https://rustup.rs.
Then install the following tools for rustup and cargo:
rustup component add llvm-tools-preview
rustup target add thumbv6m-none-eabi
cargo install cargo-binutils
Below are the absolute minimum packages you will need for Linux. Names might vary depending on your distribution, you might need to install it manually if you can't find it using your distribution's package manager.
openocd
arm-none-eabi-gdb
gcc / gcc-c++ (as well as their respective dev packages)
llvm-8.0 (and its dev package)
All the tools can be install using Homebrew:
brew cask install gcc-arm-embedded
brew install openocd
The design of the breathalyzer can be found in /pcbdesign. It was created and can be opened with KiCad. The program has been written especially for that design.
First confirm that the correct runner is chosen in .cargo/config, as the gdb package name might be different depending on you OS. Then build the project
cargo build --features="radio"
Connect to the card using the Nucleo F401RE dev board as a programmer with the given configuration
openocd -f openocd.cfg
Then build the project and flash the card
cargo run --features="radio" --release
- Viktor From - vikfro-6@student.ltu.se - viktorfrom
- Mark Hakansson - marhak-6@student.ltu.se - markhakansson
- Kyle Drysdale - kyldry-5@student.ltu.se - KyleLouisDrysdale
Licensed under the MIT license. See LICENSE for details.