A 4-way IoT switch designed based on the lighting platform, supports Xiaoai, Baidu Xiaodu, Tmall Elf, and voice control. The circuit board size is about 60X52CM and can be placed in the switch box to turn ordinary lights into smart switches while retaining the physical switch. . You can also use physical switches as limit switches to transform smart curtains (but you have to put more effort into the hardware), etc. Personally, I feel that ordinary equipment and home appliances can be made intelligent by using the IoT module to control the high and low levels of the pins and adding a peripheral amplifier circuit to control the device switch.
This solicitation is for courses. I study electronics as a personal hobby and have no foundation. What I want to share this time is the circuit application of triode tubes for switches and optocoupler isolation circuits. Therefore, NPN transistors and PNP transistors are used on the two relays to draw the control circuit, but their control results are the same. The two circuits in this figure use the same power supply for common ground isolation. The voltage at point A in the previous circuit is opposite to the level of the control signal (because the control signal is low level and the photocoupler does not conduct. The voltage at point A is Pulled to high level, when the control signal is high level, point A is low level. The reason is that the current always flows to low potential .) The resistor on the left side of point A in the figure acts as a load when the optocoupler is turned on, and the one on the right side acts as a load. Current limiting and partial pressure function.
The picture above uses two power supplies to achieve complete isolation of the circuit. The levels of the two circuits are consistent with the diagram above. And the optocoupler also has the function of amplifying the control signal. Optocouplers have many advantages. The main performance advantage is that they can realize one-way signal transmission. In optocouplers, the input and output ends can be completely electrically isolated and have relatively strong anti-interference ability. Higher efficiency. Currently, in the design and development process of single-chip switching power supplies, optocouplers have been widely used and recognized. The optocoupler feedback circuit composed of optocouplers can change the duty cycle by adjusting the control terminal current, thereby achieving precision and stability. pressure.
The common ground optocoupler isolates the PNP transistor. In this figure, the PNP transistor directly controls the on and off of the power supply, because the current of the PNP flows from the emitter to the base and collector. If the PNP transistor is placed on the load The control signal of the downstream base will be affected by the load, which may even cause it to not work properly.
If you have time, take a few minutes to watch Teacher Han explain the application of transistors in circuits. The teacher explains it in more detail.
Since the design is to be placed in the switch cassette, only two relays are placed on the board and the other two are external relays that lead to the IO port. It also has an external burning port for use when changing programs.
As for the program, I have just come into contact with it. The uploaded program is personally used with a circuit built on a development board, and it is currently in good condition when connected to Xiaodu. Moreover, most of the programs have Chinese comments, which should be easier to understand.
Finally, friends who want to learn can follow this link to learn about and use the example tutorials of Dian Deng Technology ! !
There are two external interfaces, two relays and a Hailink power module on the back of the circuit board. Too much washing water has ruined the silk screen of the power module!
front!
Homemade 4-way switch panel for debugging!
When the board is burning the program, the board burning port and the connection of the writer
3.3V ------ 3.3V
G ------ GND
TX ------ RX
RX ------ TX
For details, you can follow the link recommended below to learn a very detailed graphic tutorial.
In addition, I recommend a mature ESP8266 01S development board with a 4-voice platform. Tutorials and programs from Yangyangxue Programming
In the video, I forgot to introduce that the 4 buttons in the APP can also control the device! My personal level is limited, so I would like to ask the passing experts to give me some advice and help me optimize the program. Thank you! ! !
Connect to 220V and build light and fan control circuits!
The construction is completed and the fan power cord is connected with the quick connector! Please see the 3rd video for the actual effect! !
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet