Schematic preview sizeSchematic (click for full size)
The schematic may look complicated, but the EnerJar's electronics are actually quite simple. Power is voltage times current, so we must take these values and provide them to the PIC as inputs, so that it can perform the calculation. There is also a bit of wiring for the LED display.

DANGER: The EnerJar's circuitry involves 120-volt AC line voltage. Improper care can result in potentially fatal electrical shock. Do not attempt this project if you are unsure of proper safety procedures. The plans for EnerJar are provided without warranty and the designers cannot be held liable in the result of property damage, personal injury, or death.

Seriously, the EnerJar does some pretty crazy things with AC voltage. Be careful when building it. Below are some design and building notes. Look for more photos and detailed build instructions in the coming days.

Power supply
In our original prototype, we used an old 5-volt cell phone charger as the power supply. The EnerJar draws almost no current, so any 5-volt DC wall wart will work.
CAUTION: Never solder the circuit with power applied to it. Doing so is extremely dangerous.

Current sensing
The EnerJar uses a very low-resistance shunt to measure the current. Ohm's law states that the voltage across a resistor is proportional to the current running through it. We can exploit this to create a very cheap and effective current-to-voltage converter. The shunt resistor, R7, that we use is a length of about 8 inches of 18-gauge wire. This is actually about the size of the wire in some extension cords, so the voltage drop across it is quite small, so this "resistor" gives off virtually no heat. To amplify the voltage, we use a high-precision instrumentation amplifier (IC3), the LT1167. This mighty chip can amplify many thousands of times with almost no distortion or noise. One of the features we are working on is auto-ranging, where we will use a digital potentiometer as the gain resistor (R8) to provide adjustable gain.

Voltage detection
The voltage is much more straightforward to get into a useable form. A 68:1 voltage divider (R5 and R6) is used to make the peak-to-peak voltage fall within the 5-volt range that the PIC is able to capture. This voltage is then buffered using one channel of our op-amp (IC1-d) before being sent to the PIC. The EnerJar can be modified to work with 240-volt AC simply by changing R6 to 1.5Mohm.

Voltage references
R1, R2, R3, and R4 form a voltage divider with outputs at a nominal 1.5, 2.5, and 3.5 volts DC. These voltages are buffered with the remaining three channels of the opamp, IC1-a through IC1-c. These form reference voltage outputs Vref+ (3.5v), Vref0 (2.5v), and Vref- (1.5v). I know the naming is a little confusing, I pulled an all nighter last night finishing the schematic but I will fix the naming in a future revision. Note that these voltages are nominal, the exact values aren't critical because the PIC has calibration factors that can correct for imprecision. (Currently these values must be hand-coded, so you need a programmer that can rewrite the values on the chip. We plan to develop an auto-calibration mode where you can calibrate the EnerJar to a 60-watt lightbulb, for example.)

Vref+ and Vref- are only used by the PIC as the high and low voltage references for the A/D converter. In other words, a signal at 1.5v or less will be converted to 0x000 by the ADC and a signal at 3.5v or above maps to the maximum value, 0xFFF. This has to be done because the instrumentation amplifier can't output a voltage within about 1.5 volts of its supply rails.

Vref0 is connected to the neutral AC line. This means that the 0VDC power supply rail is about 2.5 volts below neutral and the +5V rail is about 2.5 volts above neutral.

Parts list
Parts list
Under construction. We are continuously adding to the documentation. Let me know if you plan to build an EnerJar in the near future, I can answer questions that may not yet be documented on this site.

Note to those of you with 240 VAC power lines: The only change you are required to make is in R6, which should be increased to about 1.5M ohm. The exact value is not important due to the calibration process.

The EnerJar samples voltage

The EnerJar samples voltage and current several thousand times per second, and averages the instantaneous products over several 60-Hz cycles. This method accounts for power factor and does not make any assumptions about the characteristics of the load. Theoretically, the EnerJar could even accurately measure power on a DC supply!

sampling question.

I'm missing how you get anything but a zero average current. First the current flows one way, then 1/120th of a second later (@ 60 Hz), it's going the other way. The voltage across the shunt does the same, positive/negative, doesn't it? Is this taken care of somewhere else in the circuit? Am I not paying attention?

I think you could simplify the averaging process by putting the sample voltage through a diode to charge a small capacitor and feed this DC voltage to the LT1167. Probably needs a load resistor for response, so you don't just charge the cap to the highest load and stay there. A simple half-wave power supply to the LT1167 input.

Re: sampling question.

As you said, the current is (nominally) negative when the voltage is negative. Since the formula for power is Voltage x Current, the power will come out to be positive since a negative times a negative is a positive.
Averaging the AC values to DC will yield apparent power. This is different from real power, which is the actual power that is consumed by the device (and therefore, is what your electricity meter on your house measures). Wikipedia's article on AC power explains it a little bit better, but it isn't the most straightforward explanation. In the future I will write up a better one.

Re: Re: sampling question.

Doh! Forgot both would be negative. Thanks for the reply. Sorry for getting you off on a tangent.

Great work, guys.

This is a really great project! Do you have any advice you might share about component retailers for people who would like to build one of these and don't want to wait for the kits to be available? After a little googling some of the parts seem a bit harder to come by than others and in any case I would rather spend money with a supplier (or suppliers) that have proven themselves worthy of your recommendation.

Thanks and keep up the great work!

about calibration

You say something about calibration.
So how you calibrate it ??

thank you

Calibration baby!!!

Look on an appliance and see what is stamped on the back serial number sticker. If it matches, your good. It would be the W or Watts number for power. 1000 watts is one Kilo Watt. So add your watts up per hour according to the unit rating on the sticker, and add them up. 1000 watts is generally around .065 Cents depending on how big the crooks are that are supplying you. So 10, 100 watt bulbs will cost 1kilowatt per hour if all are on. .065 cents depending on your scale.

home built appliance parts

You do have a supermarket around your house right? Go there, buy some sears parts and your troubles are over. Building such an item requires some extensive knowledge of electronics and how electricity can damage your body:)))

cost of power

I've heard of 6 1/2 cents per kwh, but never .065 cents. You must mean .065 dollars.


Hi, how did you calibrate the current sensing shunt ?

Interesting project. Any

Interesting project. Any chance of documenting the changes that would be needed to make the circuit work with the 240v AC that the majority of the planet (ie, all but the USA and Japan) uses?

240, RTFM

If you would bother to READ a little, you would have seen that the comment that "R5 needs to be changed to 1.5 megohms for 240" appears in more than one place on this website. (Please forgive me if it's really R6.) So, the only change is that the value of one resistor needs to be changed.

Very cool. Look forward to

Very cool. Look forward to seeing the kit available.