My circuit is a project for my uni course and the fabrication cost is way too expensive to mess up (148 USD), so I want to have a second opinion on whether I messed up somewhere while designing the circuit.
The circuit is an over engineered "fire alarm" with crude sensors and two microcontrollers. The block diagram looks like this:
I haven't updated the diagram, but I replaced the ATMEGA328P with ATMEGA32u4 so I don't need a USB to UART converter. We are required to use ATMEGA and not just the ESP32, which is why there's unnecessary complexity. I could have used a smoke detector IC but that would defeat the purpose of the course to design a combination/sequential circuit with a microcontroller.
Here's the schematic:
Schematic_IoT Fire Alarm_2023-10-07.pdf (240.6 KB)
Here's the PCB file (json file for easyeda)
PCB_PCB_Routing_2023-10-07.zip (309.5 KB)
(low res png of PCB)
3D view of the PCB:
- The PCB is 4 layers (signal-5V-GND-signal)
- All components are in the top layer
- Bottom layer is used for routing signals only
The atmega and esp32 communicates through I2C, and the atmega can be programmed through the 10-pin header (USBasp) or the USB port.
The sequential circuit looks like this:
I used 74 series logic ic and flip-flops. OR gate is AHC, D flip-flop is LVC, NOT gate is HC. All use 5V VCC, the clock and mononostable multivibrator is TLC555 timer ICs. Default values for OR gate is 10k pulldown resistor.
Basically, all it does is sound the buzzer if either sensors (temperature DHT22, smoke MQ-2) detect signs of fire (high smoke sensor value, or high temperature). The sensor values are processed by the atmega and outputs digital HIGH to the IO pins (GAS, TEMP). ALARM and HUSHBUTTON, is a push button. HUSHAPP is a button press from the arduino IoT cloud app and sent as digital HIGH from IO pin to the sequential circuit.
I'm asking if the way I designed the pcb / schematic would result in me being unable to run the logic circuits properly, or power the device, or any egregious mistakes that would warrant a fix that would require a re-fab. (This is my first time working on a pcb so please point out any layout mistakes as well if you spot them)
Edit: Due to time constraints, and financial constraints, I will just go with reusing my working prototype through-hole components lying on my breadboard and slap them on a pcb. Feel free to re-use any resources I shared in this post.