Electronic Designing considerations - Page 1
Forum section: electronics / projects

author: mheruian
author_rank: Contributor
timestamp: March 14, 2018, 12:10:49 pm
content: Great Day !I'm new here and I've been interested in electronics lately (not schooling anymore, more on self-study, but I'm not that smart, just a dedicated one and i can't understand everything right through). I started pretty much on arduino stuffs, like 2 months already and here I am being glad i will have my first projectand now i don't know where to start exactly.So my project was a power meter thing on our building. It would use:- 2 microcontroller- 6 power sensors (SPI)- 3 relays- 1 dmx 2 to 4- 6 CTs- 2 bus transceivers rs485excluding microcontroller, sensor and relays, the rest are first time for me to use. And now, I decided to start designing first the power scheme for this project. The setup would be 1 isolated module (1 microcontroller + 3 power sensors + 1 bus transceiver) is inside a main switch board, far away by 50 meters to the main controller (1 microcontroller + 3 power sensors + 1 bus transceiver + 3 relay + 1 dmx). So my question(s) would be, what will be your insights about this or for those that had experience with this, i hope you could give me a hand understanding stuff?I have this questions:1) Do i need galvanic isolation (like for SPI comms) for the 3 power sensors at the main switch board? is it necessary or negligible (based on experience?)2) I'm choosing two ways to give power on this isolated module; 1) is through long distance dc supply from main controller via Cat5e w/ LDO regulator on the isolated module. 2) put separate ac-dc converter as its supply. W/c is better?3) Should I put a separate regulator for the power sensors, away from dmx, relays, transceivers, microcontroller? I mean like all power sensors should share on a 3v3 and the rest shares on a 5v0 supply for the sensor's output would not be affected by spikes, sudden big current draw on the rest of the circuit?4) Should power sensors use linear or switching? switching regulators are noisy right but does that affect sensor's output?Those are the things I have in mind and if there is anything I should consider, I look forward to listen. I'm open to critics also and I'm willing to learn, I'm doing my best to do it myself but I always get confused. There are a lot of things I can't understand even I self-study. I'm not expert when it comes to this stuffs, all my experience are based on following DIYs.I hope you'll be welcoming a newbie like me warmly. Thanks a lot

author: capt bullshot
author_rank: Super Contributor
timestamp: March 14, 2018, 12:23:13 pm
content: Welcome to the forumRegarding your questions:1) can you please specify the power sensor (give a link to a datasheet or similar)2) power supply depends on the remote side current consumption. Low voltage DC transmission suffers from voltage drop along the cable. For a CAT5 cable, you should be OK with a max. of 100 ... 200mA and some volts of regulation headroom for the LDO. If you've got higher power consumption, I'd recommend a seperate AC/DC supply3) depends on 1)4) same as 3)In general, your project looks like you're going to "mess around" with mains power supply, please be aware of your personal safety.

author: mheruian
author_rank: Contributor
timestamp: March 14, 2018, 01:23:32 pm
content: Thanks a lot for replying CaptainQuote from: capt bullshot on March 14, 2018, 12:23:13 pmit'll be this onehttp://www.mouser.com/ds/2/76/CS5480_F3-473044.pdfQuote from: capt bullshot on March 14, 2018, 12:23:13 pmOh? ok, so it'll be ok if i just use some 3v3 300mA LDO as the only supply for microcontroller, sensor and transceiver? i plan it to be at least 1 watt only.Quote from: capt bullshot on March 14, 2018, 12:23:13 pmActually yes,i'm a bit nervous, i don't know anything about high power mains, just some electrical guy told me that i should consider isolation thus giving me the term galvanic isolation and i did search some about it.

author: capt bullshot
author_rank: Super Contributor
timestamp: March 14, 2018, 02:21:05 pm
content: OK, speaking of the terms I'm common with, your sensor isn't a sensor but an energy metering chip.Isolation requirement depends on how you plan to connect this chip to the mains power lines ...Current sensing can be easily done with CT's (current transformers), these provide isolation as an intrinsic feature.Voltage sensing is usually done through a resistive divider, which does not provide isolation. By using the "right" resistors and techniques, voltage sensing can be made safe without isolation - that's for an advanced EE, I wouldn't recommend that to a beginner.The reference circuit tie the IC's ground potential to a line potential, so the whole circuit isn't isolated at all from the mains line. You must isolate this part of the circuit from your Arduino. Linear Technology makes some nice (but expensive) modules for this purpose, they also include an isolated power supply for the energy metering part.If you know what you do, the reference circuits can be modified to a differential voltage sensing, so the circuit ground can be tied to safety ground and there's no need for isolation and isolated supply.Isolation can also be shifted to your communication interface, then your whole circuit is on dangerous potential and not easy to debug - wouldn't recommend this to a beginner.A rather safe way to handle your isolation would be to use CTs for current sensing and PT (potential transformers) for v oltage sensing. Then your whole circuit is on safe potential, and easier to handle and debug. With some luck, a slightly oversized (voltage wise) mains transformer (choose primary voltage higher than your mains line voltage, e.g. 300V primary voltage for a 230V mains) can be used. A "normal" mains transformer will distort the waveform and result in reduced accuracy, but will do the job for the first experimental stages.Regarding the power supply: such energy metering ICs require a rather "clean" voltage source, an LDO will be fine. You may want to use two separate LDOs, one for the microprocessor / comms transceiver part, and another one for the metering ICs.

author: mheruian
author_rank: Contributor
timestamp: March 15, 2018, 04:46:41 am
content: Hi Captain!Quote from: capt bullshot on March 14, 2018, 02:21:05 pmThis will be goodOk, i had search some PT and these are huge but i would still consider to use them alternativelysince as much as possible, i want it to create a circuit board that is not big. PT are quite big to be placed on-board.Quote from: capt bullshot on March 14, 2018, 02:21:05 pmYeah, i'm not even quite sure about this but.. I had searched some isolation ICs that i could use. I like to ask if when it comes to isolation, what should I isolate?? i should only isolate the power lines (Vcc pins & GND pins of other electronic components except for the energy metering chip)??so far, this are the isolation chips I am referring to.http://www.ti.com/lit/ds/symlink/iso7240c.pdfhttp://www.analog.com/media/en/technical-documentation/data-sheets/ADuM3154.pdfI know that the one is an isolation specialized for SPI comm interface but, isn't it the same if I use the other one?Image links below will be my understanding on the isolation stuffs:Original Setup based on Datasheet ReferenceWhat is should be to have isolationis this right? only ground potential should i isolate? or the serial comm?Quote from: capt bullshot on March 14, 2018, 02:21:05 pmahh ok, so my thinking was reasonable, well i did re-read again the datasheet and it was talking about a crosstalk that can be due to the energy meter chip power supply, so i should use a separated regulators for them.

author: capt bullshot
author_rank: Super Contributor
timestamp: March 15, 2018, 06:28:20 am
content: You have to set up an "isolation barrier" in your circuit. Imagine an air gap that is allowed to be bridged by the isolator stuff only (e.g. one of the chips you mentioned and an isolated DC/DC converter, or an isolated AC/DC supply). No direct (wire) connection is allowed across this barrier.See these quick sketches (one for isolating the metering chip, the other one for isolating the DMX communication)Regarding these chips: Isolation of an SPI can easily be done with a general purpose isolator, no need for the dedicated one (except it offers useful features to you). Things like DMX (afaik a simple asynchronous communication) can be isolated using some optocouplers of appropriate speed rating (works also for SPI, and they're usually cheaper).Lowest cost and simplest HW would the CT / differential voltage sensing approach using a safely designed resistive divider without any other isolation means (this is often done this way in commercial energy meters).

author: mheruian
author_rank: Contributor
timestamp: March 15, 2018, 01:23:02 pm
content: Ok??So upon observing your two sketches about isolation and looking the basic application of the CS5480 datasheet, Captain! the sketch below is what I learned and understand (don't know if I get it right)Now I am concerned about this VDDD, GNDD, VDDA, GNDA stuffs. Did I mess them up wrong in my sketch?? Isolator chips have two (2) power supply sources and here's what on my mind, VDDA,GNDA are for analog stuff and VDDD,GNDD are for digital stuff. VDDA,GNDA for sensing of meter chip and VDDD,GNDD for SPI of meter chip, microcontroller and DMX. Correct me if I'm wrong pleaseQuote from: capt bullshot on March 15, 2018, 06:28:20 amthis is a new idea for me, going to look for these. I haven't experience using optocouplers yet.Quote from: capt bullshot on March 15, 2018, 06:28:20 amOh, ok. So that's why on the CS5480 datasheet's basic application, this was the setup because it was cheaper. Then i wouldn't have any problem following the schematic on the datasheet?Also, what is HW? i can't seem to find its meaning on internet

author: capt bullshot
author_rank: Super Contributor
timestamp: March 15, 2018, 07:15:36 pm
content: Yes, you've messed up with the VDDD, GNDD, VDDA, GNDA.Each side of an isolator requires its own supply, isolated from the other side. You did connect both sides to the same supply, doing so brigdes the isolation barrier with an wire, and both sides aren't isolated anymore.So you need two supplies: one for the "left" (mains related) side of the isolator, one for the "right" (isolated) side. The supplies itself must be isolated too (normal AC/DC supplies are).The reference schematic connects one side ("-" Input) of the CS5480 to the neutral wire and to its GND. This configuration isn't isolated from the mains and not a safe resistive divider.The safe differential resistive divider approach (eliminating the need for an isolator) would be somewhat different, in general like these "HIgh Voltage Differential Probes" intended to be used with oscilloscopes.Regarding the isolation barrier: To be safe, this must be gap between the isolated parts of the circuit that is at least 5.5mm wide. Any wire (or trace on a PCB) that is connected to any part on the "dangerous" side must have a distance of at least 5.5mm to any wire / trace that is connected to the "safe" side. The isolator must be properly rated for this purpose. Don't take that easy, we (the eevblog inhabitants) don't want you to kill yourself or hear your house burned down.See this quick and messy sketch of an "safe" differential resistive voltage divider:And see this example of a nicely engineered PCB implementing a "safe" resistive divider, some small CTs and a small AC/DC power supply with two isolated (from each other) outputs. This device is a commercial power monitor, intended for use on mains power lines. In particular, note the large free PCB area around the series connected Melf resistors, this is the necessary spacing to make the circuit safe, in conjunction with the proper value and rating of these resistors. As I said, this is not for beginners, you'd better use PTs (or simple mains transformers) to isolate your voltage sensing channel, especially since this is your first project messing with mains power lines.

author: capt bullshot
author_rank: Super Contributor
timestamp: March 16, 2018, 10:25:33 am
content: Quote from: mheruian on March 15, 2018, 01:23:02 pmHW just means Hardware - SW means Software, quite a common abbreviation in embedded developmentI found a schematic (within this datasheethttps://d3uzseaevmutz1.cloudfront.net/pubs/proDatasheet/CS5463_F3.pdf), showing the use of CT and PT to safely isolate the chip from the mains:Within this circuit, the "Low Phase-Shift Potential Transformer" can be replaced with a differential resistive voltage dividerWhen done properly (see my previous post, the PCB image), this results in the same level of safety for the user. The advantage of this configuration is these resistors are easily available, a suitable PT not (and costs more).Anyway, most of the reference circuits for these metering ICs tie their circuit ground to either Neutral or a Live Phase. Doing so requires proper isolation between the meter chip and the MCU and makes debugging the circuit more difficult and more dangerous.This is a warning: Never treat the Neutral wire in mains power installations as a "non dangerous" potential. Anything that is tied to the Neutral wire must be treated using the same caution as if it was tied to a Live wire.

author: capt bullshot
author_rank: Super Contributor
timestamp: March 16, 2018, 11:05:09 am
content: So, I've got one more example of proper digital isolation:This is a demo board showing the usage of a digital isolator chip and additionally an isolated DC/DC power supply.Especiall note the gap in the PCB copper underneath the isolator chip and the small transformer. This is the proper technique to build an "isolation barrier".You'd still have to observe the isolation ratings of the components, the small transformers use e.g. special wire (Tex-E) to ensure the isolation.The gap is less than 5.5mm, so though this example board will work fine on mains potential, it won't give you safe isolation from mains related potential (as required by common standards).

author: mheruian
author_rank: Contributor
timestamp: April 10, 2018, 06:29:50 am
content: Hi Capt!Long time no talkjust got home from a long vacation. Thanks a lot for everything!Now I understand pretty much what Isolation really means. You are really right that I should go for Isolation if I really wanted to live (even though she left me</3 hahaha!) Though regarding the PTs, i have research what it is and search also some of it on electronic suppliers online (digikey, rs, mouser, etc) What specs should I be looking for? I now understand PT are just step down transformers right? Would likethiswill do? Low phase shift means lower voltage on secondary?

author: capt bullshot
author_rank: Super Contributor
timestamp: April 10, 2018, 08:42:30 am
content: OK, welcome back.So what you linked to Mouser are power transformers. They can work as PTs, at reduced accuracy. The most important difference between a power transformer and a PT is the usage of the magnetic core. Power transformers use the core up to saturation at nominal voltage (for cost reasons), while proper PTs have a decent reserve here. Phase shift and transformer ratio are also to be concerned - Power transformers don't care about phase shift and specify ratio (primary voltage to secondary voltage) at nominal load, while PTs are designed for minimal phase shift and ratio at light or no load.So, to select a suitable power transformer to be used as a PT:- To overcome saturation issues, go for higher primary voltage (e.g. get a 300V primary transformer for 230V mains voltage). This gives you the reserve that a PT has here, and reduces waveform distortion.- As you don't put load on the secondary, go for a small transformer (maybe rated for 2 VA).- Select secondary voltage as you like, doesn't matter too much here, just adjust the voltage divider resitors (between the transformer secondary and energy metering IC) accordingly. Most probably you'll end up with a common nominal voltage like 12V here.- Due to the small size and high internal resistance of the transformer the transformer ratio will be very different than nominal. So supposed you have a 300V (primary): 12V (secondary) / 2VA rated power transformer, the nominal ratio will give 9.2V (sec) at 230V (pri), but in reality, you'll see a remarkably higher voltage (maybe 14V) here. This difference is smaller for a larger (more VA rating) transformer. Phase shift will be okay-ish though not specified. You might want to experiment with small loads on the secondary.- Most probably you won't find a 300V primary transformer :-( - try one that is rated for 380V or 400V primary, they might be more common.- Calibrate the whole system (transformer, secondary voltage divider, energy monitor IC) at your nominal line voltage applied to the primary of the transformer. Simplest way would be to measure your real mains voltage with a suitable meter, and adjust your system to display the same value for the voltage.- In case you can't find a 400V primary transformer, use one rated for your nominal mains voltage, try to get a smallish (10VA) toroidal core.BTW: Your mouser link shows some "Auto transformers". Don't use them, they are not isolated.

author: tggzzz
author_rank: Super Contributor
timestamp: April 10, 2018, 09:35:16 am
content: Quote from: capt bullshot on March 14, 2018, 12:23:13 pmMore important is other people's personal safety.Mains electricity can "bite" in many unexpected ways. The reason for building codes and safety codes is to minimise (but not eliminate) danger.It is, as everybody knows, impossible to make things foolproof, because fools are so damn ingenious.

author: mheruian
author_rank: Contributor
timestamp: April 10, 2018, 02:51:13 pm
content: Quote from: capt bullshot on April 10, 2018, 08:42:30 amAye aye Captain!Thanks again for everything!Your awesome! Can I ask how long it takes for you to know a lot about mains? Base on all your suggestions about transformers, looks like there are more to these like these are just summary insights for PTs where actually its more tedious and there's a lot of transformers there. Do you read some books regarding these like books just for transformers, etc?BTW. i like your signature, maybe I'll stick to non-isolation to welcome evolution xD hahahaha! jk.Quote from: tggzzz on April 10, 2018, 09:35:16 amThanks tggzzz!would do! since somehow, I am ingenious at best haha!

author: capt bullshot
author_rank: Super Contributor
timestamp: April 11, 2018, 05:53:42 am
content: HiIt's all about experience, nothing else ...I've made my first experiences with electricity as a maybe 5 yo kid, my grandma told me, I was looking over the shoulder of an electrician wiring some light switches in my parents house and telling him "You need to connect the blue wire to the other blue wire!"A few years later on I made all the mistakes an engineer has to make once in his life, like blowing up a mains connected circuit by using a scope, experiencing epic failures when building some electronics kits that never worked and I never understood what I'd build, but I wanted to build, killing an early japanese transistor radio by torturing it with an piezo gas stove lighter making real impressive sparks (today one would call this ESD testing), wondering why these little cylindrical light bulbs did light up only once (indeed those were 5x20mm glass fuses), ...And yes, I've read a lot of books in my life, at least 95% of them beeing thrillers, science fiction or fantasy novels. I don't know a book especially on transformers, but there are good ones out there, like "The Art of Electronics" by Horowitz and Hill, "The Art and Science of Analog Circuit Design", "Analog Circuit Design" both by Jim Williams, "Troubleshooting Analog Circuits" by Bob Pease, ...The book that got me started was some kind of an instruction book on how to build a Mixer / Amplifier System (I've got this from the local public library) - That was the first project I wanted to build, and I convinced my father to buy all the stuff at a local electronics shop, build it - and it never worked. Yes your first bigger project will be a fail, but you'll learn from it.Today, I'm an engineer working in a large company, and apalled by the lot of paperwork and little real engineering that is left to do ...

author: tggzzz
author_rank: Super Contributor
timestamp: April 11, 2018, 09:12:26 am
content: Quote from: capt bullshot on April 11, 2018, 05:53:42 amEngineeringis all about predicting why things will work, how they might fail, and how such failures are avoided and/or contained. That is mostly "paperwork", and a good thing too.Putting things together and expecting them to work because that's a proven way of dong things is either technician work or manufacturing.Putting things together to see what happens, and/or working out what did happen is either playing around or being an expert witness. (The latter also requires a lot of paperwork.)So don't moan about the paperwork.

author: capt bullshot
author_rank: Super Contributor
timestamp: April 11, 2018, 11:18:13 am
content: Quote from: tggzzz on April 11, 2018, 09:12:26 amI don't complain about that kind of paperwork, indeed I've done a lot of that in the recent years (within functional safety related projects).

author: Araho
author_rank: Regular Contributor
timestamp: April 11, 2018, 11:29:37 am
content: Quote from: tggzzz on April 11, 2018, 09:12:26 amYet, if one listens to the Adam Savage-sized child inside all our hearts, there is always room for experiments: The only difference between science and screwing around, is writing it down!(Of course, it's still paperwork. Just of the more fun kind!)

author: tggzzz
author_rank: Super Contributor
timestamp: April 11, 2018, 02:12:16 pm
content: Quote from: Araho on April 11, 2018, 11:29:37 amDefinitely true. It shouldn't be confused with engineering, but it might lead to some novel engineering.