We are Apogeeweb Semiconductor Electronic


Home arrow Semiconductor Information arrow Design scheme of intelligent energy saving plugs based on AVR

arrow left

arrow right

Design scheme of intelligent energy saving plugs based on AVR

Author: Apogeeweb
Date: 5 Jan 2018
intelligent socket

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.



Ⅰ Smart Socket Design

  1.1 Hardware Structure of Smart Socket

  1.2 AVR Microcontroller

  1.3 IC Transducer

  1.4 Power Circuit

  1.5 Relay Driver Circuit

  1.6 Keyboard Circuit

Ⅱ Smart Plugs Software Design

Ⅲ Smart Socket Test

Ⅳ Smart Power Outlet Solutions

Ⅴ FiveTop Smart Outlets in Amazon in 2018




Ⅰ 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.

Current sampling circuit

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 5V 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



Ⅱ 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

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.


Ⅲ 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.


Ⅳ 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



Ⅴ 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.



1. How does Intelligent Energy Saver work?

Power Saver stores the electricity inside of it using a system of capacitors and they release it in a smoother way to normal without the spikes. The systems also automatically remove carbon from the circuit which also encourages a smoother electrical flow. This means that we will have fewer power spikes.


2. Can smart plugs save you money?

The thing about smart plugs is that they still use energy even when the appliance they're connected to is turned off. However, the energy it uses is very minimal that it won't make a significant impact on your electricity bill. A smart plug is only energy-saving when used with the right devices and when used properly.


3. Do energy-saving devices really work?

The short answer is yes! ... Some power-saving devices work by directly reducing the amount of energy your appliances, such as your heating/cooling systems consume, while others rely on power factor correction.


4. How much can you save with smart plugs?

In research conducted by the National Renewable Energy Laboratory and CLEAResult, it's estimated that using smart plugs to cut phantom power saves between 1 – 4.58% of energy usage or 500 – 1000 Kilowatts. That's like getting a month of energy free, depending on how big your house is and how much power you use in a year.


5. Are smart plugs dangerous?

Not usually. Smart plugs pass the same standard safety guidelines as any other device you plug into the wall. As with any electrical device, you should be safe as long as you don't overload the outlet.


6. What is the point of a smart plug?

With a smart plug, you can schedule your appliances to turn off and on at the perfect times. This means that whether it's summer or winter, you can set a time for your air conditioner, fan or heater to turn on.


7. Can you plug a smart plug into an extension lead?

You can plug a smart plug into an extension cord but it isn't the most attractive idea. This is because smart plugs are large devices. If you plug one into an extension cord, it will cover some of the outlets, limiting the number of appliances you can add to the extension cord.


8. Are there any 5g smart plugs?

There are a few smart plugs that come with 5GHz WiFi. Most of them are dual-band, which means they can use both 2.4GHz and 5GHz frequencies when communicating to your phone or hub device.


9. Do you need a smart plug for each device?

Smart outlets are a cheap way to turn your ordinary appliances and fixtures into smart devices. With a smart outlet, you can turn your appliances on and off from your phone, or (in some cases) with your voice through devices like the Amazon Echo. But not every device will work with smart outlets.


10. Are all smart plugs compatible?

Not all smart plugs work with all voice assistants though, so you'll need a smart speaker that works with your brand of the plug (or a phone or tablet with the relevant voice assistant built-in). You can use smart plugs to get all your smart devices working together, even if they're not made by the same manufacturer.


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.



Best Sales of diode

Photo Part Company Description Pricing (USD)

Alternative Models

Part Compare Manufacturers Category Description

Ordering & Quality

Image Mfr. Part # Company Description Package PDF Qty Pricing (USD)

Related Articles


Leave a Reply

Your email address will not be published.

code image
Rating: poor fair good very good excellent

# 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z