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

Explain project
Write a project description
Find schematic issues
Create a test plan
Simulate a circuit
Prepare for Manufacturing
Component Selection Workflow
New Subsystem Wizard

Ready.


Hi , I want to design a 4zone 1 sounder conventional fire system

size of the resistor for PC817XI LED through a current-limiting
2y
The conventional fire detector , what kind of signal will send when is alarmed?
2y
@copilot Hi , I want to design a 4zone 1 sounder conventional fire system
2y
Hello! Designing a 4-zone, 1 sounder conventional fire alarm system is a great project. Let's go through the basic components you'll need and how you might want to connect them. For simplicity, I'll assume you're using conventional fire alarm panels, smoke detectors, heat detectors, manual call points, and a sounder. Here's an outline to get started:
Components Needed:
  • 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:
  1. 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 Smoke Detector Zone 1 to Manual Call Point Zone 1, then end the zone with EOLR, then back to the FACP Zone 1 input.
  2. 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 Sounder: + to FACP: Sounder Output +, and Sounder: - to FACP: Sounder Output -.
  3. 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:
  • You might need additional components like relays or battery backup, depending on specific requirements.
  • Ensure all connections conform to the requirements of the fire detection and alarm system standards applicable in your area.
Remember, this is a simplified overview. Your project might have specific needs or requirements, especially regarding the types of detectors, their placements, and local building codes. Start by fleshing out the schematic in Flux for each zone and the control panel connections. If you have any specific components in mind or need further details on wiring specifics, feel free to ask!
2y
I want to design the control panel , I will just use 4 sensor , in a small wending machine , but I want to know each zone separately.
2y
Designing a control panel for a small vending machine with 4 sensors, where each sensor represents a separate zone, is a focused and practical project. I'll guide you through designing a simplified version of such a control panel, assuming the sensors are for fire detection (smoke or heat sensors). We'll need to set up the system so that the control panel can identify which zone (sensor) has been triggered.
Components:
  • 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:
  1. 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.
  2. Sensor Connection:
    • Assign each sensor to a dedicated GPIO pin on the MCU as an input.
    • Example connection setup:
      • Connect Sensor 1 to MCU: Digital Pin 2.
      • Connect Sensor 2 to MCU: Digital Pin 3.
      • Connect Sensor 3 to MCU: Digital Pin 4.
      • Connect Sensor 4 to MCU: Digital Pin 5.
    • Note: Ensure each sensor's output is compatible with the MCU's input voltage levels.
  3. Indicator/Display Connection:
    • For LEDs: Assign an LED to each sensor to indicate activation.
      • Connect LED for Zone 1 to MCU: Digital Pin 6, and so on for each zone.
    • For Displays: Utilize SPI or I2C interface to connect an LCD/OLED display to show the activated zone(s).
  4. 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.
  5. 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):

C


void setup() {
  // Initialize sensor input pins
  pinMode(2, INPUT);
  pinMode(3, INPUT);
  pinMode(4, INPUT);
  pinMode(5, INPUT);

  // Initialize LED output pins
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
}

void loop() {
  // Read each sensor and activate corresponding LED if triggered
  if(digitalRead(2) == HIGH) digitalWrite(6, HIGH);
  if(digitalRead(3) == HIGH) digitalWrite(7, HIGH);
  if(digitalRead(4) == HIGH) digitalWrite(8, HIGH);
  if(digitalRead(5) == HIGH) digitalWrite(9, HIGH);

  // Add delay to prevent bouncing
  delay(100);
}
This is a very basic setup to get you started. Depending on the specific sensors and additional functionalities you require (e.g., network connectivity, advanced monitoring, etc.), you might need to expand the design. For a detailed project like this, it's crucial to layout the schematic and PCB design in Flux, ensuring all connections and components are accurately represented for prototyping and production.
2y
, I want to have a memory for last 50 activity , probably led-s are fine ,because I want to connect to main pc , with i2c , and that will send the alert via web/sms.
2y
Incorporating memory for the last 50 activities and opting for LEDs might be an oversimplification for indicating events, especially when you intend to interface with a main PC via I2C for web/SMS alerts. For a robust approach, let's refine the design to use a memory module and I2C for communication while maintaining straightforward indications for recent activities.
Revised Components:
  • 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:
  1. Sensor to MCU Connection:
    • Similar to the initial design, each sensor connects to a distinct GPIO pin.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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):

C


// Log event example
void logEvent(int sensorId) {
  // Retrieve current time (implement RTC or use NTP for ESP32)
  // Write sensorId and timestamp to EEPROM/SD card
}

// Manage log size to keep the latest 50 entries
void manageLogSize() {
  // Implement logic to check log size
  // If exceeding limits, delete the oldest entry
}
I2C Communication Handling (Pseudocode):

C


void setup() {
  // Initialize I2C as slave
}

void loop() {
  // Check for I2C request from PC
  // On request, send the latest log data
}
This design assumes a moderate level of complexity with data logging and communication, aiming for a balance between functionality and simplicity. Depending on your specific requirements, such as the amount of detail needed for each log entry or the complexity of the web/SMS alerting mechanism, further adjustments might be necessary.
2y
And probably a button , for mute ing the siren , and a button for reseting the system
2y
Adding buttons for muting the siren and resetting the system is a practical feature for any fire detection system. These functionalities will improve user interaction and control over the system. Here’s how you can integrate these features into your existing design:
Additional Components:
  • 2 Push Buttons: One for muting the siren and another for resetting the system.
Modified Design:
  1. 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 MCU: GPIO X.
    • For the Reset Button, assume it's connected to MCU: GPIO Y.
  2. 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:

C


void setup() {
  pinMode(X, INPUT_PULLUP); // Mute Button
  pinMode(Y, INPUT_PULLUP); // Reset Button
  
  // Other setup code...
}

void loop() {
  checkButtons();
  
  // Rest of your loop code...
}

void checkButtons() {
  static unsigned long lastDebounceTimeMute = 0;
  static unsigned long lastDebounceTimeReset = 0;
  unsigned long debounceDelay = 50; // 50ms debounce time
  
  // Check the mute button
  if ((millis() - lastDebounceTimeMute) > debounceDelay) {
    if (digitalRead(X) == LOW) { // Assuming LOW when pressed
      muteSiren();
      lastDebounceTimeMute = millis();
    }
  }
  
  // Check the reset button
  if ((millis() - lastDebounceTimeReset) > debounceDelay) {
    if (digitalRead(Y) == LOW) { // Assuming LOW when pressed
      resetSystem();
      lastDebounceTimeReset = millis();
    }
  }
}

void muteSiren() {
  // Implement siren muting logic
}

void resetSystem() {
  // Implement system reset logic
}
Integration Notes:
  • Mute Siren: Implement respective logic to mute or disable the siren sound. This could involve setting a GPIO pin LOW that controls a relay or transistor switch for the siren.
  • Reset System: This should include clearing any logs representing active alarms, resetting detection states, and possibly sending a status update over I2C to notify the PC of the system reset.
These functions greatly enhance the usability of your system, giving operators immediate control over alarm conditions and system status. Remember, when laying out the schematic and PCB in Flux, allocate space and clear labeling for these buttons to ensure they are easily accessible and identifiable in the final design.
2y
what can be the best mcu for this?
2y
Selecting the best microcontroller (MCU) for your project involves considering factors such as available GPIO pins, communication interfaces (like I2C), memory capacity (both for program storage and data logging), as well as additional features like integrated Wi-Fi or Ethernet for web connectivity. Given your project's requirements — handling sensor inputs, managing a memory log for the last 50 activities, interfacing with a PC via I2C, driving indicators, and accommodating user input buttons — here are two recommendations:
ESP32
The ESP32 is a powerful MCU with the following features that make it ideal for your project:
  • 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)
The STM32 series offers a wide range of MCUs with capabilities that fit various needs. The STM32F103C8T6, often referred to as the "Blue Pill," provides a budget-friendly option with good features:
  • 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 Choice
  • For Connectivity and Complex Applications: Choose the ESP32. Its integrated Wi-Fi, higher RAM, and processing power make it suitable for comprehensive projects where future expansions into web connectivity or Bluetooth features might be considered.
  • For Simplicity and Cost-Effectiveness: The STM32F103C8T6 (Blue Pill) is a strong candidate. It offers the necessary features at a lower cost, with the trade-off being the need for external modules for Wi-Fi connectivity and potentially a slightly more involved development environment setup.
Before deciding, also consider the development environment (Arduino IDE is supported by both but with different levels of native support and community libraries), project cost constraints, and your familiarity with the platform. The ESP32, with its broad community support and integrated connectivity options, can offer more flexibility for future project enhancements, making it an excellent choice for projects that might evolve over time.
2y
the STM32F103C8T6 sounds better , I will use that , the sensor are working with 24 volt I need for each zone an optocuplor. And some programming pins for uploading the software
2y
szocske23 szocske23 the STM32F103C8T6 sounds better , I will use that , the sensor are working with 24 volt I need for each zone an optocuplor. And some programming pins for uploading the software
2y
the STM32F103C8T6 sounds better , I will use that , the sensor are working with 24 volt I need for each zone an optocuplor. And some programming pins for uploading the software
2y
Choosing the STM32F103C8T6 for your project is a solid choice, especially for applications requiring interfacing with higher voltage levels like your 24V sensors. Using optocouplers (optoisolators) for each zone is a wise decision for electrical isolation, enhancing the system's safety and durability. Let's outline the integration of optocouplers and the necessary programming interface for the STM32F103C8T6.
Integrating Optocouplers with 24V Sensors:
Since your sensors operate at 24V and the STM32F103C8T6 runs at a lower voltage (typically 3.3V), optocouplers are crucial for safely interfacing these components.
  • 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=VsourceVforwardIforward=24V1.2V10mA=2.28kΩR = \frac{V_{source} - V_{forward}}{I_{forward}} = \frac{24V - 1.2V}{10mA} = 2.28k\Omega
    A standard value of 2.2kΩ can be used.
Programming Pins for STM32F103C8T6:
For programming the STM32F103C8T6, you'll typically use its serial wire debug (SWD) interface. The essential pins for this purpose are:
  • SWDIO: Serial Wire Debug Data I/O
  • SWCLK: Serial Wire Debug Clock
  • NRST: Optional but recommended for resetting the device during programming.
  • VDD and GND: Power supply connections are necessary for powering the MCU during programming.
Connecting these pins to an ST-Link programmer (or a similar device) allows for programming and debugging the STM32F103C8T6. The ST-Link is widely supported by development environments like the STM32CubeIDE or Arduino IDE (with additional stm32duino bootloader).
Final Notes:
  • Make sure to integrate debouncing (either in hardware or software) for the input from the optocouplers. Electrical noise from the sensor activation could lead to false triggering without proper debouncing.
  • When designing your PCB or breadboard layout, keep the high voltage parts physically separated from the low voltage MCU and its peripherals for safety and to minimize interference.
  • Before finalizing the design, check the datasheets for your specific sensors, optocouplers, and the STM32F103C8T6 to ensure all voltage levels, current ratings, and other specifications match your requirements.
With careful design and attention to these aspects, your project should successfully integrate the 24V sensors with the chosen STM32 MCU, achieving reliable performance and system safety.
2y
I placed STM32F103C8T6 how to wire up?
2y
Something went wrong, sorry. Please try again.
2y
I placed STM32F103C8T6 how to wire up?
2y
Wiring up an STM32F103C8T6, especially for a project with specific requirements like yours including 24V sensors interfaced through optocouplers, involves several key steps. Here's a general guide on how to wire up the essentials for programming and interfacing the sensors via optocouplers, including necessary power connections.
Power Connections
  1. 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.
  2. Ground (GND):
    • Connect VSS pins (23, 35, 47) to the ground of your power supply.
  3. 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
Assuming you're using optocouplers like the PC817, an example connection for one sensor zone would be:
  1. 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.
  2. 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)
For programming and debugging the STM32F103C8T6, use the following connections to an ST-Link or similar SWD programmer:
  1. SWDIO: Connect to pin 34 (PA13).
  2. SWCLK: Connect to pin 37 (PA14).
  3. NRST: Connect to pin 7 for resetting the device; optional but recommended for debugging.
  4. GND: Connect the programmer's GND to the MCU’s ground.
  5. 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 Considerations
  • Add a Boot Mode Selection Mechanism: The STM32F103C8T6 enters different boot modes depending on the state of BOOT0 (pin 44). Connect BOOT0 to GND for normal execution from Flash memory, or to 3.3V (through a resistor) for system memory boot mode, useful for internal bootloaders and programming.
  • User Buttons: For your mute and reset buttons, connect one side to a GPIO pin and the other side to GND. Configure the GPIO pins with internal or external pull-up resistors to ensure they read HIGH when not pressed and go LOW when pressed.
This setup provides a basic framework for your project. Depending on other peripherals or specific features you intend to implement, additional connections and configurations may be required. Always refer to the STM32F103C8T6's datasheet and reference manual for detailed pin descriptions and electrical characteristics to ensure proper operation.
2y
The conventional fire detector , what kind of signal will send when is alarmed?
2y
Conventional fire detectors generally work within a fire alarm system by closing or opening an electrical circuit when they detect signs of a fire, such as smoke or heat. The specific type of signal a conventional fire detector sends when alarmed depends on its design and the system it's integrated with. Here are the two most common signaling methods used by conventional fire detectors:
Current-Based Signaling
  • 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 Signaling
While conventional systems are typically simpler and operate based on the principles mentioned above, it's worth noting that more advanced systems can use digital or analog signaling to communicate specific states or even diagnostic information back to the control panel. However, these features are more common in addressable systems rather than conventional ones.
Alarm Indication
The alarm signal from a conventional detector typically prompts the FACP to activate audio-visual alarm indicators, notify relevant authorities, and possibly trigger other fire response mechanisms such as fire suppression systems.
Integration Note
When integrating conventional fire detectors into your project using the STM32F103C8T6 and optocouplers for isolation, consider the signaling method used by your detectors. For current-based detectors, you may need to design a circuit that allows the MCU to measure current changes accurately. For voltage-based detectors, an analog input capable of detecting voltage changes or variations could be used. Ensure that your design can safely interface with the 24V operational voltage commonly used in fire detection systems, and that any alterations in the monitored parameters (current or voltage) can effectively be translated into detectable digital signals by your MCU.
2y
Then how can I set up the zones on the mcu , for Voltage-Based Signaling ,Knowing my smoke sensor (Teknim, TFD-4250) works with 24v ,
2y
For integrating voltage-based signaling from your Teknim TFD-4250 smoke sensors operating at 24V with the STM32F103C8T6 MCU, the primary goal is to safely interface the high-voltage signals with the MCU's 3.3V logic. Given the voltage disparity, voltage dividers or optocouplers can be used for level shifting. However, since your setup already includes optocouplers for isolation, I'll focus on utilizing them efficiently for this purpose.
Using Optocouplers for Voltage-Based Signaling:
Optocouplers can be used to safely interface the 24V alarm signals from your sensors with the 3.3V inputs of the STM32F103C8T6. When the smoke detector triggers an alarm, it changes the voltage in the circuit. This change can be detected through an optocoupler, effectively translating the 24V signal to a 3.3V logic level compatible with the MCU.
Circuit Design:
  1. 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.
  2. 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.
  3. 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:
  1. 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.
  2. 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.

C


void setup() {
    pinMode(GPIO_Zone1, INPUT_PULLUP); // GPIO setup for Zone 1
    pinMode(GPIO_Zone2, INPUT_PULLUP); // Repeat for each zone
    // Configure interrupts or polling here
}

void loop() {
    // Example polling method
    if (digitalRead(GPIO_Zone1) == LOW) {
        // Handle alarm condition for Zone 1
    }
    // Repeat for other zones
}
Final Notes:
  • Make sure the current-limiting resistor for the optocoupler's LED side is chosen to limit the LED current safely within its specifications, taking into account the maximum voltage in alarm conditions.
  • Always refer to the datasheets for specific component ratings and the smoke detector manual for detailed information on the alarm signaling characteristics. This will ensure that your interfacing circuit correctly interprets the signals from your fire detection zones.
2y
I added the optocuplors and 4 screw terminal (J1-4) for each zone , and a screw terminal for 24v-input (J5). Is the wearing correct?
2y
To provide an accurate assessment of the wiring based on your description of adding optocouplers for each zone (J1 to J4) and a screw terminal for the 24V input (J5), I'll outline the general connection strategy that should be followed. Since I cannot see your actual wiring or schematic, this guidance is theoretical and based on standard practices for interfacing 24V sensors via optocouplers to an MCU like the STM32F103C8T6. Please adjust the connections according to your specific components and layout.
General Wiring Strategy:
  1. 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.
  2. 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.
  3. 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.
  4. 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:
  • Verify Polarity of Connections: Ensure that the 24V and ground connections are correctly oriented, especially the 24V supply to the current-limiting resistors leading to the optocouplers' LEDs.
  • Current-Limiting Resistor Values: Double-check the values of the current-limiting resistors for each optocoupler's LED to ensure they are appropriate for 24V operation.
  • Common Ground: Confirm that the ground of the 24V supply, the ground side of each sensor output, the optocouplers, and the STM32F103C8T6's ground are all properly interconnected.
  • GPIO Configuration: Make sure the GPIO pins connected to the optocouplers on the STM32F103C8T6 are correctly configured as inputs with pull-ups enabled (either internally or externally).
  • Optocoupler Orientation: Ensure that the optocouplers are oriented correctly to function as intended when the sensors activate.
Without a specific schematic or detailed wiring layout, these guidelines are meant to provide a general review checklist. If you're encountering issues or need more detailed assistance, please provide more specifics about your wiring setup or the challenges you're facing.
2y
size of the resistor for PC817XI LED through a current-limiting
2y
Someone is typing...
1
U1


  • Ground
    A common return path for electric current. Commonly known as ground.
  • Net Portal
    Wirelessly connects nets on schematic. Used to organize schematics and separate functional blocks. To wirelessly connect net portals, give them same designator. #portal
  • Power Net Portal
    Wirelessly connects power nets on schematic. Identical to the net portal, but with a power symbol. Used to organize schematics and separate functional blocks. To wirelessly connect power net portals, give them the same designator. #portal #power
  • Generic Resistor
    A generic fixed resistor for rapid developing circuit topology. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard resistor values: 1.0Ω 10Ω 100Ω 1.0kΩ 10kΩ 100kΩ 1.0MΩ 1.1Ω 11Ω 110Ω 1.1kΩ 11kΩ 110kΩ 1.1MΩ 1.2Ω 12Ω 120Ω 1.2kΩ 12kΩ 120kΩ 1.2MΩ 1.3Ω 13Ω 130Ω 1.3kΩ 13kΩ 130kΩ 1.3MΩ 1.5Ω 15Ω 150Ω 1.5kΩ 15kΩ 150kΩ 1.5MΩ 1.6Ω 16Ω 160Ω 1.6kΩ 16kΩ 160kΩ 1.6MΩ 1.8Ω 18Ω 180Ω 1.8KΩ 18kΩ 180kΩ 1.8MΩ 2.0Ω 20Ω 200Ω 2.0kΩ 20kΩ 200kΩ 2.0MΩ 2.2Ω 22Ω 220Ω 2.2kΩ 22kΩ 220kΩ 2.2MΩ 2.4Ω 24Ω 240Ω 2.4kΩ 24kΩ 240kΩ 2.4MΩ 2.7Ω 27Ω 270Ω 2.7kΩ 27kΩ 270kΩ 2.7MΩ 3.0Ω 30Ω 300Ω 3.0KΩ 30KΩ 300KΩ 3.0MΩ 3.3Ω 33Ω 330Ω 3.3kΩ 33kΩ 330kΩ 3.3MΩ 3.6Ω 36Ω 360Ω 3.6kΩ 36kΩ 360kΩ 3.6MΩ 3.9Ω 39Ω 390Ω 3.9kΩ 39kΩ 390kΩ 3.9MΩ 4.3Ω 43Ω 430Ω 4.3kΩ 43KΩ 430KΩ 4.3MΩ 4.7Ω 47Ω 470Ω 4.7kΩ 47kΩ 470kΩ 4.7MΩ 5.1Ω 51Ω 510Ω 5.1kΩ 51kΩ 510kΩ 5.1MΩ 5.6Ω 56Ω 560Ω 5.6kΩ 56kΩ 560kΩ 5.6MΩ 6.2Ω 62Ω 620Ω 6.2kΩ 62KΩ 620KΩ 6.2MΩ 6.8Ω 68Ω 680Ω 6.8kΩ 68kΩ 680kΩ 6.8MΩ 7.5Ω 75Ω 750Ω 7.5kΩ 75kΩ 750kΩ 7.5MΩ 8.2Ω 82Ω 820Ω 8.2kΩ 82kΩ 820kΩ 8.2MΩ 9.1Ω 91Ω 910Ω 9.1kΩ 91kΩ 910kΩ 9.1MΩ #generics #CommonPartsLibrary
  • Generic Capacitor
    A generic fixed capacitor ideal for rapid circuit topology development. You can choose between polarized and non-polarized types, its symbol and the footprint will automatically adapt based on your selection. Supported options include standard SMD sizes for ceramic capacitors (e.g., 0402, 0603, 0805), SMD sizes for aluminum electrolytic capacitors, and through-hole footprints for polarized capacitors. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard capacitor values: 1.0pF 10pF 100pF 1000pF 0.01uF 0.1uF 1.0uF 10uF 100uF 1000uF 10,000uF 1.1pF 11pF 110pF 1100pF 1.2pF 12pF 120pF 1200pF 1.3pF 13pF 130pF 1300pF 1.5pF 15pF 150pF 1500pF 0.015uF 0.15uF 1.5uF 15uF 150uF 1500uF 1.6pF 16pF 160pF 1600pF 1.8pF 18pF 180pF 1800pF 2.0pF 20pF 200pF 2000pF 2.2pF 22pF 20pF 2200pF 0.022uF 0.22uF 2.2uF 22uF 220uF 2200uF 2.4pF 24pF 240pF 2400pF 2.7pF 27pF 270pF 2700pF 3.0pF 30pF 300pF 3000pF 3.3pF 33pF 330pF 3300pF 0.033uF 0.33uF 3.3uF 33uF 330uF 3300uF 3.6pF 36pF 360pF 3600pF 3.9pF 39pF 390pF 3900pF 4.3pF 43pF 430pF 4300pF 4.7pF 47pF 470pF 4700pF 0.047uF 0.47uF 4.7uF 47uF 470uF 4700uF 5.1pF 51pF 510pF 5100pF 5.6pF 56pF 560pF 5600pF 6.2pF 62pF 620pF 6200pF 6.8pF 68pF 680pF 6800pF 0.068uF 0.68uF 6.8uF 68uF 680uF 6800uF 7.5pF 75pF 750pF 7500pF 8.2pF 82pF 820pF 8200pF 9.1pF 91pF 910pF 9100pF #generics #CommonPartsLibrary
  • Generic Inductor
    A generic fixed inductor for rapid developing circuit topology. *You can now change the footprint and 3D model at the top level anytime you want. This is the power of #generics
  • Terminal
    Terminal
    An electrical connector acting as reusable interface to a conductor and creating a point where external circuits can be connected.
  • RMCF0805JT47K0
    47 kOhms ±5% 0.125W, 1/8W Chip Resistor 0805 (2012 Metric) Automotive AEC-Q200 Thick Film #forLedBlink
  • 875105359001
    10uF Capacitor Aluminum Polymer 20% 16V SMD 5x5.3mm #forLedBlink #commonpartslibrary #capacitor #aluminumpolymer #radialcan
  • CTL1206FYW1T
    Yellow 595nm LED Indication - Discrete 1.7V 1206 (3216 Metric) #forLedBlink
Balanced Beige Interocitor thumbnail
Welcome to your new project. Imagine what you can build here.

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