Purpose: To provide an accessible, low-cost sobriety test tool built entirely from scratch using ATmega328P peripherals.
Starting idea: The project originated from the practical need for a simple, register-level embedded systems project that integrates multiple lab concepts into a real-world product.
Why it is useful: It demonstrates a complete embedded pipeline — analog sensing, interrupt-driven input, I²C communication, and GPIO output — while producing a functional, demonstrable device.
The diagram below shows all hardware and software modules and how they interact.
| Component | Qty | Notes |
| — | — | — |
| ATmega324P | 1 | Main MCU |
| MQ-3 alcohol sensor | 1 | Analog output |
| Temperature sensor (LM35 or NTC) | 1 | Optional, for calibration |
| Push buttons | 2 | Test start + calibration |
| LEDs (green, yellow, red) | 3 | Status indicators |
| 220Ω resistors | 3 | LED current limiting |
| LCD 16×2 or OLED 128×64 (I²C) | 1 | Display module |
| Buzzer | 1 | Optional audio alert |
| Breadboard + jumper wires | — | Prototyping |
| 5V USB power supply or battery | 1 | Power |
| 16 MHz crystal + 2×22pF caps | 1 | MCU clock |
| 10kΩ pull-up resistors | 2 | I²C lines SDA/SCL |
Pin mapping:
Diagram
Third-party libraries and sources:
Planned algorithms and data structures:
To be completed
===== Download =====
<note warning>
* Github: https://github.com/Mihai4GH/PM_Proiect
Files will be uploaded under namespace :pm:prj2025:cc:your_name.
The archive will contain:
* src/ — all .c and .h source files
* schematics/ — KiCad or draw.io schematic files
* README.md — project description and build instructions
* Makefile — compile and flash script (avr-gcc + avrdude)
* CHANGELOG.md — version history
</note>
===== Jurnal =====
<note tip>
| Week | Activity |
|—|—|
| Week 1 | Component selection, initial schematic, MQ-3 and ATmega324P datasheet study |
| Week 2 | Hardware implementation, prototyping |
| Week 3 | Software implementation, fixing wrong read values on MQ-3 sensor |
</note>
===== Bibliografie/Resurse =====
<note>
Resurse Hardware:
* MQ-3 Datasheet – Hanwei Electronics
* ATmega324P Datasheet – Microchip Technology
* LM35 Datasheet – Texas Instruments
Resurse Software:
* AVR-GCC / AVR-libc documentation
* Microchip Studio (AVR Studio)
* Microchip AN2480 – I²C/TWI for AVR
* PM Lab materials – course wiki (laboratoare GPIO, Întreruperi, Timere, ADC, I²C)
</note>
<html><a class=“media mediafile mf_pdf” href=”?do=export_pdf”>Export to PDF</a></html>