power supply How do I select the accompanying components for an optocoupler
6,749
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.
An AC mains operated single LED flasher circuit is designed using the widely used CMOS timer chip TLC555. The entire circuit is powered directly by the grid supply of 230VAC through a capacitive potential divider and associated components.
This LED...
For its maximum result, the final stage of the amplifier should have the proper power supply, as the flowing currents are very high. A Class A amplifier requires attention. These are the rules for the power supply for the...
This device has a quiescent power drain of 24 milliwatts when operating from a 6 V supply, making the LM386 ideal for battery operation. According to the application hints section of the LM386 datasheet, two pins (1 and 8)...
The circuit principle involves using a current transformer for current sensing due to the large AC power load of computers. This setup detects whether there is current in the power line, enabling the determination of its status. The LM393...
Adjustable Regulated Power Supply 0-15V 1A. The output voltage is stabilized and regulated in the range of 0V to 15V, with a maximum current supply of 1A. The schematic diagram originates from the circuit: Adjustable Regulated Power Supply 0-15V...
Currently, a basic MOSFET amplifier or power amplifier is designed to deliver an output power of ±100 Watts RMS with an 8 Ohm load, or ±160 Watts RMS with a 4 Ohm load. The simplicity of this circuit results...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more