Author Topic: Smart Outlet  (Read 8423 times)

0 Members and 1 Guest are viewing this topic.

Offline joejoe317Topic starter

  • Contributor
  • Posts: 12
Smart Outlet
« on: November 25, 2013, 06:37:56 am »
Hello All,

I am currently a senior majoring in electrical engineering. As my senior project my group and I chose to do a Smart Outlet. What constitutes a smart outlet?

I'm not sure, but I will tell you the goals of what we are trying to accomplish.

Our smart outlet should read power data, pass this data to a mcu, and then get this data to a computer so we can make nice graphs about how much power each outlet is using.

So far we have decided on the following:

-Each outlet will have a usb port capable of charging up to 2A (tablets take up to this much) at 5v.
-Each outlet will need a power supply to supply voltages to the mcu, power metering chip, and usb port
-Each outlet will send data via RF
-Each outlet should be able to be turned off by the computer.

So far we have taken time each week to research. The term is almost over, so overall we have researched for about 5 weeks. In this time frame our teacher has posted a few videos from this website, like "how to pick a part dc to dc boost converter #139)

So far I have spent a great deal of time trying to figure out how to make such a tiny power supply to fit in a small place like an outlet. Iron core transformers are too big, so initially my thought was to look at the iphone/ipad cube chargers as a reference. I found some schematics online, and even had parts picked out. After showing a professor at my school, he was very glad I talked to him about design because the design I came up with would have produced some fireworks. It was working with a flyback transformer, and he was explaining that at 60Hz, it simply wouldn't have worked. He said the typical design for a flyback was DC to DC.

I then went back to the drawing board and found something that was by TI, which can be found here: http://www.ti.com/lit/an/slyt391/slyt391.pdf

This is a schematic of a non isolated power supply.

My question is as follows. If the output is 750mA at 5v, and I wanted to power 3 separate things.
1) USB 5v, 2A
2) ADE7763 (power measuring) 5v 200mA
3) cc430f5137 (MCU) 3.3V don't remember the Amprage off the top of my head, but it was small

Could I simply tap off the 5v supply and use 3 similar circuits he shows in the episode I referenced earlier? It seems as if the Boost circuit did not depend on the input current, but only the input voltage. Initially I was going to try and get about 10V out so I could buck it, 1 at 5v 2a, one at 5v 200ma, other at 3.3v and a smaller current.

would this be a bad thing to do? If it would work, and my output of the power supply is 5v, can I still use the same approximation equations he uses at the beginning of the video, I believe Vo/Vi*Io for the switching current on the part? In my case Vo=Vi therefore Io would equal the switching current. I was also wondering about the inductor in his circuit, he mentioned he talked about how to choose it in a previous video, but the only similar video I found he was talking about a mc34063.

If anyone has any ideas I am all ears. This is my first big project, and I am really limited on the projects I have done in the past. I never really tinkered with electronic components before school and have only built a few things like audio amplifiers for a computer and a power supply limited at 1A. These were from my two microelectronic classes that I took at the university.

Thanks everyone for taking the time to read this,

Joe

 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8425
Re: Smart Outlet
« Reply #1 on: November 25, 2013, 07:23:09 am »
It's not a true "smart" outlet if it doesn't report all its usage data back to the manufacturer. :-DD
 

Offline sdg

  • Regular Contributor
  • *
  • Posts: 67
  • Country: fr
Re: Smart Outlet
« Reply #2 on: November 25, 2013, 09:40:23 am »
A smart outlet is one that knows when to shut up...
 ;)
--
 -sdg
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Smart Outlet
« Reply #3 on: November 25, 2013, 11:29:02 am »
Quote
A smart outlet is one that knows when to shut up...

or shut down, :)
================================
https://dannyelectronics.wordpress.com/
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2133
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Smart Outlet
« Reply #4 on: November 25, 2013, 12:21:42 pm »
look up

www.powerint.com
www.myrra.com

probably TNY286 would do the job.

Also, probably better using something like a polled zigbee network and then just build an aggregator/master with ethernet, a lot more predictable.

https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline joejoe317Topic starter

  • Contributor
  • Posts: 12
Re: Smart Outlet
« Reply #5 on: November 26, 2013, 08:16:37 am »
Thank you FCB, the data sheet wasn't pulling up because their website seems to be down. I found what I believe is the correct data sheet here. http://www.avnet-abacus.eu/fileadmin/user_upload/Suppliers/Power_Integrations/Images/tinyswitch-4_family_datasheet.pdf

I'm assuming this requires a flyback transformer. I researched these and was not really sure what specs to use when selecting it. Also, if I bridge the input 120vrms I will get around 170v. Is that okay to input into this circuit  shown? What flyback would you recommend for this? we are on a pretty tight budget so cost is a factor.

We just got the cc430f5137 mcu from ti as free samples, it has built in RF. we found a usb controller with drivers for mac,pc,linux,android so we were going to use that for communication. I just ordered the original msp430f2272 just in case, this one does not have a built in rf, but I also ordered some c1101 from ti as well.

One more question I have, we need to shut off the incoming AC with a relay by sending a signal from our mcu, do you have any recommended solid state or mechanical relays that would fit in a small area that can do this?

We still have to refine our engineering requirements so if things need to be a little bigger that is fine.

Thanks again for the help!
 

Online AndyC_772

  • Super Contributor
  • ***
  • Posts: 4285
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Smart Outlet
« Reply #6 on: November 26, 2013, 08:41:17 am »
I'm afraid it looks as though you have quite a lot to read up on when it comes to power supply design - it's going to be nigh on impossible to give you a simple answer along the lines of "just use X" if you don't already have experience in this area.

Most importantly, you're dealing with the mains, which is very much something to get involved with *after* you've gained experience designing safe, low voltage dc-dc converters. You're heading for a world of smoke, fire, loud bangs and the lights going out otherwise.

That said, you can simplify your requirements considerably by omitting the 5V @ 2A USB port. If someone needs such a thing, they can plug an off-the-shelf adapter into your outlet.

The important consequence of leaving it out, is that there's no need for you to design an isolated supply which has a low voltage output which is safe to touch. All your other electronics are fully enclosed with no accessible metal parts, and nothing electrically connected to them, and that means they can be connected directly to the mains. (Note, by "directly" I mean "without the use of an isolation barrier").

That can potentially simplify your design a great deal, and more importantly, it means it'll be much safer for the end user. You, on the other hand, will still need to know how to properly isolate and probe your circuit safely, given that it will still be directly connected to the mains.

Power the complex, low voltage stuff from a lab supply to get it working, and make sure you get as much help as you need when it comes to your power supply.

Offline joejoe317Topic starter

  • Contributor
  • Posts: 12
Re: Smart Outlet
« Reply #7 on: November 26, 2013, 09:07:21 am »
This is an option. Our group did talk about this because it is not a complete requirement. I noticed that there are outlets that already have a built in USB as well. I think I will talk to me group about leaving this out for now.

The first power supply I listed does not require a fly back and is just a buck. It provides 5v at 750mA which is plenty for the chips we are using. It is not isolated. Will this be a problem?
 

Online AndyC_772

  • Super Contributor
  • ***
  • Posts: 4285
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Smart Outlet
« Reply #8 on: November 26, 2013, 09:30:59 am »
Isolation is required between the mains and anything which a person might be able to touch. If all your electronics are fully enclosed within the wall outlet, and there's no external connection other than the mains outlet itself, then no, you don't necessarily need isolation.

Just be aware that your entire circuit could be as dangerous to touch as a live wire, so you'll need to take all necessary precautions when it comes to making measurements on it. At the very least, connect power to it through a 1:1 isolation transformer rather than direct to the mains. Don't, whatever you do, try to connect anything like an oscilloscope or microcontroller programming cable. If you need to probe and debug your circuit, switch it off, disconnect it from the mains completely, and power it from a safe, low voltage, isolated bench supply.

There are, of course, regulatory standards which apply to any electronic equipment that connects to the mains, and you could do a lot worse than to read up on EN 60950 or UL 60950. The standards themselves are badly written and difficult to read, navigate and understand, but there are basic principles to do with isolation, creepage & clearance and earthing which are well worth becoming familiar with.

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2133
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Smart Outlet
« Reply #9 on: November 26, 2013, 10:01:23 am »
I'm assuming this requires a flyback transformer. I researched these and was not really sure what specs to use when selecting it. Also, if I bridge the input 120vrms I will get around 170v. Is that okay to input into this circuit  shown? What flyback would you recommend for this? we are on a pretty tight budget so cost is a factor.

One more question I have, we need to shut off the incoming AC with a relay by sending a signal from our mcu, do you have any recommended solid state or mechanical relays that would fit in a small area that can do this?

The second link was to myrra, they do a series of flyback transformers off-the-shelf ready for use with TOPswitch's, you can prototype with those and then get a supplier to quote.

Don't use a solid-state relay, especially as you don't know what the are plugging in!  Just use an mains rated relay designed for the job, the catalogues are full of them.  I quite like these: http://www.rapidonline.com/Electronic-Components/16A-SPNO-Miniature-relay-74442, not that small, the tags are useful and may save board space in the end - perhaps.  There are smaller ones.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline joejoe317Topic starter

  • Contributor
  • Posts: 12
Re: Smart Outlet
« Reply #10 on: November 26, 2013, 05:53:50 pm »
Hey FCB, I looked on the myrra website. Thank you so much for the info.

When looking here for products http://www.myrra.com/en/productsmyrra  I clicked on every choice and it did not have tny286 listed on any of them, it did however have the tny268 listed on a bunch. I just want to make sure the numbers weren't flipped.

a google search didn't produce much either.

The two I found to work with the 268 are

power 10-18w EL19 74020;
power 12-24w EF20 74089;

I see that the 286 provides 4A, that would be great but it says it needs a EE22 transformer, I can only seem to see them on aliexpress etc...

On digikey I found this
http://www.powerint.com/sites/default/files/product-docs/tny274-280.pdf

and they have a transformer that is built for it here
http://www.digikey.com/product-search/en?pv1392=4&FV=fff4000c%2Cfff804d6&k=transformer&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25

its 12v at 1A output, but I can buck this and boost the current for the usb.

Looking through all these datasheets, it seems as if powerint is the only one that really gives examples with circuitry. It's really nice to see this.

I did have a question about the example circuitry they gave with the 286 datasheet. What is up with the 2 inductors they show really close together? At first I thought it was another transformer, but then it gives a 10mH value.
« Last Edit: November 26, 2013, 06:58:22 pm by joejoe317 »
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2133
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Smart Outlet
« Reply #11 on: November 26, 2013, 09:40:45 pm »
Don't take this minor rant the wrong way please.

When I was growing up - I'm 41 now -  I had a huge stack of old electronics magazines from the mid-70's onwards, I spent many hundreds of hours reading every single article and studying every schematic and description. Data was scarce, I prized my blue National Semi manuals collection more than anything.

Now - more than ever - with the internet and google at hand I am constantly surprised by how people expect to have things handed on a plate.. the cut and paste generation I guess.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9244
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Smart Outlet
« Reply #12 on: November 26, 2013, 10:09:26 pm »
Look into PLC. It can often be a better choice than RF.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline joejoe317Topic starter

  • Contributor
  • Posts: 12
Re: Smart Outlet
« Reply #13 on: November 26, 2013, 10:33:26 pm »
Don't take this minor rant the wrong way please.

When I was growing up - I'm 41 now -  I had a huge stack of old electronics magazines from the mid-70's onwards, I spent many hundreds of hours reading every single article and studying every schematic and description. Data was scarce, I prized my blue National Semi manuals collection more than anything.

Now - more than ever - with the internet and google at hand I am constantly surprised by how people expect to have things handed on a plate.. the cut and paste generation I guess.

I don't take that the wrong way at all. I completely understand where you are coming from. You obviously have the experience that I am lacking. By the time you were my age, you had about 15 years more experience than I do right now. I have looked at a lot of circuits and understand how most of them work. If I have a resource available to me I will try and use it to be quite frank. We don't have a mentor for our project so it is difficult to get simple questions answered sometimes.

I will talk to my group, we may drop the 5v 2A line because of cost, and the other powersupply I originally mentioned is not isolated. Flyback transformers are extremely dangerous so I am trying to get as much info as possible. Sometimes I am not sure of somethings in schematics. I am not a microelectronic engineer, my main focus is power. A majority of the things I deal with are with fault studies, 3 phase voltages, and generators.

I really appreciate your input regardless of the situation. I am taking what you say and am actually researching based off of that. I have found out a lot more about these things based off the links you provided. I also know now that the tny286 requires a EE22 transformer. Have yet to find one, and places like digikey do not isolate based off of these parameters. I have always learned two inductors close together are transformers. I have a feeling in this case that this is not true.

Again sorry for taking up your time, but again, I really want you to know that I appreciate the time and effort you put into leading me in the right direction.
 

Offline Ton

  • Regular Contributor
  • *
  • Posts: 53
  • Country: dk
Re: Smart Outlet
« Reply #14 on: November 26, 2013, 10:58:12 pm »
Hi
The two inductors close together is a common mode coil, used to reduce noise

You could argue that it is a kind of transformer used to make the current in the two coi!s equal and in opposit direction.

Sorry for my English, hope it is understandable  :o
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12424
  • Country: us
Re: Smart Outlet
« Reply #15 on: November 26, 2013, 11:14:27 pm »
Flyback transformers are extremely dangerous

This is an oversimplifying generalization. A flyback transformer is simply a kind of transformer that uses stored magnetic energy in its mode of operation. This may allow it to be more compact than a regular transformer in a given design.

A flyback transformer is no more or less dangerous than the voltage it is designed to produce. Low voltage switching power supplies may use low voltage flyback transformers that are as safe as any other kind.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2133
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Smart Outlet
« Reply #16 on: November 27, 2013, 12:01:45 am »
I don't think flyback transformers are extremely dangerous, certainly no more dangerous than anything else at mains potential. A surprising statement from an electrical engineers used-to 3-phase, etc... 
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Smart Outlet
« Reply #17 on: November 27, 2013, 04:23:01 am »
My Geiger counter has a flyback transformer in it that generates the 900V needed to make the Geiger tube work.  The current is so low that you need at least a 10M impedance meter to test it or it will just peg the meter on the counter and the DMM will only read about 200V.
The larger the government, the smaller the citizen.
 

Offline joejoe317Topic starter

  • Contributor
  • Posts: 12
Re: Smart Outlet
« Reply #18 on: November 28, 2013, 09:45:00 am »
I don't think flyback transformers are extremely dangerous, certainly no more dangerous than anything else at mains potential. A surprising statement from an electrical engineers used-to 3-phase, etc...

My mistake FCB, I only said that because it is from what I read. I haven't dealt with them. I was encouraged to research, and from I researched that is what I understood. Again, I appreciate your help. My copy and paste attitude must apply in this situation. Since I don't have any real world experience I must learn from my mistakes and from reading materials. I want you to understand that I am trying my best to grasp everything so I can become better. Any help is appreciated. I went out today and purchased the encyclopedia of circuits so I can read extra on top of my already demanding schedule. Like I said, I may not have started early like you, but I sure could benefit from any expertise out there.

Sorry for coming across like I am not trying to research FCB, I really am trying my best. I have spent numerous hours reading over data sheets, posts, circuits, trying to figure this stuff out. I wish I was fortunate enough to start early in my childhood like you. Unfortunately I started late and am trying to make up for my lack of experience.

Thanks again for your inputs, this is all much appreciated.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2133
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Smart Outlet
« Reply #19 on: November 28, 2013, 09:54:23 am »
Forgiven joejoe317   ;)
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline joejoe317Topic starter

  • Contributor
  • Posts: 12
Re: Smart Outlet
« Reply #20 on: November 28, 2013, 09:56:45 am »
Hi
The two inductors close together is a common mode coil, used to reduce noise

You could argue that it is a kind of transformer used to make the current in the two coi!s equal and in opposit direction.

Sorry for my English, hope it is understandable  :o

Thanks for the help on that one, I assumed this was the case, but I have never seen it before. Thanks again!

Your English is just fine Ton, thanks for commenting!
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2133
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Smart Outlet
« Reply #21 on: November 28, 2013, 11:03:36 am »
Here's what I would do for the unit.

PSU
Power Integrations type switcher with flyback txfmr (three outputs, two of them isolated):
Isolated 5V for USB (with transistor based voltgae regulator and current limiter) - design it to run 2A into a short without melting!
Isolated 3v3 for microcontroller & RF sections, 12v (shared 0v with 3v3) relay.   This 0V is also NEUTRAL, this helps hugely with mains current measurement via a small shunt.

Put the regulation loop on the 12v rail and use a LDO for the 3v3 (noise), you'll need to do some 'mission profiling' to workout the minimum and maximum power draw and keep enough headroom, as a hint, if you design for perhaps 50% more power than you need you'll end up with a more efficient transformer design and have less swing on the rails.

Power monitoring
Roll your with a shunt in the NEUTRAL and use a differential amplifier (opamp). Plenty of detail on how to do this online.
Mains voltage can be sensed with a potential divider, use at least two high value resistors (2M2 perhaps) in series for safety.

Mains switch
Switch the LIVE via 12/16A 250V relay designed for mains switching (silver/tin based contacts) - schrack RT1 perhaps.
Switch the relay with a small FET and use a PWM output from the micro to do this, you can then do coil-economising.

Processor
MSP430 processor or similar with 14 bit ADC built in. You don't need the accuracy of the ADE7763, it's not metering for money.
Bluetooth or zigbee (makes sense if you have lots of sockets, and you can have a 'building manager' type hub, alot easier to develop too).
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline joejoe317Topic starter

  • Contributor
  • Posts: 12
Re: Smart Outlet
« Reply #22 on: November 28, 2013, 07:46:48 pm »
Here's what I would do for the unit.

PSU
Power Integrations type switcher with flyback txfmr (three outputs, two of them isolated):
Isolated 5V for USB (with transistor based voltgae regulator and current limiter) - design it to run 2A into a short without melting!
Isolated 3v3 for microcontroller & RF sections, 12v (shared 0v with 3v3) relay.   This 0V is also NEUTRAL, this helps hugely with mains current measurement via a small shunt.

Put the regulation loop on the 12v rail and use a LDO for the 3v3 (noise), you'll need to do some 'mission profiling' to workout the minimum and maximum power draw and keep enough headroom, as a hint, if you design for perhaps 50% more power than you need you'll end up with a more efficient transformer design and have less swing on the rails.

Power monitoring
Roll your with a shunt in the NEUTRAL and use a differential amplifier (opamp). Plenty of detail on how to do this online.
Mains voltage can be sensed with a potential divider, use at least two high value resistors (2M2 perhaps) in series for safety.

Mains switch
Switch the LIVE via 12/16A 250V relay designed for mains switching (silver/tin based contacts) - schrack RT1 perhaps.
Switch the relay with a small FET and use a PWM output from the micro to do this, you can then do coil-economising.

Processor
MSP430 processor or similar with 14 bit ADC built in. You don't need the accuracy of the ADE7763, it's not metering for money.
Bluetooth or zigbee (makes sense if you have lots of sockets, and you can have a 'building manager' type hub, alot easier to develop too).

Wow ty for the info, we changed the plans to use a msp430 because the programming board costs 10 dollars vs 150 for the cc430. The ade chip seems really easy to use and is cheap, so that is why we were using that.

I built an adjustable power supply before, it goes from 0-15V up to an amp with over current protection at 1A. It uses a darlington pair to boost current. I think I will re-look at how i designed it. It's really hard not having parts in front of me to tinker with. In class we are pretty much coming up with designs.

We found a nordic RF chip we were going to use that was only 2 dollars with the antenna circuit etc. We found a usb controller as well that came with drivers for windows/mac/linux/android, royalty free.


Would it be wise to shield the flyback circuit? I was wondering if the emf would interfere with any other parts of my circuit. Again just something I was watching about flybacks.

I can't really talk about the relay circuit yet, because our group has done limited research, but we were thinking we could tap off the 5v power supply and use a mosfet. We would then use a signal from the msp to turn off and on the mosfet to turn off and on the 5v power from the supply. I have seen other videos online where people used strictly a mcu and built a separate circuit with a bjt to increase the current to the relay.


 

Offline joejoe317Topic starter

  • Contributor
  • Posts: 12
Re: Smart Outlet
« Reply #23 on: November 28, 2013, 08:29:15 pm »
Happy Thanksgiving to all who celebrate!

Does anyone have any recommended books on circuits, I really like the encyclopedia of electronic circuits volume 3. http://www.amazon.com/Encyclopedia-Electronic-Circuits-Volume-3/dp/0830633480

 

Offline JamesG-J

  • Contributor
  • Posts: 10
  • Country: ca
Re: Smart Outlet
« Reply #24 on: November 29, 2019, 11:17:14 pm »
Hey joejoe317,

I'm working on a similar project right now and was wondering how your project ended up and if you'd be willing to share some schematics or notes about the final product to help me along?

I'm trying to build a ZigBee controlled power bar with a bunch of relays - planning on using a shift register or two to control the relays using only a few GPIOs off the ZigBee.

Best,
James  :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf