apogeeweb title
Home arrow Semiconductor Information

arrow left

arrow right

Jan 5 2018

Design scheme of intelligent energy saving plugs based on AVR

Warm hints: The word in this article is about 2800 and  reading time is about 15 minutes.


The standby energy consumption of computer external equipment (such as printer, scanner, stereo, etc.) not only increases consumer's daily electricity bill, but also wastes the power resources greatly. The design of computer socket using the host's start-up and shutdown to drive other devices on or off, make its interface equipment standby energy consumption is zero, can reduce the radiation produced by computer and its peripherals, to achieve energy saving and environmental protection effect; It also has the function of segmented timer switch. The smart socket can also be used as a common socket through functional conversion, without affecting the use of other devices.



I.Smart socket design

1.4 power circuit

III.Smart socket test

1.1 hardware structure of smart socket

1.5 Relay driver circuit

IV.Smart power outlet solutions

1.2 AVR microcontroller.

1.6 keyboard circuit

V.FiveTop Smart Outlets in Amazon in 2018

1.3 IC transducer

II.Smart plugs software design


I.Smart socket design

1.1 hardware structure of smart socket

The hardware structure of computer intelligent energy-saving socket is shown in the following picture. With mega 48 as the control core, the peripheral circuit is mainly composed of current sampling circuit, mode/number conversion reference voltage circuit, state display circuit, keyboard input circuit and real-time clock. The current sampling circuit is used to detect the running state and over-current protection of the computer. The number/mode conversion reference voltage circuit provides reference for sampling current. The status display circuit indicates the current state of the socket; The keyboard input realizes the switching between the normal socket and the smart socket, sets the critical current value of the standby machine, and sets the time point of the section switch. Mainframe computer running state through the current transformer test host interface, over-current protection by another transformer detection, when the current is greater than the rated current must be time to cut off the control power supply socket, foreign protection. Since the induction current of the transformer is small, the reference voltage is higher in the number/mode conversion process. The design USES the band-gap constant voltage source TL431 as the reference voltage for A/D transformation. The standby current of different computer hosts may be different, so the external keyboard can be used as the critical value of the standby current, and the socket can be used as a normal socket. The RTC clock is composed of PCF8563.

the struture of smart plug--Design scheme of intelligent energy saving plugs based on AVR

The picture is about the struture of smart plug

1.2 AVR microcontroller.

AVR 8-bit embedded microprocessor is Atmel company, has the advantages of high performance, high confidentiality, low power consumption, the program memory and data memory can be accessed independently harvard structure, code execution efficiency is high. The mega 48v processor used in this system contains programmable FLASH program memory in 4 KB slices. 512 B's E2PROM and 512B RAM; In the meantime, the watch dog is also integrated. Number eight ADC; 3. Programmable PWM output; With the online system programming function, the chip is rich in resources, high integration and easy to use. With AVR mega48V, the setting of external input parameters, current detection and operation status can be easily implemented.

1.3 IC transducer

The design adopts the current type current transformer sampling ac current, the whole way sampling the host interface current realizes switch control, and the other way sampling controlled interface current realizes the flow protection (see figure 2). The output signal of current transformer is sampled with mega 48 after i-v transform, and the effective value of current can be calculated according to the coefficient of transformer. I - V transform after the comparator, the output voltage reaches over current limit (set to 10 A) trigger external interrupt, through interrupt routine processing determine whether achieve over-current value and the over-current protection action.

Current sampling circuit and overcurrent protection--Design scheme of intelligent energy saving plugs based on AVR

The picture is about current sampling circuit and overcurrent protection

1.4 power circuit

The working voltage of the MCU and the coil side voltage of the relay are 5 V dc voltage, considering the cost and the space factor, adopting the method of resistance and pressure reduction. 

Resistance capacitance reducing circuit--Design scheme of intelligent energy saving plugs based on AVR

The picture is about Resistance capacitance reducing circuit

Figure 3: C3 is the CBB step-down capacitance. _R13 provides the discharge circuit for C3 after the power disconnect; R4 is the current limiting resistance; After full wave rectification, D11 will clamp the voltage to 5.1 V. The tolerance XC of C3 in the circuit is: XC=(1/2) PI fc, current, in order to meet the current requirement of the relay, the value of C3 is 1 mu F, and the maximum current can reach more than 100 mA. Because of the non-isolated power supply, the zero potential can't be connected to the earth.

1.5 Relay driver circuit

The control of a controlled socket is controlled by a relay. The coil side voltage of the design is 5V and the S8050 is used to drive the relay. Mega 48 has a strong I/O drive capability and R17 is limited to flow; The pull-down resistance R18 can avoid relay misoperation; D12 provides the discharge circuit when the relay is disconnected. See figure 4.

relay drive circuit--Design scheme of intelligent energy saving plugs based on AVR

The picture is about relay drive circuit

1.6 keyboard circuit

The input mode of single keystroke is used to set the time setting of the functions of the normal socket and the smart socket and the time when the time switch is needed. During the process of the program, check whether or not the key is pressed. When the function key presses no more than 10s, enter the timer switch mode and set the time of the timer switch by adding and subtracting the key. When the function key presses more than 10 s to switch to normal socket use, if need to switch to smart socket, then perform the same operation. Set parameters and schemas are stored in the E2PROM of mega 48.

  • Status display and alarm circuit

The design adopts LCDl602 liquid crystal display system status information, including whether to adopt intelligent control, host running state, controlled mouth state. LCDl602 driven by 7 line method, and then 1 k Ω resistance to the ground, is used to adjust the LCD contrast. Display data and instructions are written by DB4 ~ DB7 of LCDl602. At the same time, it has the function of sound and light alarm, when the flow or the time of time cut off, the corresponding light-emitting diode flashing and the buzzer alarm, and the corresponding action.

  • RealTimecircuit

The real-time clock circuit provides precise time for timing switches. Use the CR2025 nickel-hydrogen button cell as a backup battery for PCF8563 (see figure 5).

real time circuit--Design scheme of intelligent energy saving plugs based on AVR

The picture is about real time circuit


II.Smart plugs software design

The main program mainly completes the initialization of the I/O, the timer, reads the system parameters stored in E2PROM, and enters the corresponding handler according to the mode. The socket can be operated in three modes: intelligent timing mode, intelligent energy saving mode and normal mode. The mode switch is selected by the mode button. The measurement of parameters is mainly completed by the interrupt service routine. FIG. 6 main program flow chart.

main program flowchart--Design scheme of intelligent energy saving plugs based on AVR

The picture is about main program flowchart

Because different computer standby current sizes are different, the standby current of the host is needed before using. First, the host is entered into standby mode, and the current of the time of sampling is entered after the mode key enters the interrupt, and is deposited into the E2PROM.

III.Smart socket test

The design of the socket is connected to the test in figure 6. The P4 dual-core computer and 17-inch monitor are used for the test, and the standby power consumption of the monitor is 5W, and the standby current is about 25mA. Enter the standby mode, press the sample button on the socket, the computer on standby current sampling into the E2PROM chips was introduced, the test results show that after the computer to enter standby mode, can effectively cut off the display of the power supply socket.

IV.Smart power outlet solutions

  • An urgent need for energy conservation and environmental protection

Along with the progress of science and technology, more and more digital products, electrical appliances have entered family, such as TV sets, air conditioners, refrigerators, water heaters and other energy-hungry appliances, created a lot of convenience for human life, but also causing a sharp increase of household energy consumption, especially the standby power consumption of the waste, and the world began to advocate the low carbon run counter to the earth. At present, the average standby energy consumption of urban families in China has accounted for about 10% of total household energy consumption, which is equivalent to a "long light" of 15~30W per family.

"Standby power consumption" refers to the power consumption of electrical equipment with standby function when it is not used. Has a standby power electrical equipment mainly include air conditioners, computers and communication systems (including computer host, display, stereo, printer, scanner, charger, routers, etc.), home video, and audio systems (including TV, DVD, VCD, audio, power amplifier, set-top boxes, satellite receivers, etc.). In order to avoid the trouble of plugging the plug frequently, many users are accustomed to using the continuous power supply to keep the appliance in standby mode. The standby function also creates a lot of energy waste while providing convenience for residents. At the same time, the electrical power supply is continuously running, and the electrical appliances are in standby or working condition for a long time, which can cause catastrophic events.

  • Smart home networking scheme

Society's increasing demand for energy conservation and environmental protection has also promoted the growth of smart home technologies. At present, domestic consumer electronics products are also developing in the direction of low power consumption, with mature performance and high quality products, which can quickly meet market demands and seize market share.

  • Smart plugs solutions

Smart socket, now usually refers to the built-in SUB 1 g module, function through wireless remote control operation of the outlet, the most basic function is through the wireless remote control can control on-off current socket, set the timer switch socket. Smart sockets are usually used in conjunction with home appliances to realize the function such as timing switch, so as to realize energy-saving and environmental protection design concept.

CMT2300A maple microelectronics co., LTD, which is independently designed and developed for smart home solutions of ultra-low power consumption, high performance, suitable for all kinds of 140 to 1020 MHz wireless applications baton, FSK rf transceiver (G). It is part of the rf product line of the CMOSTEK NextGenRFTM, which includes a complete emitter, receiver and transceiver. The high integration of CMT2300A simplifies the peripheral materials needed in system design. The sensitivity of up to 20 dBm and -121dbm optimized the link performance of the application. It supports a wide range of package formats and decoding methods, allowing it to flexibly meet the needs of various data packet formats and decoding. In addition, CMT2300A also supports 64 - bytex/Rx FIFO, rich and GPIO interrupt configuration, the Duty - Cycle operation mode, channel listener, RSSI has high precision, low voltage, electric reset, low frequency clock output, manual fast frequency hopping, noise output functions, such as making application design more flexible, to achieve product differentiation. CMT2300A works at 1.8 V to 3.6 V. When the -121 dBm sensitivity is achieved, only 8.5 mA current is consumed, and the low power consumption mode can further reduce the receiving power consumption of the chip. The output of 13dBm is only 23 mA emission current.

  • 1.Frequency range: 140 to 1020MHz

  • 2.The modulated demodulation method: OOK, (G)FSK and (G)MSK 

  • 3.Data rate: 0.5 to 300 KBPS 

  • 4.Sensitivity: -121 dBm 2.0 KBPS, FRF= 433.92 MHz 111 dBm 50kbps, FRF = 433.92 MHz 

  • 5.Range: 1.8 to 3.6 V 

  • 6.Current: 23 mA @ 13 dBm, 433.92 MHz, FSK 72 mA @ 20 dBm, 433.92 MHz, FSK 

  • 7.Receiving current: 8.5 mA @ 433.92 MHz, FSK (high power consumption) 7.2 mA @ 433.92 MHz, FSK (low power consumption) Supports ultra-low power consumption mode 

  • 8.Sleep current: 300 nA, DutyCycle = OFF, 800 nA, DutyCycle = ON 

  • 9.4 - wireSPI such interface Support direct and package mode 

  • 10.The kit configuration package processor and 64-byte FIFO 

  • 11.Do not return to zero, 

  • 12.Manchester, data albino decoding 

  • 13.Support forward error correction 

  • 14.16 tube foot QFN3x3


V.FiveTop Smart Outlets in Amazon in 2018

Insteon ON/Off Outlet Review

This is the first remote-controllable dual outlet in the world, which allows you to control and schedule your electronic devices from any location. You can use any Insteon device, a wireless remote in the same room, or your smartphone or tablet via the Insteon Hub. The On/Off Outlet also allows you to control the upper and lower outlets independently so there’s no need to purchase two Insteon devices to control multiple electronics. Sleek and slim in its design, this outlet is a great pick for those focused on aesthetics.

Buy from Amazon

Insteon On/Off Outlet--Design scheme of intelligent energy saving plugs based on AVR

Advantage: There are many color such as black,white,brown and etc. to choose while its prices is affordable ,approximately $60. What’s more,it’s a dual outlet, when you buy one,it is equal to two smart plugs.

Disadvantage:Compare with other plugs,its price is still a little expensive.

Wireless Remote Control Electrical Outlet Switch Review

This product is from Etekcity and according to Etekcity, we can save about $100 each year in energy costs when using this products and the product’s life by up to 15%.

Buy from Amazon

Etekcity Wireless Remote Control Electrical Outlet Switch--Design scheme of intelligent energy saving plugs based on AVR

Advantage: It can be control up to 100 feet from electronics and the price is affordable, about $30.

Disavantage: Actually,this product is not very smart,you can control it by using a remote but not you smart phone.You’ll have to be within 100 feet to do so.

Belkin WeMo Switch

This products instantly transforms your standard electrical outlet into a remote controllable one. We can control any electronic devices remotely by WeMo App. While the switch is Wi-Fi enabled,it also works anywhere you have an Internet,3G or 4G connection. Its unique advantage is the integration with Amazon Echno,which allows you to control devices plugged into the switch using voices. What’s more,it is easy to set up and use.

Buy from Amazon

Belkin WeMo Switch--Design scheme of intelligent energy saving plugs based on AVR

Advantages:This timer makes it look like someone is home while you’re away by turning lights on and off periodically and it is affortable, about $50.

Disadvantages:Compare with other plugs,its price is still a little expensive.

Edimax Wi-Fi Smart Plugs

This product let people connect with home at all time.You can set a daily, weekly, or monthly power limit for an appliance and the Smart Plug will turn off the device when it reaches its limit. View your appliances’ energy usage in kilowatts or real currency for an accurate insight into how much each appliance uses and costs. It’s one of the most advanced smart plugs on the market and a great pick for the energy-conscious consumer.

Buy from Amazon

Edimax Wi-Fi Smart Plug--Design scheme of intelligent energy saving plugs based on AVR

Advantages: You can monitor the energy usage with the app and its price is affordable, about $50. What’s more,it can be set limits for energy usage on a daily,weekly or monthly basis. This kind of product has a good review over 4.5 or 5 stars on Amazon.

Disadvantage:Compare with other plugs,its price is still a little expensive.

iHome Smart Plug

This Apple compatible device is ready to turn your appliances and electronics into smart technology. Instead of using its own app, iHome Smart Plug utilizes the app, Wink. You can download it on your Apple device to control your home remotely. You can even talk to Siri and have her complete your commands. 

Buy from IHome

iHome Smart Plug--Design scheme of intelligent energy saving plugs based on AVR

Advantage: This product use wink that is an established home automation app but not its own app,when you want to turn electronic and lights on and off,you just need to talk to Siri. Its price is affordable,about $38.

Disavantage: This products is only compatible with Apple devices.

Relevant information about "Design scheme of intelligent energy saving plugs based on AVR"

About the article "Design scheme of intelligent energy saving plugs based on AVR", If you have better ideas, don't hesitate to  write your thoughts in the following comment area. You also can find more articles about electronic semiconductor through Google search engine, or refer to the following related articles.

Related Articles

pinglun 3 comments

    • pingluntus
    • allpet products on 2018/4/14 13:49:47

    Hello,article is excellent ! I'm trying to find issues to improve my site!I guess its ok to make use of a few of your ideas!!

    • pingluntus
    • کانال خبري on 2018/9/4 12:15:05

    Hello colleagues, good piece of writing and pleasant arguments commented at this place, I am actually enjoying by these.

    • pingluntus
    • Jorg on 2019/10/14 20:22:42

    These are in fact enormous ideas in on the topic of blogging. Any way please keep up wrinting.

Leave a Reply

Your email address will not be published.

code image
Rating: poor fair good very good excellent