power supply How do I select the accompanying components for an optocoupler
Description: The circuit utilizes an optocoupler (MOC3021) to detect the On/Off state of an electrical appliance using a microcontroller (ATmega16L). The mains supply specifications are 230V, 50Hz. The design aims to determine whether the load is active or inactive. The output pin from the optocoupler connects to an external interrupt of the ATmega16L microcontroller, which monitors the load state. Following this, a relay, acting as a control mechanism, allows for toggling the load state. Resistor values for R1, R2, and Rc are being calculated, considering the microcontroller's voltage levels: VIL(max) = 0.2 x Vcc = 660mV, VIH(min) = 0.6 x Vcc = 1.98V, and VIH(max) = Vcc + 0.5 = 3.8V. When the transistor in the optocoupler is not conducting, the output is high (3.3V), and when it conducts, the output is low. Therefore, a high output indicates the load is off, while a low output indicates it is on. Using the SFH621A-3 datasheet, with a minimum CTR of 34% at IF = 1mA, the output at 1mA input will be 340µA. To ensure the microcontroller detects low voltage, a resistor value of 1kΩ is proposed, resulting in an output voltage of 340mV, which is below VIL(max). The objective is to keep the LEDs ON for a maximum duration of 10ms (20ms full period at 50Hz). To achieve 90% ON time, the LEDs require at least 1mA of current for 9ms in a 10ms half period. The calculated resistance for R1 is approximately 46.1kΩ, with a chosen value of 39kΩ. This smaller resistance will increase the current through the diodes beyond 1mA. The initial CTR of 34% indicates an output of 340µA from 1mA input, but with added resistors, the output current will be slightly higher. Concerns arise regarding maintaining a voltage drop below 500mV at the optocoupler output.
The circuit design incorporates an optocoupler (MOC3021) to isolate the high-voltage AC mains supply from the low-voltage microcontroller circuit. The MOC3021 is specifically chosen for its ability to drive a triac, which is essential for controlling AC loads. The circuit's operation is based on the principle of current transfer ratio (CTR), which defines the relationship between the input current through the optocoupler's LED and the output current through the phototransistor.
In the design, R1 is calculated to limit the current through the optocoupler's LED to approximately 1mA, ensuring proper activation of the phototransistor. The resistor value is critical, as it directly affects the CTR and, consequently, the output signal's reliability. The chosen resistance of 39kΩ for R1 will ensure that the LED operates efficiently within the specified range, while also accommodating variations in mains voltage.
R2 serves as a pull-up resistor connected to the output of the phototransistor. This resistor is essential for defining the high state of the output signal when the phototransistor is not conducting. The value of R2 should be selected with consideration to the voltage drop across it, ensuring that the output voltage remains above VIL(max) when the load is off. Adjusting R2 to a higher value, such as 10kΩ, may help achieve the desired low output voltage when the load is on.
The relay in the circuit acts as a switching device to control the load based on the microcontroller's output. The microcontroller will monitor the state of the load through an interrupt, enabling it to respond promptly to changes in the load state. The integration of these components allows for a robust and reliable method of sensing and controlling the state of an electrical appliance, ensuring safe operation while maintaining the necessary isolation between high and low voltage sections of the circuit.
Overall, careful selection of resistor values and understanding of the optocoupler's behavior in conjunction with the microcontroller's voltage thresholds are critical to the successful implementation of this circuit.Using an optocoupler ( MOC3021 ) to sense the On/Off state of an electrial appliance using a microcontroller ATmega16L. How do i go about doing this My mains supply specs are 230V, 50Hz. How do I design the surrounding circuit and select component values, like the resistors Referring to the above schematic.
The idea is to use this circuit to determine whether the load is on or off. The output pin from the optocoupler connects to an external interrupt of the Microcontroller I`m using which is ATmega16L. The interrupt will Monitor the state of the load. After monitoring I can toggle the state of the load using a relay (relay acts as a Control mechanism) which connects to the same microcontroller.
Now, I tried calculating the resistor values for R1, R2 and Rc. Note, microcontroller`s VIL(max) = 0. 2xVcc = 660mV and VIH(min) = 0. 6xVcc = 1. 98V and VIH(max) = Vcc+0. 5 = 3. 8V. To calculate Rc is quite easy. When the transistor is not conducting the output is high (at 3. 3V). When the transistor conducts the output is pulled low. so from microcontroller`s point of view, output high means load is switched OFF and output low means load is switched ON. Looking at the datasheet for SFH621A-3, using 34% minimum CTR at IF = 1mA. Therefore, at 1mA input, the output is going to be 340uA. So in order for the microcontroller to detect low voltage from the output of the optocoupler can I use resistor value of 1Kohm So that the output from the optocoupler will have a voltage of 340mV (which is below VIL(max) Aim: the aim is to keep the LEDs ON* for maximum period of time in a 10mS half period (20mS full period of 50Hz).
Lets say LEDs have to be ON for 90% of the time, that means LEDs require at least 1mA of current for 90% of the time for that half period which means LEDs will be active for 9mS in a 10mS half period. So, 9mS/10mS = 0. 9 * 180(half period) = 162 degrees. This shows the current will be 1mA between 9deg and 171deg (and less than 1mA from 0deg to 9deg and 171deg to 180deg).
Did not consider ON time to be 95% as working with whole numbers is neat and 5% doesn`t make any difference not in this application at least. So, R1 ‰¤ (47. 8V - 1. 65V) / 1mA = 46. 1 Kohms Choosing a value one smaller than 46. 1 Kohms of 39 Kohms (e12 series). Now that a smaller value resistance is chosen compared to what was calculated, means current through the diodes will be greater than 1mA.
Now, after all this the initial CTR was 34% which means 1mA in will be 340 µA out. But now because of 2x22 Kohm resistors the current will be slightly more on the output. That means higher potential across the pull up resistor Rc. Would there be an issue to get a volt drop below 500mV on the output of the optocoupler David, please add some information about yourself on your profile. Like Olin always says that`s not for you, that`s for us. It helps us to assess your level of knowledge so that we can answer appropriately. stevenvh Jun 3 `12 at 6:13 Re your edit: a 1k resistor will have 340 mV across it (Ohm`s Law). So the output voltage will still be 3. 3 V - 340 mV = 3 V. You have to go lower than VIL(max) if you want the uC to see it as a low. So increase the 1k, for instance to 10k. Then the voltage across the resistor will be 3. 4 V theoretically, but limited to the power supply, and the output will be 0 V. stevenvh Jun 13 `12 at 9:43 The MOC3021 is an optocoupler with a triac output. It`s used to drive a power triac typically to switch mains operated appliances. Triacs can only be used in AC circuits. The two LEDs in antiparallel ensure that the transistor is activated on both half cycles of the mains.
Many optocouplers only have 1 LED, that would work, but give you an output pulse of 10ms in a 20ms period for 50Hz. You would need to place a diode in antiparallel to the input also in that case, to protect the LED from overvoltage when reverse polarized.
To ensure that the USB and serial segments are electrically isolated, an optocoupler (U1) is employed. The LED section of U1 is directly driven by the Data Terminal Ready (DTR) signal, necessitating the selection of a highly sensitive optocoupler to...
This ring detector, utilizing a neon-LDR (light-dependent resistor) optocoupler, simplifies interfacing with telephone lines.
The ring detector circuit is designed to detect the ringing signal from telephone lines, which typically operates at a frequency of 20 Hz to 25 Hz with...
The circuit diagram illustrates a group of four analog electronic circuit switches (S1 to S4). Switches S1, S2, and S3 are utilized in a parallel delay circuit. When the power is activated, resistor R4 drives the triac VT, which directly...
This program includes circuit design CAD, simulation, and auto-routing PC layout. PSPICE is also utilized at Unisys, which offers more capabilities but costs six times as much and requires annual renewal. With these requirements and others in mind, a variation...
The circuit illustrated in Figure 2-48 consists of two configurations. Configuration 2-48 (a) operates using a 4.5V battery, while configuration 2-48 (b) employs AC capacitors to reduce the voltage supply. In configuration 2-48 (a), the delay time is influenced by...
A dual optocoupler is utilized in a configuration that maintains the same current across the LEDs. Assuming comparable optocoupler characteristics, the output voltage must match the non-inverting input voltage. Given that the operational amplifier operates within a closed loop, the...
Interfacing high power loads can be accomplished in various ways, including the use of voltage divider resistors, transformers, or optocouplers. The circuit illustrated below employs the optocoupler method. This optocoupler facilitates logic level translation with flexible input, accommodating a wide...
The 15V DC supply is derived from a nominal 230/24V center-tapped AC transformer (T1) and a full-wave rectifier (D5 & D6). A Zener diode (D4) is included to limit the DC voltage to a maximum of 15V. Triacs (D7, D8,...
Beige Bag Software has been offering affordable and innovative circuit design tools since 1990. B2 Spice provides schematics as well as analog, digital, and mixed-mode electronic circuit simulation. It integrates with EAGLE and CADSTAR PCB software.
B2 Spice is a powerful...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more