Relay Panel Project (with Current and Voltage Monitoring)


#1

I am starting a new project! (Always starting new projects before the last one is finalized :wink: ) This project is a desire to solve a problem in my warehouse. We have approximately 13 lighting circuits that run on 277V. Currently, my warehouse guys go to the breaker panel and flip on all 13 circuits individually. I do not like this process for several reasons including: breakers are not designed to be switches and they are degrading (and have been for 20 or more years), employees have to enter a dark warehouse to get to the breakers, the lighting breakers are on 2 separate panels which is confusing (and may be of differing voltages). In researching the solution, there is such a thing as a “relay panel” for lighting control. A relay panel is installed in between the breaker panel and the load. It takes the place of physical wall switches and allows some automation based on I/O from other systems. In my search, I really like the offering from Lyntec because of the built in web server and various bus interfaces (DMX, BacNet, Etc.) However, the one supplier I found online was selling a 16-relay panel for approx. $5,000 USD. For that price, I might as well indulge my proclivity for EE projects.

I don’t like re-creating the wheel if it already exists for a reasonable price. But in this instance I can’t find exactly what I’m looking for. I like the offerings from ncd.io that @rickkas7 mentions from time to time. The boards look very clean and well engineered. I have a few issues that are preventing me from using those off-the-shelf solutions. I started to formulate some design criteria based on a comparison to the ncd.io heavy-duty relay panel:

  1. Must handle 277V @ 20A single-phase (and lower single-phase voltages. i.e. US Standard 120V).
  • 277V is common in industrial and warehouse settings specifically for lighting. It allows longer run with less voltage drop (or perhaps a greater allowable voltage drop based on a standard 5% allowable loss.)
  • All of my lighting has been converted to LED fixtures which I believe act as inductive loads.
  • I am selecting components based on 300V @ 30A for a safety margin.
  1. I want more than just the ability to turn things off and on. I would like to add current and voltage monitoring and a record of power usage in the last x days/weeks/months/etc. I think this is a great application for the Photon (of which I have several). I also like how the ncd.io boards are multi-board compatible and use adapter boards to accommodate other platforms. (I hope that isn’t patented.)

  2. Must have basic automation available in other commercial panels such as relay groups, schedule-based events, I/O-based events, internet/phone/app control, etc. Again, a great application for the Photon.

  3. Should be modular and forward-thinking in terms of expansions. To that thought, the end-user should be able to select the number of relays they want to install. Also, there should be a separation of the controller and the relay board.

  4. I would like to have visual indication of which circuits are “On” from the exterior of the electrical panel. I would also like the ability to toggle those circuits from an exterior switch or button.

  5. System should have capability of adding remote switches and visual indicators in order to actuate the circuits (think a button panel next to the security alarm panel 100ft away from the relay panel.).

  6. (…might be a duplication of #3, but very specifically, I would like to turn all the lights on when our security system is deactivated. And conversely, turn all the lights off when the security alarm is activated. So some sort of contact closure input from that panel is the ultimate goal.)

That covers the general project criteria. I have started to put together a Bill of Materials and research the components to build the relay board. At the same time, I’m keeping my eye on what hardware is needed for the controller interface. My criteria for the relay board includes:

  1. Must choose a relay for 277V @ 20A. Being that the LED drivers act as inductive loads, I know there may be issues with contact arcing on the relays. So the relay should have protection from contact arcing and power surges. In general, I will over-specify the voltage ratings when selecting components.

  2. Must provide an electrician-friendly way of hooking up circuits. The ncd.io heavy-duty relay board only provides quick-connects. It is costly, labor-wise, for an electrician to crimp or solder a quick connect onto every high-voltage wire connection in the panel (it may be against code for all I know.) All those wires will be solid conductors (12 or 14ga) usually MC (not romex in commercial applications) which may not be the best for quick-connects as well.

  3. Low voltage must be isolated from high-voltage via transformers or other galvanic isolation. Most relay panels also have a physical separation barrier so the board must be laid out so that such a barrier will be effective (cannot mix low voltage components on the high-side of the board and vice versa).

  4. Cost is of concern… try to balance cost vs desired feature set. I don’t have a maximum cost specified but if I can do 32 circuits under $1000, I think that would be great!

  5. Must include a relay override/disable switch for electrician troubleshooting. Relay should be able to be forced into an permanent on state as well as a permanent off state. And then also a position to give control back to the I/O of the controller.

  6. Would prefer to include both current and voltage sensing circuitry.

  7. Should have LED indicators for “Relay Actuated”, “Current Flowing” and “Voltage Present”. Current and Voltage indicators are dependent on implementing those respective sensing circuits.

I did a lot of research on how to do the current and voltage sensing portion of this circuit. I ended up using SMD current sense transformers and a quad op amp to do the AC to DC conversion as well as light the current/voltage sense indicators. I am using the Precision full-wave AC/DC Converter circuit in that link (modified to only use +12v and GND, and the input will be 0-5v AC and output should be 0-5V DC). I would appreciate any input from all you experts out there if there are any issues using that circuit.

Here is the Relay Board v0.1 circuit (this is only for one relay… once prototyped and perfected, I’ll create a 4-relay and 8-relay version):

Here is the bill of materials so far (currently, the cost is at approx $16/relay. for a 32-relay panel, that is $512. This is just for the relay board and does not yet include the controller.):

After this is finalized, I’ll move on to the controller but I already have some of the components selected. I’ll save that for a subsequent post.

I appreciate any community feedback.


#2

This is a great post an a lot of info to digest.
I have a large Industrial Client that has expressed interest in a product exactly like this.

The Industry Standard for your “Relay Override Switch” is commonly called an HOA Switch (Hand-Off-Auto)
Hand = manually activate the circuit locally
Off = manually deactivate the circuit locally
Auto = allows Automation from local controller or remote

Since you are designing for inductive loads, you may want to add 1 interlock circuit for an Emergency Stop (E-Stop) for future applications that could drive pumps/motors. An E-Stop Interlock also adds another layer of protection for personal safety while working inside the panel.

I haven’t studied the circuit diagram, but an Opto-Isolator would help provide isolation between the Primary and Control circuits.

My client has 277V Industrial Lighting Circuits with Delta Transformer Connections which are “Un-Grounded”. I have no idea how/if that would impact your circuit protection or voltage sensing design.

Another thought is Personal Liability. You may be assuming substantial risks for the next 50 years. If you change your mind (and I’m not suggesting that you should), NCD.io can design/manufacture a product to fit your needs. It wouldn’t hit your target price of $1k, but they have helped me with many Industrial Applications, some requiring new products. @IOTrav (Travis) is an active forum member from NCD.io.

Again, great post and I look forward to seeing how you progress.


#3

@Rftop, Thanks for the comments. Regarding safety and liability, I agree and I hear you. I’m one of the first ones to remind people on here that high-voltage projects aren’t the same as building a low-voltage GPS logger or something. Low voltage projects won’t kill you and usually won’t burn the place down when overloaded (except with cheap/knock-off batteries). With that said, I think I’m going to pursue this at least through a prototype. I am trying to make good component selections with a high safety-margin as well as UL certification when available.

Regarding HOA switch, thanks for putting a name to it. Didn’t know it was an industry standard but in my train of though, it’s a must have for locking out I/O control when working on a live panel.

Regarding the E-stop interlock, I like the idea and if I don’t implement, I could still add the ability to add such an interlock by the end user. In my application, I would probably add a single e-stop switch inline with the 12V supply connection for the whole panel. That would effectively disable every relay by removing the 12V supply. I think it would be easy to add an interlock for each relay circuit by adding a MOSFET inline with the 12V supply. But before I do that, don’t you think the E-stop switch on a circuit-level would be better implemented on the high-voltage line at the load? In other words, instead of running a low-voltage interlock line from the panel all the way to the motor, just place an E-stop switch at the motor on the high-voltage circuit.

Regarding the opto-isolator, where exactly would you might place that? I’ve thought about this a bit and I could run the I/O control through an opto-isolator (to protect from the relay’s low voltage coil), but then I would still have the current and voltage sense outputs that would not be protected. Would the MOSFET not provide any isolation from the relay? I do not know how to run the sensing circuit outputs through an opto-isolator without losing the voltage data that needs to be measured. However, when designing the controller there will be no direct connection between the relay board outputs and the microcontroller. I plan on running an I2C bus with a lot of GPIO expanders and multiplexers. So perhaps just the transformer isolation is enough.

Regarding the Delta transformer, I think the panel, as a whole, needs to have a single earth ground in order to ground the enclosure. However, for the actual relay circuits, I do not need earth ground. At a minimum, the end user only needs to supply one connection from the breaker panel (the “Hot” connection) and then run a wire to the load. In my case, I need 13 “hot” wires run from the breaker panel to the relay panel. All the load wires currently hooked up directly to breakers would be removed from the breaker panel and run into the relay panel instead.

My understanding is that 277v is derived from one leg of a 480V 3-phase supply measured between that single leg and neutral. (There a quick explanation here). If you measure across any 2 legs of the 480V 3ph, you get the 480V. The current sensing would function with only the hot wire hooked up (no need for ground or neutral.) And in my initial schematic I did not have voltage sensing and just the current sensing. Now in order to get the voltage sensing, you have to supply either a neutral or ground connection for each relay circuit. I chose to use the neutral because I believe you would trip a ground-fault circuit breaker if you shunted some current to ground (via the voltage sense transformer, which was designed to use a constant 1 watt by the way.). I almost left out voltage sensing altogether because it might just be easier to specify the nominal RMS voltage (i.e. 277V) when you configure the controller at time of install. But then I though, “For only an extra few dollars, I can add that circuit in now. Better do it now than later.” But that also means at time of install, the electrician will have to run 2 conductors from the breaker panel for every relay circuit (both Hot and Neutral). The end user could opt to only run the hot wire for speed and cost savings and fall-back to assumed nominal voltage (specified in firmware) instead of real-time voltage. Real-time voltage vs assumed RMS voltage could make a difference in calculating true power (watts) versus apparent power (VA)… see this reference.

I started laying out a controller and I think I can achieve a max density of 128 relays per controller board and a max 8 controller boards for one micro-controller for a max of 1024 relays per installation. The difficulty is that if the main uC needs to be available for control requests, then it can’t handle all the current and voltage sensing simultaneously. I am thinking about adding a dedicated uC (like an ATTiny85) for just the second-by-second sensing on each controller board and the main uC (Photon) would aggregate everything up periodically for reporting and storage.

Thanks again!


#4

@ninjatill, I agree with your comments.

E-Stop:
I’ve never read all the various CODES (OSHA, NEC, NFPA, etc). In my mind, an E-stop is the fail-safe to protect people in the event of failure from any 1 piece of hardware (For instance, if the contacts welded closed in the $3.36 Relay). I guess the best fail-safe may be a local contactor (operated by E-Stop) at the Motor leads when used in that type of application?

Optical Isolation: I didn’t think about your voltage sensing. That gets tricky.

277V Delta: I have heard of Industrial Plants that originally installed Lighting as Delta Distribution Circuits to save money. When later changing out the lights for better efficiency, they had to install transformers at each light for a ground reference. I probably understand less than 1% about ungrounded systems.

I like your idea for the Photon to just aggregate the readings and not perform the measurements & calculations to help future-proof the design. User Code on the Photon/Electron would focus on the IoT aspect and wireless remote switches, and not screw up the Power Calcs while testing Particle firmware.


#5

When we were talking to the lighting contractor about our LED retrofit, they had the same questions… “what what the voltage? and do we need to install transformers?” Although they were talking about one transformer per circuit, not per light/fixture. I think since we had breaker panels with 277V and a neutral already present, no transformers were needed. Here’s another reference that talks about Wye vs Delta electrical service. It seems that in the Delta configuration, the electrical service does not include a neutral. So you need some sort of step-down transformer for the lighting.


#6

That agrees with my limited understanding also.
The particular Plant I mentioned originally “saved” money with the Delta by not installing the Neutral Bus for the lighting circuit Distribution. That turned out to be a bad decision later on.

What do you think about modifying your circuit to switch primary phase instead of neutral?
Would that allow your product to be used in Delta Lighting with no neutral (by installing 1 small X-former for the voltage measurement ground reference at your product) ?
That doesn’t do anything for your particular installation, just possibly opens up future applications for the product. Not a suggestion… just brainstorming.


#7

My design does switch the primary phase, not the neutral. The neutral wire is only present for voltage sensing and could be omitted by the end user. Are we talking about the same thing? I hope :wink:.

Conceivably, the relay board design, as-is, could handle 220V applications but you would only be switching one of the hot legs. The other hot leg could be attached to the neutral terminal to get the voltage measurement (as well as being hooked up to the other side of the actual load device.) The relay is rated for a max 277V though so delta configs can’t be used. To be proper, 220V applications need a double pole switch so that both hot legs are disconnected together. I thought about some way of using a selector switch to tie 2 of the relays together to activate simultaneously so that it would work with 220V circuits. But then you have to reconfigure the sensing circuits to measure across hot-to-hot instead of hot-to-neutral.

I think I’m going to save 220V and 3-phase control for variation of the relay board. One of my main design points was modularity so that you could conceivably have a single-phase relay board and a 3-phase relay board attached to the same controller. The 3-phase board would have to have 3 relays per circuit (1 for each phase or hot wire) and all 3 relays need switched simultaneously. Or use a single SP3T relay. Additionally, you would have to have 3 separate current and voltage sensing circuits. The single-phase design wouldn’t have to be modified much except that 3 logical relay assemblies would be combined to operate simultaneously. And the relay selection for 480V or 680V would change the board layout. I just looked and some of those relays are beefy and only support screw terminals directly on the relay. Like this one. So if I were to sell this, then the 3-phase board would be appropriately priced much higher than the single-phase board.


#8

Here’s a quick status update… I’ve been working on the controller board. Here’s the general idea of how it works.

  1. The entire board is “hidden” behind a 4-channel I2C Multiplexer. The idea is that each channel will be dedicated to a certain operation. Channel 1 is for relay control, channel 2 for circuit indicator (LED) control, channel 3 for button input and channel 4 is for the “sensing buss” (current and voltage monitoring.) The reason for this layout is that when you add more than one board to the installation, you simply set the I2C address of the board multiplexer and add it to the system. The I2C address scheme (behind the multiplexer) of that board should be identical to every other board. The separate, dedicated channels should mitigate the need for deconflicting I2C addresses of dissimilar components and allow for maximum density of like components.

  2. Channel 1: Relay control. Contains up to 8, 16-channel I2C GPIO expanders (all configured as outputs). That should allow 128 relays per each controller board.

  3. Channel 2: LED Indicator Control. Contains up to 8, 16-channel I2C LED Drivers. That should allow 128 indicators per each controller board (the chip I chose, PCA9955B, actually allows up to 27 I2C addresses but I don’t need that many because the GPIO expander density makes out first.) This is a constant-current LED Driver. I’m still working out how to get the power up to the indicators and what connectors I should use.

  4. Channel 3: Button input. Contains up to 8, 16-channel I2C GPIO expanders. Identical to channel 1 really but this channel is configured for input instead of output.

  5. Channel 4: Channel 4 gets a little complicated. This is mainly the channel containing the Analog-to-Digital Converters for sensing the current and voltage for each relay. I would like to sample both the current and voltage once every second. Since this is a time sensitive task, it makes sense to have a secondary, low-cost MCU to take these measurements and then aggregate/summarize them by minute and/or hour. I added an ATMega328PB controller to this channel to do these measurement. But in order for that controller to operate autonomously, it needs a “supporting cast” of components. To support the ATMega, I added an RTC and a FRAM. Since the ATMega is not network connected, the Photon needs to be able to access the RTC to update the clock. Also, the photon needs to access the FRAM once per minute or hour to get the aggregated power usage and report that data or store to SD cards. So I designed what I’m calling an “Arbitrated Buss” to segregate the RTC and FRAM from both the main and private I2C bus on channel 3. This arbitrated buss is controlled by the ATMega because it’s the ATMega that has a time sensitive need for the FRAM and RTC. It order for the Photon to gain control of the arbitrated bus, it raises an “Arbitration Request”. When the ATMega has ceased I2C comms, it will raise an “Arbitration Acknowledge” and reconfigure 2 dual analog switches to join the arbitrated buss to the main buss. At that time, the Photon can communicate with the components on the arbitration buss. During that time, the ATMega can continue to take measurements on a private I2C segment with the ADCs. When finished, the Photon lowers the ARB_REQ line and the ATMega takes control again. I decided to break off the sensing controller into a sub-board so that it can be removed for programming, upgrades, diagnostics, etc. There’s also a few extra components on this channel such as a pair of temperature sensors and one additional 16-channel GPIO expander for general input purposes.

  6. I decided to break off the Photon onto a “Communications Interface Board” (CIB). Basically it is a small carrier board for the Photon which also contains some components for long-range I2C communication on standard Ethernet patch cables. This allows the end-user to swap the CIB for one with an Electron or just a “pass-through” board without a controller (for adding dumb sub-panels… all still controlled by the one master.)

The hardest part of this project is finding the right connectors. At first I was going to use shielded modular connector (Ethernet) for hooking up everything. I just like that form-factor. However, that gets expensive real fast. I eventually found some board-to-board connectors that I liked for the add-on boards. For the relay connections back to the main controller, I ended up selecting some 10-position Micro-MaTch connectors using 10-conductor ribbon cable. I’m not sure I like the ribbon cable for this application because of the potential for interference and the higher resistance of the conductors, but I’m stuck. If anyone has a better idea for methods of interconnection, I’m all ears. It should be fairly low cost and able to guard against interference in a high-voltage cabinet. I’m also still looking for a method of interconnection for the indicators and buttons. I also need to build the 5V power rail. I’m still doing power calculations for all the components but it looks like I might need a few amps on that 5V rail. I only want a single external (to the controller board) 12V supply within the enclosure so I have to figure out how to build the 5V power rail on the controller board. If the indicators are hooked up to 12V directly, then I might only need 1-2 amps and then I can just use an LDO regulator or something.

Here’s a PDF of what I have so far. Please note, this is a draft. I have not finished I2C address deconflicting and selecting final passive component values (not to mention the missing connectors for the buttons and indicators.)

Here’s some screenshots of the add-on boards:


.