Smart Outlet - Page 1
Forum section: electronics / projects

author: joejoe317
author_rank: Contributor
timestamp: November 25, 2013, 06:37:56 am
content: 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.pdfThis 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, 2A2) ADE7763 (power measuring) 5v 200mA3) cc430f5137 (MCU) 3.3V don't remember the Amprage off the top of my head, but it was smallCould 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

author: amyk
author_rank: Super Contributor
timestamp: November 25, 2013, 07:23:09 am
content: It's not a true "smart" outlet if it doesn'treport all its usage data back to the manufacturer.

author: sdg
author_rank: Regular Contributor
timestamp: November 25, 2013, 09:40:23 am
content: A smart outlet is one that knows when to shut up...

author: dannyf
author_rank: Super Contributor
timestamp: November 25, 2013, 11:29:02 am
content: Quoteor shut down,

author: fcb
author_rank: Super Contributor
timestamp: November 25, 2013, 12:21:42 pm
content: look upwww.powerint.comwww.myrra.comprobably 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.

author: joejoe317
author_rank: Contributor
timestamp: November 26, 2013, 08:16:37 am
content: 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.pdfI'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!

author: AndyC_772
author_rank: Super Contributor
timestamp: November 26, 2013, 08:41:17 am
content: 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.

author: joejoe317
author_rank: Contributor
timestamp: November 26, 2013, 09:07:21 am
content: 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?

author: AndyC_772
author_rank: Super Contributor
timestamp: November 26, 2013, 09:30:59 am
content: 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.

author: fcb
author_rank: Super Contributor
timestamp: November 26, 2013, 10:01:23 am
content: Quote from: joejoe317 on November 26, 2013, 08:16:37 amThe 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.

author: joejoe317
author_rank: Contributor
timestamp: November 26, 2013, 05:53:50 pm
content: Hey FCB, I looked on the myrra website. Thank you so much for the info.When looking here for productshttp://www.myrra.com/en/productsmyrraI 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 arepower 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 thishttp://www.powerint.com/sites/default/files/product-docs/tny274-280.pdfand they have a transformer that is built for it herehttp://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=25its 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.

author: fcb
author_rank: Super Contributor
timestamp: November 26, 2013, 09:40:45 pm
content: 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.

author: NiHaoMike
author_rank: Super Contributor
timestamp: November 26, 2013, 10:09:26 pm
content: Look into PLC. It can often be a better choice than RF.

author: joejoe317
author_rank: Contributor
timestamp: November 26, 2013, 10:33:26 pm
content: Quote from: fcb on November 26, 2013, 09:40:45 pmI 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.

author: Ton
author_rank: Regular Contributor
timestamp: November 26, 2013, 10:58:12 pm
content: HiThe two inductors close together is a common mode coil, used to reduce noiseYou 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

author: IanB
author_rank: Super Contributor
timestamp: November 26, 2013, 11:14:27 pm
content: Quote from: joejoe317 on November 26, 2013, 10:33:26 pmThis 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.

author: fcb
author_rank: Super Contributor
timestamp: November 27, 2013, 12:01:45 am
content: 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...

author: Stonent
author_rank: Super Contributor
timestamp: November 27, 2013, 04:23:01 am
content: 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.

author: joejoe317
author_rank: Contributor
timestamp: November 28, 2013, 09:45:00 am
content: Quote from: fcb on November 27, 2013, 12:01:45 amMy 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.

author: fcb
author_rank: Super Contributor
timestamp: November 28, 2013, 09:54:23 am
content: Forgiven joejoe317

author: joejoe317
author_rank: Contributor
timestamp: November 28, 2013, 09:56:45 am
content: Quote from: Ton on November 26, 2013, 10:58:12 pmThanks 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!

author: fcb
author_rank: Super Contributor
timestamp: November 28, 2013, 11:03:36 am
content: Here's what I would do for the unit.PSUPower 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 monitoringRoll 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 switchSwitch 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.ProcessorMSP430 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).

author: joejoe317
author_rank: Contributor
timestamp: November 28, 2013, 07:46:48 pm
content: Quote from: fcb on November 28, 2013, 11:03:36 amWow 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.

author: joejoe317
author_rank: Contributor
timestamp: November 28, 2013, 08:29:15 pm
content: 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

author: JamesG-J
author_rank: Contributor
timestamp: November 29, 2019, 11:17:14 pm
content: 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