Chat
Welcome to Flux
Treat Flux like your intern. Tell it what you'd like to build and it'll get to work. You can also ask it questions, brainstorm ideas, and teach it your preferences. Learn More
Ready.
Reviews
Properties
Properties describe core aspects of the project.
Pricing & Availability
Distributor | Qty 1 |
|---|---|
Digi-Key | $6.42 |
LCSC | $1.51–$1.66 |
Mouser | $6.11 |
Assets
Assets are files uploaded to this project which can be used in various ways.
Controls
Welcome 👋
Flux helps you build PCBs faster with an AI teammate!
Create your account to collaborate, stay updated, fork your own version, and get instant answers from our AI agent.
szocske2
szocske2
szocske23
copilot
- 1 Fire Alarm Control Panel (FACP): The central component that monitors inputs and controls outputs based on those inputs.
- 4 Zones of Detection: Each zone can consist of several smoke detectors, heat detectors, and manual call points.
- Smoke Detectors
- Heat Detectors
- Manual Call Points
- 1 Sounder: To alert in case of an alarm condition.
- End of Line Resistors (EOLR): For supervising the integrity of the circuit. The value depends on the FACP's specifications; a typical value is 4.7kΩ.
- Power Supply: Ensure it matches the requirements for your FACP and devices in terms of voltage and current.
Basic Connections:-
Zones Connection:
- Each zone would have its detectors and call points connected in series. The start of each zone connects to a separate zone input on the FACP.
- At the end of each zone, you'd typically place an End of Line Resistor (EOLR) to monitor the integrity of the wiring. This way, the FACP can detect if there's a break in the circuit.
- Example: Connect
-
Sounder Connection:
- The sounder can be connected to the sounder output on the FACP. You might need to check if you require a relay or if it can be directly connected based on your FACP and sounder specifications.
- Connect
-
Power Supply:
- Connect the power supply to the FACP as per the manufacturer's instructions. Ensure it can also power the sounder and has enough capacity for all devices.
- It's also critical to follow any local regulations and standards related to fire alarm systems, such as NFPA 72 in the United States.
Notes:Smoke Detector Zone 1toManual Call Point Zone 1, then end the zone withEOLR, then back to the FACPZone 1 input.Sounder: +toFACP: Sounder Output +, andSounder: -toFACP: Sounder Output -.szocske23
copilot
- Microcontroller (MCU): Acts as the brain of the control panel. You can use something like an Arduino or an STM32, depending on your preference for programmability and complexity.
- 4 Fire Sensors (Smoke or Heat sensors): For detecting fire conditions in the vending machine.
- 4 Input Ports/Channels on the MCU: To connect each sensor to a separate input.
- Indicators (LEDs) or Display: For indicating which zone has been triggered.
- Power Supply: Ensure it matches your MCU and sensors' requirements.
Basic Design:-
Microcontroller Selection:
- Choose an MCU with at least 4 GPIO (General Purpose Input/Output) pins available for the sensors, plus additional pins for indicators or a display. For example, an Arduino Uno could work well for a simple implementation.
-
Sensor Connection:
- Assign each sensor to a dedicated GPIO pin on the MCU as an input.
- Example connection setup:
- Connect
- Connect
- Connect
- Connect
- Note: Ensure each sensor's output is compatible with the MCU's input voltage levels.
-
Indicator/Display Connection:
- For LEDs: Assign an LED to each sensor to indicate activation.
- Connect
- For Displays: Utilize SPI or I2C interface to connect an LCD/OLED display to show the activated zone(s).
-
Programming Logic:
- Write a program that continuously polls each input pin connected to the sensors.
- Upon detecting a signal (e.g., going HIGH), the program should identify which zone (sensor) was triggered and activate the corresponding LED or display a message on the display.
-
Power Supply Connection:
- Make sure the power supply is capable of powering the MCU, sensors, and any display or LEDs you're using.
Sample Code Snippet (Arduino-like Pseudocode):Sensor 1toMCU: Digital Pin 2.Sensor 2toMCU: Digital Pin 3.Sensor 3toMCU: Digital Pin 4.Sensor 4toMCU: Digital Pin 5.LED for Zone 1toMCU: Digital Pin 6, and so on for each zone.szocske23
copilot
- Microcontroller (MCU) with ample GPIO pins, I2C support, and enough memory or an interface for an external memory module. An MCU with more advanced capabilities compared to Arduino Uno, such as an ESP32, could be more suitable due to its built-in Wi-Fi module, higher processing power, and memory capacity.
- EEPROM or SD Card Module: To log the last 50 activities. EEPROM can be simple for smaller data logs, but an SD card could provide much more space for detailed logs.
- I2C Interface for Communication: To connect to the main PC or a module with I2C capability that can be interfaced with the PC.
- 4 Fire Sensors: As initially planned.
- Indicator LEDs or a small OLED/LCD Screen: For basic indication or to show more detailed status directly on the device. An OLED/LCD can be beneficial for displaying detailed logs or statuses.
Design Logic:-
Sensor to MCU Connection:
- Similar to the initial design, each sensor connects to a distinct GPIO pin.
-
Memory Module:
- Interface the EEPROM/SD Card module with the MCU through SPI or I2C (depending on the module). Use this to record timestamps, sensor IDs, or statuses each time an activity is detected.
-
I2C Communication:
- Utilize the I2C interface for communication with the main PC. The MCU can act as an I2C slave device. Ensure the data structure sent over I2C can be easily parsed by the PC software for forwarding alerts via web/SMS.
-
Indication Mechanism:
- Use LEDs for simple active/inactive status indicators. For detailed interfacing or troubleshooting directly on the device, consider an OLED/LCD screen connected via SPI or I2C, displaying more detailed information.
-
Software Logic:
- Implement a logging mechanism that records each sensor activation with timestamps into the memory module.
- Program an I2C communication protocol that allows the PC to request the log data, and then the ESP32 sends the requested data back.
- Implement a mechanism to roll over the logs after 50 entries to ensure only the latest 50 activities are kept.
-
Interfacing with the PC:
- The PC needs software capable of initiating I2C communication with the MCU, reading log data, and parsing this data for web/SMS alerting. This might involve a dedicated application or script that interfaces with I2C and utilizes internet/SMS gateways.
Example Software Snippets: Data Logging (Pseudocode for MCU/ESP32): I2C Communication Handling (Pseudocode):szocske23
copilot
- 2 Push Buttons: One for muting the siren and another for resetting the system.
Modified Design:-
Button Connections:
- Connect each button to a separate GPIO pin on the MCU. You’ll also need pull-up or pull-down resistors to ensure stable button states unless you’re using internal pull-up/down resistors provided by the MCU.
- For the Mute Button, assume it's connected to
- For the Reset Button, assume it's connected to
-
Software Logic:
- Update your software to include debounced button press detection for both the mute and reset functionalities. Debouncing is essential to ensure that the button press is detected accurately without interference from the physical bouncing of the button contacts.
- When the mute button is pressed, disable the siren if it is currently active.
- When the reset button is pressed, clear any active alarms, reset the system to its initial state, and prepare to detect new activities.
Example Software Snippets (Arduino-like Pseudocode): Button Setup: Integration Notes:MCU: GPIO X.MCU: GPIO Y.szocske23
copilot
- Dual-Core Processor: Provides ample processing power to handle sensor data management, logging, and communication tasks smoothly.
- Rich Set of Peripherals: Includes numerous GPIO pins, I2C interfaces, SPI ports, and more, allowing for easy connection of sensors, buttons, memory modules, and displays.
- Integrated Wi-Fi and Bluetooth: This feature can be instrumental for future project enhancements, like direct web connectivity for SMS alerts or remote system status monitoring, without requiring a PC as an intermediary.
- Ample Memory: Offers sufficient RAM and flash memory for complex programs and temporary data storage. If more data storage space for logs is needed, interfacing with an external SD card is straightforward.
- Low Power Consumption Modes: Enables power-saving modes, which can be beneficial for battery-operated versions of the project.
STM32 Series (e.g., STM32F103C8T6 - Blue Pill)- Cortex-M3 Core: Good balance of processing power for handling data from multiple sensors and performing system control operations.
- Multiple Communication Interfaces: Includes I2C, SPI, USART, which are useful for interfacing with various peripherals and external modules.
- Moderate GPIO Count: While fewer than the ESP32, there are generally enough GPIOs for sensor inputs, buttons, and LEDs.
- External Memory Interface: For projects requiring more data storage than the internal flash and RAM offer, you can connect an external memory module.
- Energy Efficiency: The STM32 series is known for its efficiency, which is valuable for power-sensitive applications.
Making the Choiceszocske23
szocske23
szocske2
copilot
-
Optocoupler Selection: For interfacing with 24V signals, ensure the optocoupler you choose can handle the input side voltage. A common choice is the PC817, which is widely used and offers reliable performance.
-
Circuit Design:
- Input Side: Connect the anode of the optocoupler's LED to the 24V sensor output through a current-limiting resistor, and the cathode to the ground of the sensor's power supply.
- Output Side: Connect the transistor side of the optocoupler to a GPIO pin on the STM32. Typically, the collector connects through a pull-up resistor to 3.3V, and the emitter connects to the ground of the MCU's power supply. When the sensor is triggered, the optocoupler closes this circuit, pulling the GPIO pin to ground, which can be read as a LOW state by the MCU.
-
Current-Limiting Resistor Calculation for the LED side: To ensure you're within the safe operating range of the LED inside the optocoupler, calculate the resistor value using Ohm's law. Assuming a forward voltage of 1.2V for the LED and a forward current of 10mA, the resistor value can be calculated as follows:
R=IforwardVsource−Vforward=10mA24V−1.2V=2.28kΩ
A standard value of 2.2kΩ can be used.
Programming Pins for STM32F103C8T6:szocske2
copilot
szocske2
copilot
- VDD (3.3V Power Supply):
- Connect VDD pins (24 and 36) to a 3.3V supply. This supply should be stable and capable of providing sufficient current for the MCU and connected peripherals.
- Ground (GND):
- Connect VSS pins (23, 35, 47) to the ground of your power supply.
- Decoupling Capacitors:
- Place 0.1µF ceramic capacitors as close as possible between each VDD pin and ground to stabilize the power supply. Additionally, place a 10µF electrolytic capacitor near the power supply input for bulk decoupling.
Optocouplers for Sensor Input-
Sensor Side:
- Connect a current-limiting resistor (e.g., 2.2kΩ) in series with the anode (+) of the optocoupler's LED.
- Connect the other end of the resistor to the 24V sensor output.
- Connect the cathode (-) of the optocoupler's LED to the sensor's ground.
-
MCU Side:
- Connect the collector of the optocoupler's transistor to a GPIO pin on the STM32 (e.g., PA0 for Zone 1).
- Connect the emitter of the optocoupler's transistor to the MCU's ground.
- Optionally, connect a pull-up resistor (4.7kΩ to 10kΩ) between this GPIO pin and the MCU's 3.3V supply, if your MCU configuration does not enable internal pull-ups.
Programming Interface (SWD)- SWDIO: Connect to pin 34 (PA13).
- SWCLK: Connect to pin 37 (PA14).
- NRST: Connect to pin 7 for resetting the device; optional but recommended for debugging.
- GND: Connect the programmer's GND to the MCU’s ground.
- 3.3V (Optional): Some programmers provide 3.3V output to power the target MCU during programming. This can be connected to VDD if needed, but be sure not to double-power the MCU if it's already connected to a separate power supply.
Additional Considerationsszocske2
copilot
- Normal State: In the absence of fire, conventional detectors usually maintain a nominal, low current level on the circuit. This current is monitored by the Fire Alarm Control Panel (FACP) to ensure the circuit's integrity and the detector's operational state.
- Alarm State: When fire is detected, the device alters the current flowing through the circuit. This can be achieved by the detector effectively short-circuiting itself or changing its internal resistance, causing a substantial increase in current flow. The FACP continuously monitors the current and interprets any significant deviation from the nominal level (either an increase or a decrease beyond predefined thresholds) as an alarm condition.
Voltage-Based Signaling- Normal State: The detectors are part of a loop with a specific end-of-line (EOL) resistor at the far end, determining a known voltage drop across the circuit when it's in its normal state.
- Alarm State: Upon detecting fire conditions, the detector modifies the circuit, often by introducing an additional resistance or by shorting, which changes the voltage drop across the loop. This change is detected by the FACP as an alarm condition.
Digital or Analog Signalingszocske2
copilot
-
Sensor Side:
- Each sensor is part of a zone circuit operating at 24V.
- Place an end-of-line (EOL) resistor at the last detector of each zone to maintain a known voltage level during normal operation.
- The sensor alters the voltage across this EOL resistor when an alarm condition is detected.
-
Optocoupler Interface:
- The anode of the optocoupler LED connects through a current-limiting resistor to a point in the circuit where the voltage change occurs during an alarm. For a voltage-based sensor circuit, this is typically on the detector side of the EOL resistor.
- The cathode of the optocoupler LED connects to the circuit's ground.
-
MCU Side:
- The collector of the optocoupler transistor goes to a GPIO pin configured as an input.
- The emitter goes to the MCU ground.
- Ensure the GPIO pin is configured with an internal pull-up resistor or connect an external pull-up resistor (e.g., 10kΩ) to 3.3V. This configuration allows the pin to register a logic HIGH when no alarm is present and fall to logic LOW when the optocoupler is activated by an alarm condition.
Example Connections for a Zone:- Alarm Condition Detection:
- When the smoke detector in any zone is triggered, the voltage change will cause the optocoupler's LED to activate, turning on the transistor side, and pulling the associated GPIO pin to LOW. The MCU will interpret this state change as an alarm condition from the respective zone.
Programming the MCU:-
Configure GPIO Pins:
- Initialize the designated GPIO pins connected to the optocouplers as digital inputs. Set them to use internal pull-up resistors if available.
-
Polling or Interrupts:
- Polling: Regularly check the state of each GPIO pin to detect if any have transitioned to LOW, indicating an alarm.
- Interrupts: Configure interrupts on the falling edge for the GPIO pins. The MCU will execute an interrupt service routine (ISR) when a pin goes LOW, facilitating immediate response to an alarm condition.
Final Notes:szocske2
copilot
-
24V Power Supply Input (J5):
- Connect the positive terminal of your 24V power source to J5, which will distribute power to each zone's sensors and optocouplers.
- The negative terminal of your 24V source should be connected to the common ground that also ties to the STM32F103C8T6 GND and the ground of each optocoupler.
-
Zones (J1 to J4) - Sensor Side:
- For each zone's terminal (J1 to J4), connect one terminal to the anode of the optocoupler's LED through a current-limiting resistor. This point will interface with the positive side of the sensor output in that zone.
- Connect the other terminal directly to the common ground. This will interface with the negative side of the sensor output.
-
Optocouplers:
- The anode of each optocoupler should connect through a current-limiting resistor to its respective zone's positive sensor output (as mentioned, this could be done via J1 to J4). The exact value of each resistor depends on the optocoupler's LED forward voltage and desired current but is generally calculated to limit the current to a safe value for the LED given a 24V supply.
- The cathode of each optocoupler connects to the common ground.
-
Optocouplers to STM32F103C8T6:
- The collector of each optocoupler's transistor side connects to a GPIO pin on the STM32F103C8T6 designated for that zone.
- The emitter of each optocoupler connects to the MCU's ground.
- Optionally, connect pull-up resistors (around 10kΩ) from the GPIO pins to 3.3V if the MCU's internal pull-ups are not used. This ensures the GPIO pins are HIGH by default and go LOW when the optocoupler is triggered.
Verification Checklist:szocske2