My goal is to install energy monitors in and around my neighbor’s breakout boxes.  Even at it’s simplest install, mucking around within a person’s home electricity is not something people will easily agree to.  One hurdle is the installation.  The HappyDay Energy Monitor PCB must implement the easiest possible installation and maintenance in North American houses. To achieve this, I decided to evolve and adapt Tisham’s Dhar’s excellent work described in the “Thanks to Those That Went Before” section below.

As I write, the Kicad files involved in PCB Layout have been sent to OSH Park. Parts have been ordered from DigiKey. I am excited to solder the chips to the PCB and see how far I can get before I botched something in the design or layout. In the past, it has taken me 3-4 iterations to get a fully working PCB. Certainly, my goal is to take less iterations. However, I do not kid myself into thinking I got everything right for what I call this sacrificial draft. I have learned it is best to finish the design/layout then iterate as soon as possible to understand better what I am doing :-). As far as the expense, it would cost me far more to take a course. Besides, I am not a great learner within a structured environment.

The Goal

The goal of this post is to document what I have learned after finishing the initial schematic and Layout of the HappyDay Energy Monitor PCB. 

Thanks To Those That Went Before

Thanks to Tisham Dhar’s excellent work, I have a firm schematic foundation on which I will build.  Prior work I will explore, evolve, and adapt include:

I have also paid for some consulting time from Tisham which has already had a significant benefit in my knowledge and ability to finish this project.  Tisham has a tremendous amount of knowledge on measuring energy and using the atm90e26.  He is extremely helpful and has the rare ability to clearly explain his choices and concepts.

Open Source

The HappyDay Energy Schematic I reference/am working on is located at this GitHub location.

Requirements

  • Optimize for North American Houses.  North American houses use 3-wire single phase wiring to supply energy to 120V and 240V appliances.  This means the design must accommodate:
    • Two CTs.
    • Two atm90e26s.
  • Consolidate power sources into a circuit breaker.  My current prototype uses two of Tisham’s atm90e26 FeatherWings each with it’s own 120V AC-9V AC transformer.  An additional power source is used for the Feather.  This is messy.  It requires me to run an extension cable from one side of my garage to the other since there are no outlets near our breaker box. Instead, this design will use a 240V circuit breaker to supply energy to the PCB’s ICs.

Schematic

The schematic is separated into two areas:

  • The “main schematic” contains the power circuits.
  • The ATM90_Circuit.sch sub-schema contains the circuits from the power schematic to the atm90’s and Feather (the DC part of the circuit).

Power Circuit

Power Coming From The Grid

As we can see from the diagram below:

OEMPictureElectricityIntoHome

(Image from here)

In our North American homes, 120Vcomes in through two power lines (L0 and L1).  A third line (N) acts as the reference point (analog ground) for voltage/current measurements.  Here is my evolution of the Tisham’s din_power schematic for this part of the circuit:

NewImage

The parts used are noted within the PN field of the component within the schematic.  The reason the rather large 1206 size is used is to get chips that work well in high voltage scenarios.

Clamping Down on Noise

Surges

The MOVs(Metal Oxide Varistors) on L0 and L1 clamp down on the voltage coming in when there are power surges.  Most of the time, voltage in North American homes oscillates from 0 to a peak voltage of 169 volts.  Sometimes this oscillation is disturbed by a spike in voltage caused by a lightning strike or perhaps switching in the power grid:

The ferrite bead clamps down on the high frequency noise that is coming in the N line.

Connecting to the Circuit Breakers

The connector/cable going from the energy monitor to the circuit breakers is modeled after the one used by the Sense monitor:
NewImage                 NewImage
This is why there are 4 pins instead of 3. So that a molex connecter can easily be used.

Voltage Sampling

The Open Energy Monitor project has great info on the how and what of voltage sampling.  The upper part of the voltage divider used to scale the voltage has four resistors in series.  

NewImage

 

I asked Tisham about this.  He said this way, if any one of the resistors breaks down, the full 120V won’t be sent to the rest of the circuit.  Tisham also noted the resistors need to be rated to handle the incoming voltage (in my case 120V…but to be safe probably 240V rated resistors are a better thing to use).  When building the voltage divider don’t forget the info in the atm90e26’s data sheet.  The pins that are for voltage sampling (15 and 16): …are differential inputs for voltage. Input range is 120μVrms~600mVrms… The maximum reading Vout can be for Vrms is 600mV.

The values for the resistors weren’t entered.  Since 600mV is the highest that can be read, and the lower resistor is 1K, the upper resistors must add up to 199,000 to fit the voltage divider formula:

if R2 = 1000Ω, Vin = 120V, Vout = .6V, R1 = 199,000Ω.  Tisham updated his schematic such that each resistor is 220KΩ 1206 – able to handle at least 240V.  This means the total resistance is 880KΩ…which is a much larger R1 value than I expected.  Tisham noted the requirement for additional head room for measurements. 

DC Power

To get to DC power, one of the L Lines and the N line acts as input into a SMPS.  Tisham’s schematic uses a Hi-Link SMPS.  As I researched SMPSs, I became concerned with the safety of using Hi-Link’s, particularly after reading Skippy’s Random Ramblings.  It will cost me a lot more.  On the other hand, I am hoping to live past this project.

NewImage

(Note: Values for the capacitors come from the RAC03-GA data sheet.)

I picked one that:

  • Outputs a 3.3V regulated voltage.  This way, there is no need for additional LDO’s.  
  • Had passed the “important” safety tests.  I have limited knowledge on power supply safety standards.  I found this Digikey video by CUI Inc. to be helpful.  I chose RECOM’s RAC03-GA.   (Note: Digikey ran out of RAC03-GA’s.  The backorder said they’d have this part in a year from now.  I bet if I sent make to Digikey they’d update.  However, I have not had good luck getting chips in a reasonable time when they are backordered.  I ended up with the RAC04’s.  They appear to be “the same” in key elements The 04 handling 4W instead of 3W and more current.  

Isolating and Connecting AC and DC Grounds

After getting to a circuit that provides regulated +3.3VDC, the circuit plugs into a DC-DC isolator.  This way, the DC power to the Feather does not interfere with the ATM90e26’s measurements.  In addition, the ground potential is set at an equivalent distance.

NewImage

Current Sampling

Two Current Transformers (CTs) are needed to get current readings on the two 120V lines.  The CTs use a TRS 3.5mm audio jack as the connector to the electronics.

The way the ATM90e26 samples current is different than the example Arduino sampling on the Open Energy Monitor web site.  Pins 10 and 11 of the atm90e26 (the current reading inputs for I1P and I1N) are differential inputs.  This means there is no DC bias in a schematic using the ATM90e26.  I ran an LTSpice simulation to best understand the OEM design:

In this simple run, we can see:

  • A Burden Resistor of 33Ω converts the current to a voltage.  The OEM post shows the calculations used to come up with the value for the burden resistor (i.e.: In the picture above, Vpp will be between 0 and 5V).
  • A DC Bias lifts the ADC’s current readings up by AREF/2 (in this example 2.5V).  This way, the negative current values (from the AC circuit) can be measured by the ADC, which measures from 0 to 5V (on the Arduino).
Here is the schematic design I have for the I1N and I1P inputs:

NewImage

The CT plug is a TRS 3.5mm audio jack:

Testing

I started testing using a modified power cord:

NewImage

Voltage Measurement

I started by testing L0_SAMP.  I placed the chips needed to get through this part of the circuit:

NewImage

The biggest challenge I had with soldering the chips onto the PCB was getting the Varistor on.  The chip has a fat plastic body with what I consider to be iddi-biddy pads.  Not only did this make it hard to solder the chip, but also it was easier to “break off” the PCB since the body was far bigger than it’s iddy biddy pads:

NewImage

My goal is to use the least amount of chips to get to a test point.  The first test point is L0 voltage sampling.  Here are the results for L0 voltage sampling using the test points:

NewImage

If I recall, the Vpp fits within the maximum for the ATM90e26 of 660mV.  What I don’t know is how to interpret 456mV…what does this mean? Hmmm…. I’ll get to that after a bit more testing….

3.3VDC

My next test point was adding on the chips that transforms one of the 120VAC lines into a decent 3.3VDC line:

NewImage

Silly me…drat..I ordered two packets of .001µF 1206 high voltage caps instead of one package of .001µF and one package of .1µF.  Undaunted (and perhaps unknowingly stupid of me) I’m going to try an 0805 .1µF for now that I have on hand.

NewImage

The protagonist in the above shot is the rather large and expensive RAC04-3094-5-ND.  If the circuit is working, the green LED should go on.

FrustratedI put the chips on…and…and…the LED doesn’t light.  Bummer.  
Simpson DOHOn further inspection, I’m pretty sure the break in the circuit was caused by something that I did that in hindsight was incredibly stupid. The holes for the poly fuse are too small.  So I punch bigger holes…and well…cut through the circuit:

NewImage

OKIDOK.  Well, that was fun!  More to follow…..

 

Advertisements